Repository navigation
refactor(frontend): remove unused environment, asset, and service code - #9624
aglinxinyuan wants to merge 2 commits into
Conversation
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bobbai00
left a comment
There was a problem hiding this comment.
🟡 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: duplicatesWORKFLOW_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
left a comment
There was a problem hiding this comment.
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>
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:
environment.test.tsfile (no tracked import or AngularfileReplacementsentry) and the redundantassets/.gitkeepplaceholder (the directory already holds tracked assets).listComputingUnits,startPolling, andstopPollingmethods fromMockComputingUnitStatusService(absent fromComputingUnitStatusServicewith zero callers), and declare the mock asimplements Pick<ComputingUnitStatusService, StubbedMethods>sotscrejects a stub the real service no longer has. InComputingUnitStatusService, drop the unusedisConnectedanderrcallback parameters and fix a comment that named a nonexistentupdateComputingUnits().WORKFLOW_COVER_URLfromWorkflowCoverService, a copy ofWORKFLOW_BASE_URL("workflow"), and build the cover URLs fromWORKFLOW_BASE_URL.Any related issues, documentation, discussions?
Closes #9621.
How was this PR tested?
Ran in
frontend/on1991f8685c(Node 24,node .yarn/releases/yarn-4.14.1.cjs install --immutable --inline-builds):format:ci(prettier-eslint --list-differentandeslint ./src): passed.tsc --noEmit(src/tsconfig.app.jsonandsrc/tsconfig.spec.json): passed.build(production Angular AOT build): passed.test(Vitest):255suites passed (7,382passed,0failed,1pre-existing skipped in untouchedoperator-property-edit-frame.component.spec.ts).Review follow-up
6aa87cffe3, run on Node 20.20.2:format:ci, bothtsc --noEmitprojects, andbuild: passed."startPolling"toStubbedMethodsfailstsc -p src/tsconfig.spec.jsonwith TS2344, and changing a stub's return type fails it with TS2416.test: not run locally, because the Vitest setup file callsmodule.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