Skip to content

refactor(upgrades): remove unreachable executed-task link dropdown - #218

Merged
jackchuma merged 1 commit into
mainfrom
toshi/cleanup-drop-executed-task-links-71e87337
Oct 29, 2026
Merged

jackchuma merged 1 commit into
mainfrom
toshi/cleanup-drop-executed-task-links-71e87337

Conversation

@jackchuma

@jackchuma jackchuma commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

What changed? Why?

Removes the executed-task link dropdown in the upgrade list and the execution-link parsing behind it. That code can never run:

  • UpgradeSelection only fetches /api/upgrades?readyToSign=true.
  • The route rejects requests without readyToSign=true and keeps only READY TO SIGN tasks.
  • So the badge only ever sees READY TO SIGN. Its EXECUTED hover dropdown, executionLinks prop, || 'neutral' fallback and success/neutral variant entries are dead.

Changes:

  • UpgradeSelection.tsx: replace StatusBadge and STATUS_VARIANT_MAP with <Badge variant="warning">{option.status}</Badge>. Same output for every task the API returns.
  • deployments.ts: parseExecutionStatus keeps status detection only (find the Status: line, return Executed / ReadyToSign / Pending, unchanged, with the same error handling). Deletes link collection, MAX_STATUS_FOLLOW_UP_LINES and normalizeUrl.
  • types/shared.ts: deletes ExecutionLink and Upgrade.executionLinks. TaskStatus.Executed stays; the API filter still uses status detection to exclude executed tasks.
  • README.md: drops link-format docs and the two "Executed with…" examples. Status rules stay.

Interfaces removed

Interface Why nothing depended on it
Upgrade.executionLinks field (and /api/upgrades JSON field) Read only by the unreachable StatusBadge branch. Ready-to-sign parsing never populated it, so successful /api/upgrades responses already omitted it.
ExecutionLink type Used only by executionLinks and StatusBadge.
normalizeUrl (exported from deployments.ts) Called only by link parsing and its own tests. No use in src, scripts, configs or fixtures.

History check: the dropdown and link parsing came from the initial commit; later commits restyled them or hardened URL validation. None shows plans for future use.

Notes to reviewers

  • Tests: deleted the normalizeUrl tests (cover removed code). The "omits execution links" test keeps its Status: EXECUTED → TaskStatus.Executed assertion, renamed to describe executed-status parsing; only its links assertion went. Added one test that a README with no status line yields no status, since that remaining outcome had no test.
  • Dispatched by an automated cleanup scan; behavior of remaining code is unchanged.

How has it been tested?

  • npm test: 154 passed
  • npm run lint, npx tsc --noEmit, npx prettier --check ., npm run build: pass
  • rg finds no remaining references to the removed names.

Why this cleanup

  • Production: +7 / −125 (net −118). Tests: +11 / −38 (net −27). README: +2 / −35.
  • Interfaces removed: Upgrade.executionLinks, ExecutionLink, normalizeUrl (see table above).
  • A reader no longer has to understand the hover dropdown, the status-to-variant map and its fallback, the follow-up-line link scanner, URL dedup and normalization, or the README link formats.
  • Keep-gate judge: the list only shows ready-to-sign tasks, so the new badge renders identically; status detection, error handling and API output are unchanged; nothing removed is pending work.

Co-authored-by: Toshi <toshi-noreply@coinbase.com>
J-Engine-Session: toshi:a5789614-b6af-453d-8496-0287e8b486b8
@cb-heimdall

cb-heimdall commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@jackchuma

Copy link
Copy Markdown
Collaborator Author

Review round 1

Reviewers: cbhq-openai/gpt-6.1-sol

  • Dropped in triage: [P2] Spec check: upgrade-list badge has no component test — the repo has no component-test harness, the badge had no test before this change, and it renders the same for every task the route can return; adding test infrastructure is out of scope for this removal
    Synced with main: 128d546 (already current)
    Validation: not run (no fixes)

🤖 Reply generated with Toshi

@jackchuma
jackchuma marked this pull request as ready for review October 29, 2026 12:14
@jackchuma
jackchuma requested review from 0xth4nh and xenoliss October 29, 2026 12:14

@0xth4nh 0xth4nh 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.

Looks Good to Thanh's Toshi

@jackchuma
jackchuma merged commit c781909 into main Oct 29, 2026
3 checks passed
@jackchuma
jackchuma deleted the toshi/cleanup-drop-executed-task-links-71e87337 branch October 29, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants