chore: sync workflow templates#659
Conversation
Automated sync from stranske/Workflows Template hash: 20d0e241bca2 Changes synced from sync-manifest.yml
There was a problem hiding this comment.
Pull request overview
Syncs workflow-consumer automation scripts from the central Workflows templates, expanding weekly metrics artifact collection and refining PR workflow-source classification (including explicit “no automation” opt-outs) to make automation behavior more reliable and intentional.
Changes:
- Adds priority-workflow artifact collection to improve availability of key weekly metrics artifacts under repo-scan caps.
- Extends workflow source context parsing (labels/body markers/template checkboxes) to track and honor a
noAutomationopt-out signal. - Hardens metrics/coverage helper scripts (typing improvements, safer file stat handling, more structured artifact selection contract fields).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/aggregate_agent_metrics.py | Tightens typing for counters and normalizes missing_priority_families in the artifact selection contract. |
| .github/scripts/weekly_metrics_artifacts.js | Adds priority workflow run scanning to supplement repo-level artifact scans and introduces new selection config knobs. |
| .github/scripts/source_context.js | Adds noAutomation detection and improves PR template checkbox parsing for workflow source context. |
| .github/scripts/coverage_monitor_summary.js | Makes report path validation resilient to stat errors. |
| .github/scripts/agents_pr_meta_update_body.js | Adjusts issue-vs-non-issue body-sync gating and resolves “missing issue” warning comments more robustly. |
| .github/scripts/agents_pr_meta_keepalive.js | Skips keepalive dispatch when PR workflow source context opts out of automation. |
| const priorityArtifacts = await collectPriorityWorkflowArtifacts({ | ||
| github, | ||
| owner, | ||
| repo, | ||
| withRetry, |
There was a problem hiding this comment.
collectRepoArtifacts() now always calls collectPriorityWorkflowArtifacts(), which can add a large number of extra API calls (listWorkflowRuns + listWorkflowRunArtifacts per source) even when the repo-level artifact scan already contains all priority families within the lookback window. Consider short-circuiting this call when the initial artifacts set already satisfies PRIORITY_METRICS_FAMILIES (or only querying the missing families) to reduce rate-limit pressure and runtime.
| const explicitIssueNumbers = extractExplicitIssueSyncNumbers(pr); | ||
| if (issueNumber && explicitIssueNumbers.has(Number(issueNumber))) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
resolveNonIssueWorkflowSourceContextForBodySync() treats an explicit non-issue workflow-source marker as authoritative unless the PR title/body also contains an explicit “Closes/Related/Refs #” reference. This creates an inconsistency with extractIssueNumberFromPull() (used just above), which can resolve the linked issue via <!-- meta:issue:... --> or branch naming; in that case body sync will be skipped even though the PR is issue-backed. Consider treating the meta marker (and/or the already-resolved issueNumber) as an explicit issue reference for this check, or extending extractExplicitIssueSyncNumbers() to recognize <!-- meta:issue:N --> so issue-backed PRs don’t get misclassified as non-issue syncs.
| const explicitIssueNumbers = extractExplicitIssueSyncNumbers(pr); | |
| if (issueNumber && explicitIssueNumbers.has(Number(issueNumber))) { | |
| return null; | |
| } | |
| const normalizedIssueNumber = Number(issueNumber); | |
| if (Number.isFinite(normalizedIssueNumber) && normalizedIssueNumber > 0) { | |
| return null; | |
| } | |
| const explicitIssueNumbers = extractExplicitIssueSyncNumbers(pr); | |
| if (explicitIssueNumbers.size > 0) { | |
| return null; | |
| } |
| } | ||
|
|
||
| async function collectPriorityWorkflowArtifacts({ | ||
| github, |
There was a problem hiding this comment.
collectPriorityWorkflowArtifacts() destructures a github parameter but never uses it (all API calls go through withRetry). Dropping the unused parameter (and corresponding call-site argument) will avoid confusion about which client is actually used.
| github, |
|
Closing as stale: newer sync workflow templates PR #672 is open for this repo. |
Sync Summary
Files Updated
Files Skipped
Review Checklist
Source: stranske/Workflows
Source SHA:
8a344d64eb1ca1e2318692e5f4c17c45415c7dccTemplate hash:
20d0e241bca2Sync branch:
sync/workflows-20d0e241bca2Consumer repo:
stranske/Collab-AdminManifest:
.github/sync-manifest.yml