Skip to content

chore: sync workflow templates - #640

Closed
stranske wants to merge 1 commit into
mainfrom
sync/workflows-3e5a27aaceee
Closed

stranske wants to merge 1 commit into
mainfrom
sync/workflows-3e5a27aaceee

Conversation

@stranske

Copy link
Copy Markdown
Owner

Sync Summary

Files Updated

  • aggregate_agent_metrics.py: Aggregates downloaded weekly agent metrics - required by agents-weekly-metrics.yml
  • source_context.js: Classifies PR workflow source context for issue, local, automation, sync, Dependabot, review follow-up, and direct GitHub work
  • coverage_monitor_summary.js: Machine-readable weekly coverage monitor checkpoint
  • weekly_metrics_artifacts.js: Bounded weekly metrics artifact selection contract
  • agents_pr_meta_keepalive.js: PR metadata handling for keepalive
  • agents_pr_meta_update_body.js: Updates PR body with agent metadata

Files Skipped

  • pr-00-gate.yml: File exists and sync_mode is create_only
  • ci.yml: File exists and sync_mode is create_only
  • dependabot.yml: File exists and sync_mode is create_only
  • llm_slots.json: None

Review Checklist

  • CI passes with updated workflows
  • No repo-specific customizations were overwritten

Source: stranske/Workflows
Source SHA: 559c76326138b8e3fc9720d212747bbe2556ea3f
Template hash: 3e5a27aaceee
Sync branch: sync/workflows-3e5a27aaceee
Consumer repo: stranske/Template
Manifest: .github/sync-manifest.yml

Automated sync from stranske/Workflows
Template hash: 3e5a27aaceee

Changes synced from sync-manifest.yml
Copilot AI review requested due to automatic review settings April 27, 2026 03:15
@stranske stranske added sync Automated sync from Workflows automated Automated sync from Workflows labels Apr 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Syncs workflow-template helper scripts from stranske/Workflows into this consumer repo, focusing on weekly metrics artifact selection and PR workflow source-context handling to better support automation/sync workflows.

Changes:

  • Hardened metrics/coverage contracts: safer handling of missing_priority_families and more defensive filesystem checks.
  • Expanded weekly metrics artifact collection to include “priority producer” workflow runs (bounded by a new per-source run cap).
  • Improved PR workflow source-context parsing, including a distinct “no automation” signal that disables keepalive/body automation flows.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/aggregate_agent_metrics.py Sanitizes missing_priority_families in the artifact selection contract to avoid unintended list coercions.
.github/scripts/weekly_metrics_artifacts.js Adds priority-workflow artifact collection, new config option priority_workflow_runs_per_source, and deduping helpers.
.github/scripts/source_context.js Adds “no automation” detection via labels/markers/template parsing and propagates noAutomation in resolved context.
.github/scripts/coverage_monitor_summary.js Wraps fs.statSync in a try/catch to avoid failing on transient filesystem errors.
.github/scripts/agents_pr_meta_update_body.js Adjusts non-issue source-context gating for body sync and resolves/updates workflow-source repair comments.
.github/scripts/agents_pr_meta_keepalive.js Skips keepalive dispatch when source-context opts out of automation (noAutomation).

Comment on lines +568 to +575
const priorityArtifacts = await collectPriorityWorkflowArtifacts({
github,
owner,
repo,
withRetry,
options,
});
return dedupeArtifacts([...artifacts, ...priorityArtifacts]);

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collectRepoArtifacts always calls collectPriorityWorkflowArtifacts, even when the repo-level artifact scan already contains all priority families. This adds a potentially large number of extra GitHub API calls (listWorkflowRuns + listWorkflowRunArtifacts) on every run and can slow the workflow / increase rate-limit pressure. Consider short-circuiting: first check whether the repo-level artifacts already satisfy the needed priority families within the cutoff, and only then call the priority workflow scan (or only scan for the families that are still missing).

Copilot uses AI. Check for mistakes.
Comment on lines +1461 to +1478
try {
const comments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number: pr.number,
});
await resolveSourceContextRepairComment({
github,
owner,
repo,
prNumber: pr.number,
comments,
sourceContext,
core,
});
} catch (error) {
core.warning(`Failed to resolve workflow source repair comment: ${error.message}`);
}

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When issueNumber is present, the workflow comments are fetched twice: once here to resolve the workflow-source repair comment, and later again via fetchIssueComments(...) for connector checkbox parsing. This duplicates API calls and increases runtime/rate-limit risk. Consider reusing the later issueComments result for both purposes (e.g., move repair-comment resolution to after fetchIssueComments, or pass the already-fetched comments through).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Automated sync from Workflows sync Automated sync from Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants