fix(linear): unblock wizard Save + UX polish for Linear PM setup#1113
Merged
zbigniewsobiecki merged 10 commits intodevfrom Apr 15, 2026
Merged
fix(linear): unblock wizard Save + UX polish for Linear PM setup#1113zbigniewsobiecki merged 10 commits intodevfrom
zbigniewsobiecki merged 10 commits intodevfrom
Conversation
Spec 002 (linear-webhook-setup-ux) introduces the Linear wizard UX improvements and save-path fix. Plan 1 locked for execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds src/api/errorLogging.ts with formatters that surface pg driver fields (code, detail, constraint, table) onto server-side logs for both Hono app.onError and the tRPC errorFormatter. Client responses for INTERNAL_SERVER_ERROR now carry a generic message; real details remain in cascade-dashboard-* stdout for operators to grep. plan 002/1 task 1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… constraint The chk_integration_category_provider check constraint (from 0047_add_alerting_integration.sql) only permitted trello/jira for pm-category integrations. Linear support was introduced without a matching constraint update, so every projects.integrations.upsert for category=pm + provider=linear failed with SQLSTATE 23514 and surfaced as HTTP 500 from the dashboard Linear wizard. Migration 0049 drops and re-creates the constraint with linear added to the pm branch. Forward-only, no data migration required. Reproduced with two new integration tests against the test DB. plan 002/1 tasks 2-3 (diagnose + fix). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Integration tests that spy on console.{log,error,warn} around
writeProjectCredential, upsertProjectIntegration (happy + FK-violation
paths), and the formatTRPCErrorLog formatter. Asserts the sentinel
credential value never appears in captured output, while confirming
the real PG error (SQLSTATE + constraint name) IS present on the
failure path — proving diagnosability without leakage.
plan 002/1 task 4.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Save All 11 per-plan ACs pass. Spec ACs #5-8 delivered: - Linear upsert succeeds on fresh projects and re-configuration - DB error diagnostics (SQLSTATE, constraint, detail) surface in server logs - tRPC clients receive generic 'Internal server error' for unexpected throws - Plaintext credentials never leak into captured stdout/stderr Caveat: CLAUDE.md addition deferred to avoid conflicting with the user's in-progress rewrite of that file. Doc impact met via CHANGELOG. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Plan 2 originally assumed @testing-library/react in web/; project has no such infrastructure and the web/ package has no test script. Plan edited in place to: - use react-dom/server.renderToStaticMarkup (available; no new deps) - test under the existing root unit-core project - drop interactive-mutation tests (would need jsdom); ProjectSecretField internals are out-of-scope per spec non-goal Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…igning secret Plan 002/2 (wizard-webhooks-step). Linear PM wizard Webhooks step now: - lists the three event families CASCADE consumes (Issues, Comments, Issue Labels), each with a one-line rationale tracing to src/triggers/linear/ - renders a ProjectSecretField bound to LINEAR_WEBHOOK_SECRET directly beneath the webhook URL, matching the Sentry alerting tab pattern - drops the 'store as LINEAR_WEBHOOK_SECRET in project credentials' trailing bullet (replaced by the inline input) PMWizard threads projectId + the masked LINEAR_WEBHOOK_SECRET credential meta from projects.credentials.list through WebhookStep, so the field reflects its own stored value on mount and stays in sync with the Credentials tab. Tests: 17 new SSR tests using react-dom/server — no React testing library required. Interactive mutation firing is out of scope (would need jsdom); ProjectSecretField itself is untested today under the same constraint and is spec non-goal to modify. vitest.config.ts gains @/components, @/lib, @/hooks aliases pointing at web/src/ for test-time resolution. src/integrations/README.md Linear section defers to the dashboard wizard as the authoritative setup source. Plan 2 closes out spec 002. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Compacts the project's CLAUDE.md from ~820 to ~163 lines by dropping dated setup minutiae, duplicated process docs, and legacy sections. Keeps the load-bearing context: architecture, PR checkout gotcha, testing commands, Zod policy, migrations, GitHub dual-persona rules, trigger system, engines, environment, and git hooks. No code changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Fixes spec 002-linear-webhook-setup-ux end-to-end. Two plans landed:
plan 002/1— save-path-fix. Linear PM wizard Save was returning HTTP 500 on dev. Diagnosed as a23514check-constraint violation onchk_integration_category_provider(predates Linear support — Linear was never added to the allowedpmproviders when feat(wizard): add Linear as PM provider option in dashboard wizard #1107 shipped). Fixed with migration0049_allow_linear_pm_provider.sql. Also hardened the dashboard error path so future failures of this shape are immediately diagnosable from server logs (src/api/errorLogging.ts: formatters for Honoapp.onError+ tRPCerrorFormatterthat surface PGcode,detail,constraint,tablewhen present).plan 002/2— wizard-webhooks-step. The Webhooks step of the Linear wizard now matches reality: the "Enable events" list recommends exactly the three event families CASCADE consumes (Issues, Comments, Issue Labels) with a one-line rationale each, and the previously missing signing-secret input is rendered inline via the existingProjectSecretFieldcomponent — no detour to the Credentials tab.PMWizardthreads the maskedLINEAR_WEBHOOK_SECRETcredential fromprojects.credentials.listthroughWebhookStep, so the field reflects existing values on mount and stays in sync with the Credentials tab.Also includes an unrelated CLAUDE.md rewrite (streamlined from ~820 to ~163 lines) that the author had in-flight; kept as its own commit.
User-visible
Tests
tests/unit/web/linear-webhook-info-panel.test.ts,pm-wizard-webhooks-step.test.ts) — render components viareact-dom/server.renderToStaticMarkupand assert against the HTML string. No new test infrastructure added (web/ has no@testing-library/react, and it would be out-of-scope for a UX-polish plan). Interactive mutation firing is intentionally out of scope;ProjectSecretField's internals are untested today under the same constraint and spec non-goal forbids modifying it.tests/unit/api/error-logging.test.ts).upsertProjectIntegrationwith Linear provider.tests/integration/api/no-secret-leakage.test.ts) proving plaintext credentials never leak on credential-save, success, or failure paths.Totals: 7585 unit + 522 integration — all green. Lint + typecheck (root + web) clean.
Migration note
0049_allow_linear_pm_provider.sqlmust run on dev before the Save step works for Linear. Drops and re-creates thechk_integration_category_providerCHECK withlinearadded to thepmbranch; forward-only, no data migration.Test plan
npm test— 7585 passingTEST_DATABASE_URL=... npm run test:integration— 522 passingnpm run lint— cleannpm run typecheck(root) — cleancd web && npx tsc -b— clean🤖 Generated with Claude Code