Skip to content

Commit 510c033

Browse files
committed
ci: route PRs to workstream trackers and stop per-PR tracker comments
#1 had 329 comments and 215 linked PRs because every data PR closed #1 and got a tracker comment. Route by kind instead: releases and dumps -> #1, new records -> #295, fixes -> #296, ci/app -> #297, site -> #19, and keep a tracker the author already linked. The automatic tracker comment now only fires for release PRs. The data summary counts all 12 categories. Refs #297
1 parent 7ce54ef commit 510c033

2 files changed

Lines changed: 29 additions & 8 deletions

File tree

‎.github/pull_request_template.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What & why
44

5-
<!-- What does this change and why? Use "Closes #123" for GitHub Development linking. Auto-close is disabled for the long-running tracking issues. -->
5+
<!-- What does this change and why? Link the workstream tracker with "Closes #N": #295 new records, #296 data accuracy, #297 engine/bot/CI, #19 site, #1 releases and dumps. pr-metadata adds it automatically if missing. Auto-close is disabled for tracking issues. -->
66

77
## Source
88

‎.github/workflows/pr-metadata.yml‎

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,28 @@ jobs:
130130
}
131131
core.exportVariable('TRIAGE_PRIORITY', priority);
132132
133-
const trackingIssuesByLabel = new Map([
134-
['data', 1],
135-
['site', 19],
136-
]);
133+
// Workstream trackers (2026-09-27): #1 roadmap/releases, #295 new
134+
// records, #296 data accuracy, #297 engine/bot/automation, #19 site.
135+
const TRACKERS = { roadmap: 1, collection: 295, accuracy: 296, automation: 297, site: 19 };
136+
const onlyDump = files.length > 0 && files.every((file) =>
137+
file.filename.startsWith('site/public/v1/') || file.filename === 'site/public/openapi.json');
137138
const trackingIssues = [];
138-
for (const [label, issueNumber] of trackingIssuesByLabel) {
139-
if (labels.has(label)) trackingIssues.push(issueNumber);
139+
if (pr.base.ref === 'main' || title.startsWith('chore(dump') || onlyDump) {
140+
trackingIssues.push(TRACKERS.roadmap);
141+
} else {
142+
if (labels.has('data')) {
143+
trackingIssues.push(labels.has('bug') || title.startsWith('fix')
144+
? TRACKERS.accuracy : TRACKERS.collection);
145+
}
146+
if (labels.has('site')) trackingIssues.push(TRACKERS.site);
147+
if (!trackingIssues.length && (labels.has('ci') || labels.has('app'))) {
148+
trackingIssues.push(TRACKERS.automation);
149+
}
140150
}
151+
// Respect a tracker the author already linked by hand.
152+
const anyTracker = new RegExp(
153+
`\\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\\s+#(?:${Object.values(TRACKERS).join('|')})\\b`, 'i');
154+
if (anyTracker.test(pr.body || '')) trackingIssues.length = 0;
141155
if (trackingIssues.length) {
142156
let body = pr.body || '';
143157
let updatedBody = body;
@@ -171,6 +185,10 @@ jobs:
171185
['pda', { added: 0, modified: 0, deleted: 0 }],
172186
['gpu', { added: 0, modified: 0, deleted: 0 }],
173187
['cpu', { added: 0, modified: 0, deleted: 0 }],
188+
['laptop', { added: 0, modified: 0, deleted: 0 }],
189+
['monitor', { added: 0, modified: 0, deleted: 0 }],
190+
['software', { added: 0, modified: 0, deleted: 0 }],
191+
['website', { added: 0, modified: 0, deleted: 0 }],
174192
]);
175193
for (const file of files) {
176194
const top = file.filename.split('/')[0] || '(root)';
@@ -229,7 +247,10 @@ jobs:
229247
'- The tracker issue remains open even when the PR uses `Closes #...` for GitHub Development linking.',
230248
].join('\n');
231249
232-
for (const issueNumber of trackingIssues) {
250+
// One tracker comment per release, not per PR (2026-09-27): regular PRs
251+
// show up through the Closes link in the tracker's Development panel.
252+
const commentTargets = pr.base.ref === 'main' ? trackingIssues : [];
253+
for (const issueNumber of commentTargets) {
233254
const comments = await github.paginate(github.rest.issues.listComments, {
234255
owner,
235256
repo,

0 commit comments

Comments
 (0)