@urateam/core 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/bec-183-pre-stream-stall.test.d.ts +2 -0
- package/dist/__tests__/bec-183-pre-stream-stall.test.d.ts.map +1 -0
- package/dist/__tests__/bec-183-pre-stream-stall.test.js +139 -0
- package/dist/__tests__/bec-183-pre-stream-stall.test.js.map +1 -0
- package/dist/__tests__/extract-handoff.test.js +74 -0
- package/dist/__tests__/extract-handoff.test.js.map +1 -1
- package/dist/__tests__/gh-linear-sync.test.d.ts +2 -0
- package/dist/__tests__/gh-linear-sync.test.d.ts.map +1 -0
- package/dist/__tests__/gh-linear-sync.test.js +325 -0
- package/dist/__tests__/gh-linear-sync.test.js.map +1 -0
- package/dist/__tests__/pm-slack-interface.test.js +40 -1
- package/dist/__tests__/pm-slack-interface.test.js.map +1 -1
- package/dist/__tests__/post-fanout-comments.test.js +52 -0
- package/dist/__tests__/post-fanout-comments.test.js.map +1 -1
- package/dist/__tests__/select-repo-config.test.d.ts +2 -0
- package/dist/__tests__/select-repo-config.test.d.ts.map +1 -0
- package/dist/__tests__/select-repo-config.test.js +132 -0
- package/dist/__tests__/select-repo-config.test.js.map +1 -0
- package/dist/__tests__/start-todo.test.js +124 -0
- package/dist/__tests__/start-todo.test.js.map +1 -1
- package/dist/__tests__/validate-review-models.test.d.ts +2 -0
- package/dist/__tests__/validate-review-models.test.d.ts.map +1 -0
- package/dist/__tests__/validate-review-models.test.js +155 -0
- package/dist/__tests__/validate-review-models.test.js.map +1 -0
- package/dist/executor/agent-stream.d.ts +29 -4
- package/dist/executor/agent-stream.d.ts.map +1 -1
- package/dist/executor/agent-stream.js +65 -17
- package/dist/executor/agent-stream.js.map +1 -1
- package/dist/executor/executor.d.ts.map +1 -1
- package/dist/executor/executor.js +71 -15
- package/dist/executor/executor.js.map +1 -1
- package/dist/executor/index.d.ts +1 -1
- package/dist/executor/index.d.ts.map +1 -1
- package/dist/executor/index.js +1 -1
- package/dist/executor/index.js.map +1 -1
- package/dist/executor/prompt/templates.d.ts.map +1 -1
- package/dist/executor/prompt/templates.js +7 -7
- package/dist/executor/prompt/templates.js.map +1 -1
- package/dist/executor/review/post-fanout-comments.d.ts +7 -0
- package/dist/executor/review/post-fanout-comments.d.ts.map +1 -1
- package/dist/executor/review/post-fanout-comments.js +17 -3
- package/dist/executor/review/post-fanout-comments.js.map +1 -1
- package/dist/executor/review/review-provider.d.ts +15 -0
- package/dist/executor/review/review-provider.d.ts.map +1 -1
- package/dist/executor/review/review-provider.js +78 -1
- package/dist/executor/review/review-provider.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/runner.js +1 -1
- package/dist/pipeline/runner.js.map +1 -1
- package/dist/pm/actions/select-repo-config.d.ts +22 -0
- package/dist/pm/actions/select-repo-config.d.ts.map +1 -0
- package/dist/pm/actions/select-repo-config.js +38 -0
- package/dist/pm/actions/select-repo-config.js.map +1 -0
- package/dist/pm/actions/start-todo.d.ts.map +1 -1
- package/dist/pm/actions/start-todo.js +13 -8
- package/dist/pm/actions/start-todo.js.map +1 -1
- package/dist/pm/linear-helpers.d.ts +14 -0
- package/dist/pm/linear-helpers.d.ts.map +1 -1
- package/dist/pm/linear-helpers.js +23 -0
- package/dist/pm/linear-helpers.js.map +1 -1
- package/dist/pm/scheduler.d.ts.map +1 -1
- package/dist/pm/scheduler.js +16 -20
- package/dist/pm/scheduler.js.map +1 -1
- package/dist/pm/slack-interface.d.ts +12 -0
- package/dist/pm/slack-interface.d.ts.map +1 -1
- package/dist/pm/slack-interface.js +16 -10
- package/dist/pm/slack-interface.js.map +1 -1
- package/dist/security/review-checklist.d.ts +8 -2
- package/dist/security/review-checklist.d.ts.map +1 -1
- package/dist/security/review-checklist.js +39 -9
- package/dist/security/review-checklist.js.map +1 -1
- package/dist/sync/gh-linear-sync.d.ts +189 -0
- package/dist/sync/gh-linear-sync.d.ts.map +1 -0
- package/dist/sync/gh-linear-sync.js +279 -0
- package/dist/sync/gh-linear-sync.js.map +1 -0
- package/dist/sync/index.d.ts +2 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +3 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -1
- package/dist/webhook/handler.d.ts.map +1 -1
- package/dist/webhook/handler.js +4 -2
- package/dist/webhook/handler.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,19 +28,49 @@ export const SECURITY_REVIEW_CHECKLIST = `## Security Review Checklist
|
|
|
28
28
|
- [ ] Sub-dependencies do not introduce supply-chain risk
|
|
29
29
|
`;
|
|
30
30
|
/**
|
|
31
|
-
* Instructions for the review agent on how to format
|
|
31
|
+
* Instructions for the review agent on how to format its final output as a
|
|
32
|
+
* HandoffArtifact JSON envelope with reviewFindings nested inside context.
|
|
33
|
+
*
|
|
34
|
+
* This shape is required so that parseHandoffArtifact() in the executor fast-path
|
|
35
|
+
* can parse the structured output — preventing the JSON-soup slow-path placeholder
|
|
36
|
+
* ("Stage review completed — agent output was not parseable prose") from appearing
|
|
37
|
+
* in PR descriptions when the review stage runs without errors (BEC-167).
|
|
32
38
|
*/
|
|
33
|
-
export const REVIEW_OUTPUT_FORMAT = `
|
|
39
|
+
export const REVIEW_OUTPUT_FORMAT = `Emit your final output as a single \`\`\`json code block containing a HandoffArtifact JSON envelope. The JSON block MUST match this shape exactly:
|
|
34
40
|
|
|
41
|
+
\`\`\`json
|
|
35
42
|
{
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
43
|
+
"stage": "review",
|
|
44
|
+
"summary": "<1–2 sentence prose summary of what was reviewed and the overall verdict>",
|
|
45
|
+
"filesChanged": ["path/to/reviewed/file.ts"],
|
|
46
|
+
"approach": "<short prose: what the implementation does and how>",
|
|
47
|
+
"context": {
|
|
48
|
+
"issueIntent": "<what the issue was trying to achieve>",
|
|
49
|
+
"constraints": [],
|
|
50
|
+
"assumptions": [],
|
|
51
|
+
"reviewFindings": [
|
|
52
|
+
{
|
|
53
|
+
"severity": "blocking",
|
|
54
|
+
"file": "path/to/file.ts",
|
|
55
|
+
"line": 42,
|
|
56
|
+
"category": "SQL Injection",
|
|
57
|
+
"description": "Clear explanation of the issue",
|
|
58
|
+
"fix": "Suggested remediation"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"tokenBudget": {
|
|
63
|
+
"contextTokensUsed": 0,
|
|
64
|
+
"recommendedMaxTurns": 10
|
|
65
|
+
}
|
|
42
66
|
}
|
|
67
|
+
\`\`\`
|
|
43
68
|
|
|
44
|
-
|
|
69
|
+
Rules:
|
|
70
|
+
- \`severity\` must be one of: \`"blocking"\`, \`"warning"\`, \`"suggestion"\`
|
|
71
|
+
- \`category\` can be any of: \`"SQL Injection"\`, \`"XSS"\`, \`"Command Injection"\`, \`"Path Traversal"\`, \`"Auth"\`, \`"Data Exposure"\`, \`"Dependency"\`, \`"incomplete-implementation"\`, \`"dead-code"\`, \`"missing-documentation"\`, \`"Other"\`
|
|
72
|
+
- If there are NO findings, emit an empty array: \`"reviewFindings": []\`
|
|
73
|
+
- ALL fields (\`summary\`, \`filesChanged\`, \`approach\`, \`context\`, \`tokenBudget\`) are REQUIRED — even when there are no findings
|
|
74
|
+
- \`summary\` must be prose (NOT JSON). Write 1–2 sentences describing what was reviewed and the verdict.
|
|
45
75
|
`;
|
|
46
76
|
//# sourceMappingURL=review-checklist.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-checklist.js","sourceRoot":"","sources":["../../src/security/review-checklist.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBxC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"review-checklist.js","sourceRoot":"","sources":["../../src/security/review-checklist.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBxC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCnC,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/** Default workflow state name to use when creating new Linear tickets. */
|
|
2
|
+
export declare const DEFAULT_TRIAGE_STATE_NAME = "Triage";
|
|
3
|
+
/**
|
|
4
|
+
* Extract a human-readable error message from an unknown thrown value.
|
|
5
|
+
* Avoids duplicating `err instanceof Error ? err.message : String(err)` across files.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getErrorMessage(err: unknown): string;
|
|
8
|
+
/** Idempotency marker written into the Linear issue body. */
|
|
9
|
+
export declare function makeIdempotencyMarker(ghIssueNumber: number): string;
|
|
10
|
+
/**
|
|
11
|
+
* Minimal GitHub issue shape returned by the REST API.
|
|
12
|
+
* Pull-requests share the same endpoint and must be filtered out by callers.
|
|
13
|
+
*/
|
|
14
|
+
export interface GitHubIssue {
|
|
15
|
+
number: number;
|
|
16
|
+
title: string;
|
|
17
|
+
body: string | null;
|
|
18
|
+
html_url: string;
|
|
19
|
+
labels: Array<{
|
|
20
|
+
name?: string;
|
|
21
|
+
}>;
|
|
22
|
+
state: string;
|
|
23
|
+
}
|
|
24
|
+
/** Minimal Linear issue shape needed for sync decisions. */
|
|
25
|
+
export interface LinearSyncIssue {
|
|
26
|
+
id: string;
|
|
27
|
+
identifier: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
state: {
|
|
31
|
+
name: string;
|
|
32
|
+
type?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Minimal Linear workflow state shape. */
|
|
36
|
+
export interface LinearSyncState {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
type?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Mockable GitHub REST client interface.
|
|
43
|
+
* The real implementation wraps `@octokit/rest` (created by `createGitHubSyncClientFromToken`).
|
|
44
|
+
*/
|
|
45
|
+
export interface GitHubSyncClient {
|
|
46
|
+
listIssues(options: {
|
|
47
|
+
owner: string;
|
|
48
|
+
repo: string;
|
|
49
|
+
labels?: string;
|
|
50
|
+
state?: "open" | "closed" | "all";
|
|
51
|
+
per_page?: number;
|
|
52
|
+
}): Promise<GitHubIssue[]>;
|
|
53
|
+
closeIssue(options: {
|
|
54
|
+
owner: string;
|
|
55
|
+
repo: string;
|
|
56
|
+
issue_number: number;
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Mockable Linear client interface.
|
|
61
|
+
* The real implementation wraps `@linear/sdk` (created by `createLinearSyncClientFromApiKey`).
|
|
62
|
+
*/
|
|
63
|
+
export interface LinearSyncClient {
|
|
64
|
+
issues(args: {
|
|
65
|
+
filter: object;
|
|
66
|
+
first?: number;
|
|
67
|
+
}): Promise<{
|
|
68
|
+
nodes: LinearSyncIssue[];
|
|
69
|
+
}>;
|
|
70
|
+
workflowStates(args: {
|
|
71
|
+
filter: object;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
nodes: LinearSyncState[];
|
|
74
|
+
}>;
|
|
75
|
+
createIssue(input: {
|
|
76
|
+
teamId: string;
|
|
77
|
+
title: string;
|
|
78
|
+
description: string;
|
|
79
|
+
stateId: string;
|
|
80
|
+
}): Promise<{
|
|
81
|
+
issue?: {
|
|
82
|
+
id: string;
|
|
83
|
+
identifier: string;
|
|
84
|
+
} | null;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
/** Configuration for a single sync run. */
|
|
88
|
+
export interface GhLinearSyncConfig {
|
|
89
|
+
/** GitHub personal access token (or `GITHUB_TOKEN` from GH Actions). */
|
|
90
|
+
githubToken: string;
|
|
91
|
+
/** Repository in `"owner/repo"` format. */
|
|
92
|
+
githubRepo: string;
|
|
93
|
+
/** Linear API key. */
|
|
94
|
+
linearApiKey: string;
|
|
95
|
+
/** Linear team ID to create issues in. */
|
|
96
|
+
linearTeamId: string;
|
|
97
|
+
/**
|
|
98
|
+
* GitHub label names to filter issues by.
|
|
99
|
+
* When empty or omitted, all open issues are processed.
|
|
100
|
+
* Example: `["urateam-quality-observer", "bug", "enhancement"]`
|
|
101
|
+
*/
|
|
102
|
+
labelFilters?: string[];
|
|
103
|
+
/**
|
|
104
|
+
* Name of the Linear workflow state for new tickets.
|
|
105
|
+
* Defaults to `DEFAULT_TRIAGE_STATE_NAME` ("Triage").
|
|
106
|
+
*/
|
|
107
|
+
triageStateName?: string;
|
|
108
|
+
/**
|
|
109
|
+
* When `true`, GitHub issues whose Linear counterpart has moved to a
|
|
110
|
+
* completed state are automatically closed on GitHub.
|
|
111
|
+
* Default: `false`.
|
|
112
|
+
*/
|
|
113
|
+
bidirectionalClose?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* When `true`, log planned actions but skip all writes.
|
|
116
|
+
* Useful for validating the configuration without mutating data.
|
|
117
|
+
* Default: `false`.
|
|
118
|
+
*/
|
|
119
|
+
dryRun?: boolean;
|
|
120
|
+
}
|
|
121
|
+
/** Summary of a completed sync run. */
|
|
122
|
+
export interface SyncResult {
|
|
123
|
+
/** Number of GitHub issues examined. */
|
|
124
|
+
processed: number;
|
|
125
|
+
/** Number of new Linear tickets created. */
|
|
126
|
+
created: number;
|
|
127
|
+
/** Number of GitHub issues already tracked in Linear (skipped). */
|
|
128
|
+
skipped: number;
|
|
129
|
+
/** Number of GitHub issues closed (bidirectional close). */
|
|
130
|
+
closed: number;
|
|
131
|
+
/** Per-issue error messages for issues that could not be synced. */
|
|
132
|
+
errors: string[];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Find an existing Linear ticket for a GitHub issue by the `[GH#NNN]` title
|
|
136
|
+
* prefix convention. Returns `null` if no matching ticket exists.
|
|
137
|
+
*/
|
|
138
|
+
export declare function findLinearTicketForGhIssue(linearClient: LinearSyncClient, ghIssueNumber: number, teamId: string): Promise<LinearSyncIssue | null>;
|
|
139
|
+
/**
|
|
140
|
+
* Create a Linear ticket for a GitHub issue in the specified state.
|
|
141
|
+
*
|
|
142
|
+
* The body includes:
|
|
143
|
+
* - Original GitHub issue body
|
|
144
|
+
* - A permalink back to the GitHub issue
|
|
145
|
+
* - An idempotency marker (`<!-- gh-linear-sync:NNN -->`)
|
|
146
|
+
*/
|
|
147
|
+
export declare function createLinearTicketForGhIssue(linearClient: LinearSyncClient, ghIssue: GitHubIssue, teamId: string, triageStateId: string): Promise<{
|
|
148
|
+
id: string;
|
|
149
|
+
identifier: string;
|
|
150
|
+
}>;
|
|
151
|
+
/**
|
|
152
|
+
* Run the GitHub → Linear sync.
|
|
153
|
+
*
|
|
154
|
+
* For each open GitHub issue that matches the label filters:
|
|
155
|
+
* 1. Checks if a Linear ticket already exists (via `[GH#NNN]` title prefix).
|
|
156
|
+
* 2. If not, creates one in the Triage state.
|
|
157
|
+
* 3. If `bidirectionalClose` is enabled and the Linear ticket is Done,
|
|
158
|
+
* closes the corresponding GitHub issue.
|
|
159
|
+
*
|
|
160
|
+
* The operation is **idempotent**: calling it multiple times for the same
|
|
161
|
+
* GitHub issue will not create duplicate Linear tickets.
|
|
162
|
+
*
|
|
163
|
+
* Linear lookups are parallelised with `Promise.all` to minimise wall-clock
|
|
164
|
+
* time when processing many issues.
|
|
165
|
+
*/
|
|
166
|
+
export declare function runGhLinearSync(config: GhLinearSyncConfig, clients: {
|
|
167
|
+
github: GitHubSyncClient;
|
|
168
|
+
linear: LinearSyncClient;
|
|
169
|
+
}): Promise<SyncResult>;
|
|
170
|
+
/**
|
|
171
|
+
* Create a `GitHubSyncClient` backed by `@octokit/rest`.
|
|
172
|
+
* Pull-requests are automatically excluded from `listIssues` results.
|
|
173
|
+
*/
|
|
174
|
+
export declare function createGitHubSyncClientFromToken(token: string): Promise<GitHubSyncClient>;
|
|
175
|
+
/**
|
|
176
|
+
* Create a `LinearSyncClient` backed by `@linear/sdk`.
|
|
177
|
+
*
|
|
178
|
+
* The Linear SDK uses lazy Promise-like relations for fields such as `state`.
|
|
179
|
+
* The factory casts via `unknown` to bridge the SDK's complex types to our
|
|
180
|
+
* minimal flat interface (which the real data satisfies at runtime).
|
|
181
|
+
*
|
|
182
|
+
* The `as Promise<...>` casts below are safe because:
|
|
183
|
+
* 1. The SDK returns objects that match the interface at runtime — we only
|
|
184
|
+
* request fields present in every Linear issue/state/workflow-state response.
|
|
185
|
+
* 2. Tests use mock clients that satisfy the interface without any SDK coupling,
|
|
186
|
+
* so mismatches surface immediately in CI if the SDK changes shape.
|
|
187
|
+
*/
|
|
188
|
+
export declare function createLinearSyncClientFromApiKey(apiKey: string): Promise<LinearSyncClient>;
|
|
189
|
+
//# sourceMappingURL=gh-linear-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-linear-sync.d.ts","sourceRoot":"","sources":["../../src/sync/gh-linear-sync.ts"],"names":[],"mappings":"AA0BA,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAqBlD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEpD;AAMD,6DAA6D;AAC7D,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC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IAAI,CAAC,CAYjC;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CA0B7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE;IACP,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;CAC1B,GACA,OAAO,CAAC,UAAU,CAAC,CA0IrB;AAMD;;;GAGG;AACH,wBAAsB,+BAA+B,CACnD,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,CA8B3B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAqB3B"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
/**
|
|
3
|
+
* GitHub Issues → Linear sync utility.
|
|
4
|
+
*
|
|
5
|
+
* Syncs open GitHub issues to Linear tickets in a Triage state.
|
|
6
|
+
* Idempotent via `[GH#NNN]` title-prefix convention.
|
|
7
|
+
*
|
|
8
|
+
* Optionally closes GitHub issues when their Linear counterpart reaches a
|
|
9
|
+
* completed state (bidirectional close-out, gated behind `bidirectionalClose`).
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* - Invoke from scripts/gh-linear-sync.ts (GitHub Action entry point).
|
|
13
|
+
* - Inject mock clients in tests for deterministic unit testing.
|
|
14
|
+
*
|
|
15
|
+
* Operator mental model:
|
|
16
|
+
* GitHub = inbound (public filings, quality-observer findings)
|
|
17
|
+
* Linear = triage / work-tracking / autonomous-pipeline routing
|
|
18
|
+
*/
|
|
19
|
+
import { createLogger } from "../logger.js";
|
|
20
|
+
const log = createLogger({ component: "gh-linear-sync" });
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Module-level constants
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
/** Default workflow state name to use when creating new Linear tickets. */
|
|
25
|
+
export const DEFAULT_TRIAGE_STATE_NAME = "Triage";
|
|
26
|
+
/** Maximum number of GitHub issues fetched per page from the REST API. */
|
|
27
|
+
const GITHUB_ISSUES_PER_PAGE = 100;
|
|
28
|
+
/**
|
|
29
|
+
* Linear state `type` values that indicate a ticket is fully complete.
|
|
30
|
+
* The `type` field is an enum on the Linear side and is the preferred check.
|
|
31
|
+
*/
|
|
32
|
+
const COMPLETED_STATE_TYPES = new Set(["completed"]);
|
|
33
|
+
/**
|
|
34
|
+
* Linear state `name` values (lower-cased) that indicate a ticket is Done.
|
|
35
|
+
* Used as a fallback when `type` is absent from the API response.
|
|
36
|
+
*/
|
|
37
|
+
const COMPLETED_STATE_NAMES = new Set(["done"]);
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Shared helpers
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
/**
|
|
42
|
+
* Extract a human-readable error message from an unknown thrown value.
|
|
43
|
+
* Avoids duplicating `err instanceof Error ? err.message : String(err)` across files.
|
|
44
|
+
*/
|
|
45
|
+
export function getErrorMessage(err) {
|
|
46
|
+
return err instanceof Error ? err.message : String(err);
|
|
47
|
+
}
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// Public types
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
/** Idempotency marker written into the Linear issue body. */
|
|
52
|
+
export function makeIdempotencyMarker(ghIssueNumber) {
|
|
53
|
+
return `<!-- gh-linear-sync:${ghIssueNumber} -->`;
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Core sync logic
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
/**
|
|
59
|
+
* Find an existing Linear ticket for a GitHub issue by the `[GH#NNN]` title
|
|
60
|
+
* prefix convention. Returns `null` if no matching ticket exists.
|
|
61
|
+
*/
|
|
62
|
+
export async function findLinearTicketForGhIssue(linearClient, ghIssueNumber, teamId) {
|
|
63
|
+
const titlePrefix = `[GH#${ghIssueNumber}]`;
|
|
64
|
+
const results = await linearClient.issues({
|
|
65
|
+
filter: {
|
|
66
|
+
team: { id: { eq: teamId } },
|
|
67
|
+
title: { startsWith: titlePrefix },
|
|
68
|
+
},
|
|
69
|
+
first: 1,
|
|
70
|
+
});
|
|
71
|
+
return results.nodes[0] ?? null;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a Linear ticket for a GitHub issue in the specified state.
|
|
75
|
+
*
|
|
76
|
+
* The body includes:
|
|
77
|
+
* - Original GitHub issue body
|
|
78
|
+
* - A permalink back to the GitHub issue
|
|
79
|
+
* - An idempotency marker (`<!-- gh-linear-sync:NNN -->`)
|
|
80
|
+
*/
|
|
81
|
+
export async function createLinearTicketForGhIssue(linearClient, ghIssue, teamId, triageStateId) {
|
|
82
|
+
const marker = makeIdempotencyMarker(ghIssue.number);
|
|
83
|
+
const title = `[GH#${ghIssue.number}] ${ghIssue.title}`;
|
|
84
|
+
const description = [
|
|
85
|
+
ghIssue.body ?? "",
|
|
86
|
+
"",
|
|
87
|
+
"---",
|
|
88
|
+
`**Source:** [GitHub Issue #${ghIssue.number}](${ghIssue.html_url})`,
|
|
89
|
+
"",
|
|
90
|
+
marker,
|
|
91
|
+
].join("\n");
|
|
92
|
+
const result = await linearClient.createIssue({
|
|
93
|
+
teamId,
|
|
94
|
+
title,
|
|
95
|
+
description,
|
|
96
|
+
stateId: triageStateId,
|
|
97
|
+
});
|
|
98
|
+
if (!result.issue) {
|
|
99
|
+
throw new Error(`Linear createIssue returned no issue for GH#${ghIssue.number}`);
|
|
100
|
+
}
|
|
101
|
+
return result.issue;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Run the GitHub → Linear sync.
|
|
105
|
+
*
|
|
106
|
+
* For each open GitHub issue that matches the label filters:
|
|
107
|
+
* 1. Checks if a Linear ticket already exists (via `[GH#NNN]` title prefix).
|
|
108
|
+
* 2. If not, creates one in the Triage state.
|
|
109
|
+
* 3. If `bidirectionalClose` is enabled and the Linear ticket is Done,
|
|
110
|
+
* closes the corresponding GitHub issue.
|
|
111
|
+
*
|
|
112
|
+
* The operation is **idempotent**: calling it multiple times for the same
|
|
113
|
+
* GitHub issue will not create duplicate Linear tickets.
|
|
114
|
+
*
|
|
115
|
+
* Linear lookups are parallelised with `Promise.all` to minimise wall-clock
|
|
116
|
+
* time when processing many issues.
|
|
117
|
+
*/
|
|
118
|
+
export async function runGhLinearSync(config, clients) {
|
|
119
|
+
const result = {
|
|
120
|
+
processed: 0,
|
|
121
|
+
created: 0,
|
|
122
|
+
skipped: 0,
|
|
123
|
+
closed: 0,
|
|
124
|
+
errors: [],
|
|
125
|
+
};
|
|
126
|
+
const triageStateName = config.triageStateName ?? DEFAULT_TRIAGE_STATE_NAME;
|
|
127
|
+
// Resolve workflow states once up-front.
|
|
128
|
+
const statesResp = await clients.linear.workflowStates({
|
|
129
|
+
filter: { team: { id: { eq: config.linearTeamId } } },
|
|
130
|
+
});
|
|
131
|
+
const triageState = statesResp.nodes.find((s) => s.name === triageStateName);
|
|
132
|
+
if (!triageState) {
|
|
133
|
+
const available = statesResp.nodes.map((s) => s.name).join(", ");
|
|
134
|
+
throw new Error(`Linear state "${triageStateName}" not found for team ${config.linearTeamId}. ` +
|
|
135
|
+
`Available states: ${available}`);
|
|
136
|
+
}
|
|
137
|
+
// Validate and split the githubRepo string before any API call.
|
|
138
|
+
const parts = config.githubRepo.split("/");
|
|
139
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
140
|
+
throw new Error(`Invalid githubRepo format '${config.githubRepo}'. Expected 'owner/repo'.`);
|
|
141
|
+
}
|
|
142
|
+
const [owner, repo] = parts;
|
|
143
|
+
// Fetch open GitHub issues (filtered by labels when provided).
|
|
144
|
+
const ghIssues = await clients.github.listIssues({
|
|
145
|
+
owner,
|
|
146
|
+
repo,
|
|
147
|
+
labels: config.labelFilters?.join(","),
|
|
148
|
+
state: "open",
|
|
149
|
+
per_page: GITHUB_ISSUES_PER_PAGE,
|
|
150
|
+
});
|
|
151
|
+
log.info({ count: ghIssues.length, repo: config.githubRepo }, "fetched open GitHub issues");
|
|
152
|
+
// Parallelise all Linear "does this ticket exist?" lookups before processing.
|
|
153
|
+
// With N issues this reduces wall-clock time from O(N × RTT) to O(RTT).
|
|
154
|
+
const existingTickets = await Promise.all(ghIssues.map((issue) => findLinearTicketForGhIssue(clients.linear, issue.number, config.linearTeamId).catch((err) => {
|
|
155
|
+
log.warn({ err, ghNumber: issue.number }, "failed to look up Linear ticket for GH issue; will treat as not found");
|
|
156
|
+
return null;
|
|
157
|
+
})));
|
|
158
|
+
for (let i = 0; i < ghIssues.length; i++) {
|
|
159
|
+
const ghIssue = ghIssues[i];
|
|
160
|
+
const existing = existingTickets[i] ?? null;
|
|
161
|
+
result.processed++;
|
|
162
|
+
try {
|
|
163
|
+
if (existing) {
|
|
164
|
+
log.info({ ghNumber: ghIssue.number, linearId: existing.identifier }, "GH issue already synced to Linear — skipping");
|
|
165
|
+
result.skipped++;
|
|
166
|
+
// Bidirectional close: close GH issue if Linear ticket is Done.
|
|
167
|
+
if (config.bidirectionalClose) {
|
|
168
|
+
const isDone = COMPLETED_STATE_TYPES.has(existing.state.type ?? "") ||
|
|
169
|
+
COMPLETED_STATE_NAMES.has(existing.state.name?.toLowerCase() ?? "");
|
|
170
|
+
if (isDone) {
|
|
171
|
+
if (!config.dryRun) {
|
|
172
|
+
await clients.github.closeIssue({
|
|
173
|
+
owner,
|
|
174
|
+
repo,
|
|
175
|
+
issue_number: ghIssue.number,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
log.info({
|
|
179
|
+
ghNumber: ghIssue.number,
|
|
180
|
+
linearId: existing.identifier,
|
|
181
|
+
dryRun: config.dryRun ?? false,
|
|
182
|
+
}, "closed GH issue (Linear ticket is Done)");
|
|
183
|
+
result.closed++;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
// Create a new Linear ticket for this GitHub issue.
|
|
189
|
+
if (!config.dryRun) {
|
|
190
|
+
const created = await createLinearTicketForGhIssue(clients.linear, ghIssue, config.linearTeamId, triageState.id);
|
|
191
|
+
log.info({ ghNumber: ghIssue.number, linearId: created.identifier }, "created Linear ticket for GH issue");
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
log.info({
|
|
195
|
+
ghNumber: ghIssue.number,
|
|
196
|
+
title: ghIssue.title,
|
|
197
|
+
dryRun: true,
|
|
198
|
+
}, "[dry-run] would create Linear ticket");
|
|
199
|
+
}
|
|
200
|
+
result.created++;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
const msg = getErrorMessage(err);
|
|
205
|
+
log.error({ err, ghNumber: ghIssue.number }, "failed to sync GH issue");
|
|
206
|
+
result.errors.push(`GH#${ghIssue.number}: ${msg}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
log.info(result, "gh-linear-sync complete");
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
// Real client factories (used by scripts/gh-linear-sync.ts)
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
/**
|
|
216
|
+
* Create a `GitHubSyncClient` backed by `@octokit/rest`.
|
|
217
|
+
* Pull-requests are automatically excluded from `listIssues` results.
|
|
218
|
+
*/
|
|
219
|
+
export async function createGitHubSyncClientFromToken(token) {
|
|
220
|
+
const { Octokit } = await import("@octokit/rest");
|
|
221
|
+
const octokit = new Octokit({ auth: token });
|
|
222
|
+
return {
|
|
223
|
+
async listIssues({ owner, repo, labels, state, per_page }) {
|
|
224
|
+
const resp = await octokit.rest.issues.listForRepo({
|
|
225
|
+
owner,
|
|
226
|
+
repo,
|
|
227
|
+
labels,
|
|
228
|
+
state: state ?? "open",
|
|
229
|
+
per_page: per_page ?? GITHUB_ISSUES_PER_PAGE,
|
|
230
|
+
});
|
|
231
|
+
// Octokit's `listForRepo` returns both issues and PRs; filter PRs out.
|
|
232
|
+
// Cast via `unknown` to bridge Octokit's detailed item type to our minimal
|
|
233
|
+
// interface — the fields we rely on (`number`, `title`, `body`, `html_url`,
|
|
234
|
+
// `labels`, `state`) are always present on non-PR issue responses.
|
|
235
|
+
return resp.data.filter((i) => !("pull_request" in i && i.pull_request));
|
|
236
|
+
},
|
|
237
|
+
async closeIssue({ owner, repo, issue_number }) {
|
|
238
|
+
await octokit.rest.issues.update({
|
|
239
|
+
owner,
|
|
240
|
+
repo,
|
|
241
|
+
issue_number,
|
|
242
|
+
state: "closed",
|
|
243
|
+
});
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Create a `LinearSyncClient` backed by `@linear/sdk`.
|
|
249
|
+
*
|
|
250
|
+
* The Linear SDK uses lazy Promise-like relations for fields such as `state`.
|
|
251
|
+
* The factory casts via `unknown` to bridge the SDK's complex types to our
|
|
252
|
+
* minimal flat interface (which the real data satisfies at runtime).
|
|
253
|
+
*
|
|
254
|
+
* The `as Promise<...>` casts below are safe because:
|
|
255
|
+
* 1. The SDK returns objects that match the interface at runtime — we only
|
|
256
|
+
* request fields present in every Linear issue/state/workflow-state response.
|
|
257
|
+
* 2. Tests use mock clients that satisfy the interface without any SDK coupling,
|
|
258
|
+
* so mismatches surface immediately in CI if the SDK changes shape.
|
|
259
|
+
*/
|
|
260
|
+
export async function createLinearSyncClientFromApiKey(apiKey) {
|
|
261
|
+
const { LinearClient } = await import("@linear/sdk");
|
|
262
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
263
|
+
const client = new LinearClient({ apiKey });
|
|
264
|
+
return {
|
|
265
|
+
async issues(args) {
|
|
266
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
267
|
+
return client.issues(args);
|
|
268
|
+
},
|
|
269
|
+
async workflowStates(args) {
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
271
|
+
return client.workflowStates(args);
|
|
272
|
+
},
|
|
273
|
+
async createIssue(input) {
|
|
274
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
275
|
+
return client.createIssue(input);
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=gh-linear-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-linear-sync.js","sourceRoot":"","sources":["../../src/sync/gh-linear-sync.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAE1D,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,yBAAyB,GAAG,QAAQ,CAAC;AAElD,0EAA0E;AAC1E,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC;;;GAGG;AACH,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAE1E;;;GAGG;AACH,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAErE,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E;;;GAGG;AACH,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I,CAA0C,CAAC;QACtE,CAAC;QACD,KAAK,CAAC,cAAc,CAAC,IAAI;YACvB,yGAAyG;YACzG,OAAO,MAAM,CAAC,cAAc,CAAC,IAAI,CAA0C,CAAC;QAC9E,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,KAAK;YACrB,yGAAyG;YACzG,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAE7B,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { runGhLinearSync, findLinearTicketForGhIssue, createLinearTicketForGhIssue, makeIdempotencyMarker, getErrorMessage, DEFAULT_TRIAGE_STATE_NAME, createGitHubSyncClientFromToken, createLinearSyncClientFromApiKey, type GhLinearSyncConfig, type SyncResult, type GitHubSyncClient, type LinearSyncClient, type GitHubIssue, type LinearSyncIssue, type LinearSyncState, } from "./gh-linear-sync.js";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,eAAe,EACf,yBAAyB,EACzB,+BAA+B,EAC/B,gCAAgC,EAChC,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
export { runGhLinearSync, findLinearTicketForGhIssue, createLinearTicketForGhIssue, makeIdempotencyMarker, getErrorMessage, DEFAULT_TRIAGE_STATE_NAME, createGitHubSyncClientFromToken, createLinearSyncClientFromApiKey, } from "./gh-linear-sync.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,eAAe,EACf,yBAAyB,EACzB,+BAA+B,EAC/B,gCAAgC,GAQjC,MAAM,qBAAqB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -220,6 +220,7 @@ export declare const RepoConfigSchema: z.ZodObject<{
|
|
|
220
220
|
branch: z.ZodDefault<z.ZodString>;
|
|
221
221
|
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
222
222
|
}, z.core.$strip>>;
|
|
223
|
+
labelPattern: z.ZodOptional<z.ZodString>;
|
|
223
224
|
}, z.core.$strip>;
|
|
224
225
|
export type RepoConfig = z.infer<typeof RepoConfigSchema>;
|
|
225
226
|
export declare const TestResultSchema: z.ZodObject<{
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;EAE1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,SAAS,EAEnC,CAAC;AAGF,eAAO,MAAM,mBAAmB;;;;EAAqD,CAAC;AACtF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,iBAAiB;;;;;;;iBAG5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,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CACrB;AAGD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,oBAAoB;;;;;;;EAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAG1D,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;iBAQ5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;iBAU1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;iBAO1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -180,6 +180,18 @@ export const RepoConfigSchema = z.object({
|
|
|
180
180
|
githubFeedback: GitHubFeedbackConfigSchema.optional(),
|
|
181
181
|
/** BEC-135: Release Manager agent (Pro feature). */
|
|
182
182
|
releaseManager: ReleaseManagerConfigSchema.optional(),
|
|
183
|
+
/**
|
|
184
|
+
* BEC-177: Label-based repo routing. When set, this repo is selected for pipeline runs
|
|
185
|
+
* whose resolved pipeline label matches this pattern (case-insensitive exact match).
|
|
186
|
+
* Takes priority over the teamId/projectId key lookup.
|
|
187
|
+
*
|
|
188
|
+
* Example: set `labelPattern: "observer-fix"` to route all Linear tickets with the
|
|
189
|
+
* "observer-fix" pipeline label to this repo instead of the default repo.
|
|
190
|
+
*
|
|
191
|
+
* Backwards compatible: existing entries without `labelPattern` continue to be
|
|
192
|
+
* resolved by their teamId/projectId key.
|
|
193
|
+
*/
|
|
194
|
+
labelPattern: z.string().optional(),
|
|
183
195
|
});
|
|
184
196
|
// --- Handoff Artifact ---
|
|
185
197
|
export const TestResultSchema = z.object({
|