Skip to content

fix(linear): preserve projectId through config mapper#1138

Merged
zbigniewsobiecki merged 1 commit intodevfrom
fix/linear-projectid-config-mapper
Apr 17, 2026
Merged

fix(linear): preserve projectId through config mapper#1138
zbigniewsobiecki merged 1 commit intodevfrom
fix/linear-projectid-config-mapper

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Add projectId to LinearIntegrationConfig interface, ProjectConfigRaw['linear'] type, and buildLinearConfig() function in src/db/repositories/configMapper.ts
  • The config mapper was silently dropping projectId when loading Linear integration config from the DB, breaking every downstream consumer

Root cause

buildLinearConfig() explicitly copied teamId, statuses, labels, customFields but never projectId. The DB JSON had it, the mapper dropped it.

Impact (all fixed by this 3-line change)

Consumer What broke
secretBuilder.augmentProjectSecrets() CASCADE_LINEAR_PROJECT_ID never set in worker env
LinearPMProvider.createWorkItem() Issues created without project scope
LinearPMProvider.listWorkItems() Listed all team issues instead of project-scoped
LinearPMProvider.addChecklistItem() Sub-issues created without project
LinearRouterAdapter webhook filter Project scope filtering never applied

Test plan

  • New test: preserves Linear projectId through the mapper
  • New test: omits Linear projectId when not configured
  • Full unit suite: 7863 tests pass
  • Typecheck clean, lint clean
  • Deploy, trigger splitting run, verify stories appear in Linear project view

🤖 Generated with Claude Code

The configMapper.ts dropped projectId when mapping Linear integration
config from the DB to ProjectConfig. The JSON in project_integrations
had projectId, but buildLinearConfig() only copied teamId, statuses,
labels, and customFields — never projectId.

This broke every downstream consumer: worker env injection
(CASCADE_LINEAR_PROJECT_ID never set), createWorkItem/listWorkItems/
addChecklistItem (issues created without project scope), and the
router's webhook scope filter (never applied).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zbigniewsobiecki zbigniewsobiecki merged commit 93fddbf into dev Apr 17, 2026
9 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/linear-projectid-config-mapper branch April 17, 2026 18:03
zbigniewsobiecki added a commit that referenced this pull request Apr 18, 2026
…ng it

PR #1138 added projectId to the configMapper, but Zod's
LinearConfigSchema didn't declare projectId — and z.object() defaults
to "strip" mode, silently removing unknown keys during .parse(). So
projectId survived the mapper but got dropped by validateConfig(),
never reaching augmentProjectSecrets() or the LinearPMProvider.

Result: new Linear issues created by splitting / planning agents had
no project assignment despite the configMapper fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zbigniewsobiecki added a commit that referenced this pull request Apr 18, 2026
…ng it (#1142)

PR #1138 added projectId to the configMapper, but Zod's
LinearConfigSchema didn't declare projectId — and z.object() defaults
to "strip" mode, silently removing unknown keys during .parse(). So
projectId survived the mapper but got dropped by validateConfig(),
never reaching augmentProjectSecrets() or the LinearPMProvider.

Result: new Linear issues created by splitting / planning agents had
no project assignment despite the configMapper fix.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant