Repository navigation
feat: add daily workflow runtime auditor and optimizer - #11058
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
| @@ -0,0 +1,195 @@ | |||
| --- | |||
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues can let the optimizer bypass safe-output restrictions with write-capable tokens, expose telemetry credentials to sandboxes, and break report deduplication and lookups.
3 open issues
What changed in this PR
Adds a daily runtime audit and an evidence-driven optimizer to help maintainers reduce GitHub Actions execution time across workflow types and engines.
Changes:
- Samples up to 500 completed runs over seven days and reports the ten slowest workflows by successful elapsed runtime.
- Uses the triggering audit report to propose at most one untracked optimization issue, without implementing changes or assigning agents.
- Adds usage documentation, compiled workflow configuration, and focused regression coverage.
| File | Description |
|---|---|
scripts/ci/workflow-runtime-workflows.test.ts |
Tests measurement, sampling, deduplication, report handoff, and postprocessing. |
.github/workflows/workflow-runtime-optimizer.md |
Defines target selection, evidence requirements, and recommendation issue creation. |
.github/workflows/workflow-runtime-auditor.md |
Defines daily collection, runtime ranking, and audit reporting. |
.github/workflows/workflow-runtime-auditor.lock.yml |
Compiles the auditor into executable GitHub Actions jobs. |
Review effort: Balanced (auto)
| OTEL_SERVICE_NAME: gh-aw.workflow-runtime-auditor | ||
| OTEL_RESOURCE_ATTRIBUTES: 'gh-aw.workflow.name=Daily%20Workflow%20Runtime%20Auditor,gh-aw.repository=${{ github.repository }},gh-aw.run.id=${{ github.run_id }},github.run_id=${{ github.run_id }},gh-aw.engine.id=copilot' | ||
| OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.GH_AW_DEFAULT_OTLP_HEADERS }} | ||
| GH_AW_OTLP_ENDPOINTS: '[{"url":"${{ secrets.GH_AW_DEFAULT_OTLP_ENDPOINT || vars.GH_AW_DEFAULT_OTLP_ENDPOINT }}","headers":"${{ secrets.GH_AW_DEFAULT_OTLP_HEADERS }}"}]' |
| github: | ||
| mode: gh-proxy | ||
| toolsets: [actions, issues, pull_requests, repos] |
| Even an empty window gets a short report stating that no measurable successful | ||
| runs were found; missing measurements are unknown, not zero. | ||
|
|
||
| Include these exact markers, substituting values from the JSON: |
|
@copilot address all review feedback |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
Addressed the review feedback in commit |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
…racter sanitization' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| const first = Math.min(...executed.map(job => Date.parse(job.started_at))); | ||
| const last = Math.max(...executed.map(job => Date.parse(job.completed_at))); | ||
| measured.push({ | ||
| workflow_id: run.workflow_id, workflow_path: safeWorkflowPath, name: sanitizeText(run.name, 200), |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Summary
Add a daily runtime auditor and an evidence-driven optimizer covering all GitHub Actions workflow types and engines.
main, or by manual dispatch, and uses the exact triggering audit's report. It skips workflows already tracked by open recommendations and creates at most one implementation-ready issue, preserving independent older recommendations.gh-proxyand creates issues through safe outputs. It never implements changes or assigns agents.Validation
npx --no-install jest --runInBand scripts/ci/workflow-runtime-workflows.test.ts— 12 tests passed, including repository postprocessing idempotence for both locks.git diff --checkpassed.main.Scope
Exactly five new files: two workflow sources, their two generated locks, and
scripts/ci/workflow-runtime-workflows.test.ts. No unrelated commits or dirty source-checkout changes are included.