Skip to content

refactor(frontend): remove unused environment, asset, and service code - #9624

Open
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:refactor/frontend-legacy-unused-code
Open

aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:refactor/frontend-legacy-unused-code

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Remove unused legacy files, dead mock methods, unread callback parameters, and a duplicate URL constant across the Angular frontend with no observable UI or runtime behavior change:

  • Unused environment and asset files: Delete the unreferenced environment.test.ts file (no tracked import or Angular fileReplacements entry) and the redundant assets/.gitkeep placeholder (the directory already holds tracked assets).
  • Computing-unit status service and mock: Remove obsolete listComputingUnits, startPolling, and stopPolling methods from MockComputingUnitStatusService (absent from ComputingUnitStatusService with zero callers), and declare the mock as implements Pick<ComputingUnitStatusService, StubbedMethods> so tsc rejects a stub the real service no longer has. In ComputingUnitStatusService, drop the unused isConnected and err callback parameters and fix a comment that named a nonexistent updateComputingUnits().
  • Workflow cover URL: Delete WORKFLOW_COVER_URL from WorkflowCoverService, a copy of WORKFLOW_BASE_URL ("workflow"), and build the cover URLs from WORKFLOW_BASE_URL.

Any related issues, documentation, discussions?

Closes #9621.

How was this PR tested?

Ran in frontend/ on 1991f8685c (Node 24, node .yarn/releases/yarn-4.14.1.cjs install --immutable --inline-builds):

node .yarn/releases/yarn-4.14.1.cjs format:ci
node .yarn/releases/yarn-4.14.1.cjs exec tsc -p src/tsconfig.app.json --noEmit
node .yarn/releases/yarn-4.14.1.cjs exec tsc -p src/tsconfig.spec.json --noEmit
node .yarn/releases/yarn-4.14.1.cjs build
node .yarn/releases/yarn-4.14.1.cjs test
  • format:ci (prettier-eslint --list-different and eslint ./src): passed.
  • tsc --noEmit (src/tsconfig.app.json and src/tsconfig.spec.json): passed.
  • build (production Angular AOT build): passed.
  • test (Vitest): 255 suites passed (7,382 passed, 0 failed, 1 pre-existing skipped in untouched operator-property-edit-frame.component.spec.ts).

Review follow-up 6aa87cffe3, run on Node 20.20.2:

  • format:ci, both tsc --noEmit projects, and build: passed.
  • Adding "startPolling" to StubbedMethods fails tsc -p src/tsconfig.spec.json with TS2344, and changing a stub's return type fails it with TS2416.
  • test: not run locally, because the Vitest setup file calls module.registerHooks, which needs Node 22.15 or later. CI runs it on Node 24.19.0.

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

Generated-by: Antigravity (Gemini 4 Neon)
Generated-by: Claude Code (Claude Opus 5.5), review follow-up

Copilot AI balanced review requested due to automatic review settings November 22, 2026 04:04
@github-actions github-actions Bot added refactor Refactor the code frontend Changes related to the frontend GUI labels Nov 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@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: @eugenegujing, @kunwp1
    You can notify them by mentioning @eugenegujing, @kunwp1 in a comment.

@codecov-commenter

codecov-commenter commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.67%. Comparing base (f030df1) to head (6aa87cf).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9624      +/-   ##
============================================
- Coverage     91.68%   91.67%   -0.01%     
  Complexity     5135     5135              
============================================
  Files          1302     1304       +2     
  Lines         58119    58092      -27     
  Branches       7582     7582              
============================================
- Hits          53285    53258      -27     
+ Misses         2923     2922       -1     
- Partials       1911     1912       +1     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from 1991f86
agent-service 99.56% <ø> (ø) Carriedforward from 1991f86
amber 85.76% <ø> (ø) Carriedforward from 1991f86
computing-unit-managing-service 63.83% <ø> (ø) Carriedforward from 1991f86
config-service 87.50% <ø> (ø) Carriedforward from 1991f86
file-service 82.16% <ø> (ø) Carriedforward from 1991f86
frontend 96.46% <100.00%> (-0.01%) ⬇️
notebook-migration-service 83.77% <ø> (ø) Carriedforward from 1991f86
pyamber 98.38% <ø> (ø) Carriedforward from 1991f86
result-service 85.71% <ø> (ø) Carriedforward from 1991f86
workflow-compiling-service 78.30% <ø> (ø) Carriedforward from 1991f86

*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.

@bobbai00 bobbai00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 0 must-fix · 1 advisory · 1 polish: clean dead-code removal, and every claim in the description checks out against the tree.

Simplifications (1)

  • workflow-cover.service.ts:25: duplicates WORKFLOW_BASE_URL, so it could be deleted rather than un-exported (advisory, see inline)

Polish: 1 quick touch-up (see inline comments).

Verification trace

Checked each removal at head 1991f86. environment.test has no reference anywhere in the tree and was never compiled: the angular.json file replacements cover only environment.ts and version.ts, and neither tsconfig.app.json nor tsconfig.spec.json includes it. The mock is provided via useClass in 13 specs, and none of them call listComputingUnits, startPolling or stopPolling. WORKFLOW_COVER_URL has no importer, and assets/ keeps 208 tracked files without the .gitkeep.

@kunwp1 kunwp1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the two comments already here and additional small suggestion.

- WorkflowCoverService: delete WORKFLOW_COVER_URL, a copy of
  WORKFLOW_BASE_URL, and build the cover URLs from WORKFLOW_BASE_URL.
- MockComputingUnitStatusService: implement
  Pick<ComputingUnitStatusService, StubbedMethods>, so tsc rejects a
  stub whose name or signature the real service no longer has.
- ComputingUnitStatusService: the terminate comment now names
  setComputingUnitsState(), which the refresh pipeline calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Remove unused frontend environment file, asset placeholder, and dead service members

5 participants