The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
8f0fe35538ceefe34860b1927b77affd74f72595 / Xinyuan Lin <[email protected]>
refactor(agent-service): deduplicate result formatting helpers (#9252)

### What changes were proposed in this PR?

Deduplicates result formatting logic between
`agent-service/src/agent/tools/result-formatting.ts` and
`workflow-execution-tools.ts`:
- Exports `formatInputOutputMetadata` and `jsonToTableFormat` from
`result-formatting.ts`.
- Replaces duplicate private implementations `formatInputOutput` and
`jsonToTableFormat` in `workflow-execution-tools.ts` with direct imports
from `./result-formatting`.
- Adds direct unit tests in `result-formatting.spec.ts` covering
`formatInputOutputMetadata` (shape formatting, upstream link resolution,
port sorting) and `jsonToTableFormat` (empty cases, TSV formatting with
index column).

### Any related issues, documentation, discussions?

Closes #9250

### How was this PR tested?

- Target test suites:
  ```bash
bun test src/agent/tools/workflow-execution-tools.spec.ts
src/agent/tools/result-formatting.spec.ts
  ```
  Output: 54 pass, 0 fail (119 expect() calls, 203ms).
- Full `agent-service` test suite:
  ```bash
  bun test
  ```
  Output: 317 pass, 0 fail (772 expect() calls, 2.14s).
- Type checking:
  ```bash
  bun run typecheck
  ```
  Output: `tsc --noEmit` clean.
- Code style formatting:
  ```bash
  bun run format:check
  ```
  Output: All matched files use Prettier code style.
- Mutation test:
Mutated `formatInputOutputMetadata` shape output in
`result-formatting.ts`; verified 5 tests in
`workflow-execution-tools.spec.ts` failed as expected, then restored
clean.

Report URL: https://github.com/apache/texera/actions/runs/41785438220

With regards,
GitHub Actions via GitBox

Reply via email to