ci: Fix Summary Report to be able to retrieve PR number#8121
Conversation
Signed-off-by: Yuri Shkuro <[email protected]>
f5b6f2e to
bb554a4
Compare
There was a problem hiding this comment.
Pull request overview
Updates the CI fan-in (“CI Summary Report”) to make coverage gating and metrics comparison more reliable and actionable, aligning coverage filtering with .codecov.yml and improving detection of missing metrics diff artifacts.
Changes:
- Add coverage profile filtering based on
.codecov.ymlignore rules to keep gating consistent with Codecov. - Improve metrics fan-in robustness by detecting missing diff artifacts and skipping empty diff stubs while emitting consolidated outputs for check-runs.
- Simplify/modernize artifact download + PR metadata resolution in the summary workflow and remove the PR-number artifact job.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci-summary-report.yml |
Adds workflow_dispatch support, resolves source run via gh, downloads artifacts, filters merged coverage, and creates consolidated check-runs. |
scripts/e2e/metrics_summary.sh |
Adds 1:1 snapshot↔diff artifact validation, skips empty diff stubs, and emits CONCLUSION/SUMMARY outputs. |
scripts/e2e/filter_coverage.py |
New helper to filter Go coverprofiles using .codecov.yml ignore patterns. |
.github/actions/verify-metrics-snapshot/action.yaml |
Always uploads a diff artifact on PRs (creates an empty stub first). |
.github/workflows/label-check.yml |
Replaces API/jq-based label check with event-payload-based label check logic. |
.github/workflows/ci-e2e-all.yml |
Removes PR number artifact upload job (no longer needed). |
docs/adr/004-migrating-coverage-gating-to-github-actions.md |
Updates ADR to reflect the implemented workflow design and key files. |
Comments suppressed due to low confidence (2)
.github/workflows/ci-summary-report.yml:27
- The workflow uses
gh apiandgh run downloadagainst the Actions API, but the job-levelpermissions:block does not grantactions: read. With explicit permissions, the token will not be able to list/download artifacts or query workflow runs, and the summary job will fail. Addactions: readto the workflow permissions (or switch back to a mechanism that doesn't require Actions scope).
permissions:
contents: read
pull-requests: write
checks: write
.github/workflows/ci-summary-report.yml:33
- The job-level
if:only runs the summary workflow when the sourceworkflow_runconclusion issuccess. That means on a failing CI Orchestrator run you will not create theCoverage Gate/Metrics Comparisoncheck-runs at all, which conflicts with the stated requirement thatCoverage Gateis always posted so it can be used as a required status check. Consider letting the job run on allcompletedconclusions (and set conclusions/summary based on available artifacts), or at least still create the check-runs with an appropriate failure/neutral result when the source run failed.
if: |
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8121 +/- ##
=======================================
Coverage 95.67% 95.67%
=======================================
Files 317 317
Lines 16734 16734
=======================================
Hits 16010 16010
Misses 571 571
Partials 153 153
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Problem
The ci-summary-report.yml workflow resolves PR metadata by querying the GitHub REST API (
GET /actions/runs/{id}). However, the API returns empty.pull_requests[]for cross-repo fork PRs, causing the workflow to log "No associated PR found" and skip posting the PR comment — even though the PR clearly exists (observed on PR #8120).Additionally, the
workflow_dispatchinput accepted aparent_run_idwhich suffered from the same API limitation for fork PRs.Changes
workflow_runpath — PR metadata is now read directly from theworkflow_runevent payload (github.event.workflow_run.pull_requests), which is populated even for fork PRs. This eliminates the API call for metadata resolution entirely on this path.workflow_dispatchpath — Input changed fromparent_run_idtopr_number. The workflow now:This avoids the
.pull_requests[]limitation and is more user-friendly — a PR number is easier to find than a run ID.head_shafallback — Usesgithub.event.workflow_run.pull_requests[0].head.sha || github.event.workflow_run.head_shato handle merge queue / main-push runs where no PR is associated.Test plan
workflow_run→ PR number and head SHA resolved from event payload, PR comment postedworkflow_run→ same behaviorworkflow_run→ no PR found, PR comment skipped, coverage baseline savedworkflow_dispatchwith a PR number → CI Orchestrator run found, artifacts downloaded, checks postedworkflow_dispatchwith a PR that has no successful CI run → error messageAI Usage in this PR (choose one)
See AI Usage Policy.