fix: web build + dev deploy failing on tsc strict checks#1151
Merged
zbigniewsobiecki merged 1 commit intodevfrom Apr 18, 2026
Merged
fix: web build + dev deploy failing on tsc strict checks#1151zbigniewsobiecki merged 1 commit intodevfrom
zbigniewsobiecki merged 1 commit intodevfrom
Conversation
The dev deploy + CI `Build frontend` step have been failing since PR #1148 (spec 011 merge). Root cause: `cd web && npm run build` runs `tsc -b` which is stricter than the root `npm run typecheck` I've been using for local verification. Three classes of errors surfaced: 1. `steps/webhook-url-display.tsx` + `steps/container-pick.tsx` had a `readonly /** jsdoc */ fieldName: string` pattern (pre-existing from spec 010/3). Stricter tsc parses this as `readonly: any` on its own + bare `fieldName: string` without the readonly modifier (TS7008). Downstream callers couldn't satisfy the broken interface (TS2345). Fixed by moving the JSDoc comment above the `readonly` keyword. 2. `pm-wizard-hooks.ts` verify-button flow passes `capability: 'currentUser'` to `pm.discovery.discover`, but the Zod enum at the tRPC input schema was missing `'currentUser'` (pre-existing from spec 010/2 — type union was updated but the enum wasn't). Every wizard Verify-button call failed at runtime Zod validation. Fixed by promoting the enum to `src/pm/types.ts` as `DISCOVERY_CAPABILITIES` (const array) and deriving both the `DiscoveryCapability` type union and the tRPC Zod enum from it — the two can no longer drift. 3. `jira/wizard.ts` mapped `details?.fields` directly to `providerCustomFields`, but JIRA's discovery shape is `{id, name, custom}` while the shared prop contract expects `{id, name, type}` (introduced by me in plan 011/3 / 012/2). Fixed by mapping `custom: boolean` → `type: 'custom' | 'standard'`. Tests: - New regression in `tests/unit/api/pm-discovery.test.ts`: `accepts currentUser capability (closes Zod-enum / type-union drift)` pins the root-cause invariant. - Existing 13 pm-discovery tests continue to pass. - Full suite: 8187/8187 (+1 vs pre-fix). Verified: `npm test`, `npm run lint`, `npm run typecheck`, `npm run build`, `cd web && npm run build` — all green. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The dev deploy + CI
Build frontendstep have been failing since PR #1148 (spec 011 merge). Root cause:cd web && npm run buildrunstsc -bwhich is stricter than the rootnpm run typecheckthat my local verification uses. Three classes of errors surfaced on the deploy logs:1.
readonly /** jsdoc */ fieldNamepattern (TS7008)steps/webhook-url-display.tsx+steps/container-pick.tsxhad the JSDoc comment betweenreadonlyand the field name. Strictertscparses this asreadonly: any+ barefieldName: stringwithout the readonly modifier. Pre-existing from spec 010/3. Downstream callers couldn't satisfy the broken interface (TS2345 cascade). Fixed by moving JSDoc abovereadonly.2.
currentUserZod-enum / type-union driftpm-wizard-hooks.tsverify-button callspm.discovery.discover({capability: 'currentUser', …}). The backend type union (DiscoveryCapabilityinsrc/pm/types.ts) included'currentUser'from spec 010/2 but the Zod enum at the tRPC input schema was never updated — so every wizard Verify-button call fails at runtime Zod validation. Fixed by promoting the enum tosrc/pm/types.tsasDISCOVERY_CAPABILITIES(const array) and deriving both the type union AND the tRPC Zod enum from it. The two can no longer drift structurally.3. JIRA custom-field shape mismatch
jira/wizard.tsmappedjiraProjectDetails.fields(shape{id, name, custom}) directly toproviderCustomFields(shape{id, name, type}). Introduced by me in plan 011/3. Fixed by mappingcustom: boolean→type: 'custom' | 'standard'.Why wasn't this caught locally
npm run typecheck(root) uses the roottsconfig.json— looser.cd web && npm run buildusesweb/tsconfig.json— stricter, runstsc -b.Build frontendsteps run the web tsc. My local verification didn't.Going forward I'll add
cd web && npm run buildto my verification checklist, and/or we could make the root pre-commit/pre-push hook also run it.Test plan
tests/unit/api/pm-discovery.test.ts:accepts currentUser capability (closes Zod-enum / type-union drift)— pins the root-cause invariant.npm run lint— clean.npm run typecheck(root) — green.npm run build(root) — green.cd web && npm run build(the production step that was failing) — green for the first time since feat(pm): integration hardening follow-ups + wizard shared-component migration (specs 010 + 011/1-2) #1148.🤖 Generated with Claude Code