Skip to content

refactor(frontend): extract agent payload and ReActStep mapping helpers#5995

Draft
Ma77Ball wants to merge 3 commits into
apache:mainfrom
Ma77Ball:refactor/agent-service-mapping-helpers
Draft

refactor(frontend): extract agent payload and ReActStep mapping helpers#5995
Ma77Ball wants to merge 3 commits into
apache:mainfrom
Ma77Ball:refactor/agent-service-mapping-helpers

Conversation

@Ma77Ball

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Added a private mapApiAgentInfo(api) helper in AgentService and routed createAgent, getAgent, and getAllAgents through it, removing three identical inline ApiAgentInfo -> AgentInfo mappings (including the duplicated delegate sub-mapping).
  • Added a private convertApiReActSteps(steps) helper and routed the three steps.map(s => convertApiReActStep(s)) sites through it.
  • No behavior change: the produced AgentInfo and ReActStep[] values are identical to before.

Any related issues, documentation, discussions?

Closes: #5990

How was this PR tested?

  • Run cd frontend && yarn test --include='**/agent.service.spec.ts', expect the existing AgentService suite (including the createAgent cases that flush an API payload and assert the mapped AgentInfo) to pass.
  • Typecheck with cd frontend && npx tsc --noEmit -p tsconfig.json, expect no errors in agent.service.ts (the only error is a pre-existing unrelated missing-module in migration-llm.ts).

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.8 in compliance with ASF

added a mapper convertApireActSteps... helper function to handle agent
get and create calls
@github-actions github-actions Bot added refactor Refactor the code frontend Changes related to the frontend GUI labels Jun 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @bobbai00
    You can notify them by mentioning @bobbai00 in a comment.

@codecov-commenter

codecov-commenter commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.84%. Comparing base (24b587f) to head (b6e62cc).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5995      +/-   ##
============================================
- Coverage     56.89%   56.84%   -0.06%     
+ Complexity     3058     2992      -66     
============================================
  Files          1129     1129              
  Lines         43802    43801       -1     
  Branches       4743     4741       -2     
============================================
- Hits          24922    24897      -25     
+ Misses        17449    17430      -19     
- Partials       1431     1474      +43     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 878eb8a
agent-service 44.59% <ø> (ø) Carriedforward from 878eb8a
amber 57.37% <ø> (-1.28%) ⬇️ Carriedforward from 878eb8a
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 878eb8a
config-service 52.30% <ø> (ø) Carriedforward from 878eb8a
file-service 62.81% <ø> (ø) Carriedforward from 878eb8a
frontend 51.18% <100.00%> (+1.05%) ⬆️
notebook-migration-service 78.57% <ø> (ø) Carriedforward from 878eb8a
pyamber 91.15% <ø> (ø) Carriedforward from 878eb8a
python 90.69% <ø> (ø) Carriedforward from 878eb8a
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 878eb8a

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deduplicate agent payload and ReActStep mapping in AgentService

2 participants