Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const JiraConfigSchema = z.object({

const LinearConfigSchema = z.object({
teamId: z.string().min(1),
/** Optional Linear Project (initiative) ID — when set, narrows scope within the team. */
projectId: z.string().optional(),
statuses: z.record(z.string()), // CASCADE status names → Linear state IDs
labels: z
.object({
Expand Down
41 changes: 41 additions & 0 deletions tests/unit/config/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,47 @@ describe.concurrent('validateConfig', () => {
expect(result.projects[0].engineSettings?.['claude-code']?.thinking).toBe('adaptive');
});

it('preserves linear.projectId through validation', () => {
const result = validateConfig({
projects: [
{
id: 'test',
orgId: 'default',
name: 'Test',
repo: 'owner/repo',
linear: {
teamId: 'team-uuid',
projectId: 'project-uuid',
statuses: { backlog: 'state-bl' },
},
},
],
});

expect(result.projects[0].linear?.projectId).toBe('project-uuid');
expect(result.projects[0].linear?.teamId).toBe('team-uuid');
});

it('treats linear.projectId as optional', () => {
const result = validateConfig({
projects: [
{
id: 'test',
orgId: 'default',
name: 'Test',
repo: 'owner/repo',
linear: {
teamId: 'team-uuid',
statuses: {},
},
},
],
});

expect(result.projects[0].linear?.projectId).toBeUndefined();
expect(result.projects[0].linear?.teamId).toBe('team-uuid');
});

it('rejects unsupported project engineSettings entries', () => {
const config = {
projects: [
Expand Down
Loading