Skip to content

ci: Fix Summary Report to be able to retrieve PR number#8121

Merged
yurishkuro merged 1 commit into
jaegertracing:mainfrom
yurishkuro:fix-codecov-gate-2
Mar 1, 2026
Merged

ci: Fix Summary Report to be able to retrieve PR number#8121
yurishkuro merged 1 commit into
jaegertracing:mainfrom
yurishkuro:fix-codecov-gate-2

Conversation

@yurishkuro
Copy link
Copy Markdown
Member

@yurishkuro yurishkuro commented Mar 1, 2026

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_dispatch input accepted a parent_run_id which suffered from the same API limitation for fork PRs.

Changes

workflow_run path — PR metadata is now read directly from the workflow_run event 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_dispatch path — Input changed from parent_run_id to pr_number. The workflow now:

  1. Fetches the PR's head SHA via the Pulls API
  2. Finds the latest successful CI Orchestrator run for that SHA
  3. Uses that run ID to download artifacts

This avoids the .pull_requests[] limitation and is more user-friendly — a PR number is easier to find than a run ID.

head_sha fallback — Uses github.event.workflow_run.pull_requests[0].head.sha || github.event.workflow_run.head_sha to handle merge queue / main-push runs where no PR is associated.

Test plan

  • Fork PR triggers workflow_run → PR number and head SHA resolved from event payload, PR comment posted
  • Same-repo PR triggers workflow_run → same behavior
  • Main push triggers workflow_run → no PR found, PR comment skipped, coverage baseline saved
  • Manual workflow_dispatch with a PR number → CI Orchestrator run found, artifacts downloaded, checks posted
  • Manual workflow_dispatch with a PR that has no successful CI run → error message

AI Usage in this PR (choose one)

See AI Usage Policy.

  • None
  • Light
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy

@yurishkuro yurishkuro added the changelog:ci Change related to continuous integration / testing label Mar 1, 2026
Copilot AI review requested due to automatic review settings March 1, 2026 22:30
@yurishkuro yurishkuro requested a review from a team as a code owner March 1, 2026 22:30
@yurishkuro yurishkuro force-pushed the fix-codecov-gate-2 branch from f5b6f2e to bb554a4 Compare March 1, 2026 22:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml ignore 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 api and gh run download against the Actions API, but the job-level permissions: block does not grant actions: read. With explicit permissions, the token will not be able to list/download artifacts or query workflow runs, and the summary job will fail. Add actions: read to 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 source workflow_run conclusion is success. That means on a failing CI Orchestrator run you will not create the Coverage Gate / Metrics Comparison check-runs at all, which conflicts with the stated requirement that Coverage Gate is always posted so it can be used as a required status check. Consider letting the job run on all completed conclusions (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.

@yurishkuro yurishkuro changed the title Fix codecov gate 2 ci: Fix Summary Report to be able to retrieve PR number Mar 1, 2026
@yurishkuro yurishkuro merged commit 7aab2ff into jaegertracing:main Mar 1, 2026
62 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.67%. Comparing base (e74b4cd) to head (bb554a4).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
badger_v1 9.06% <ø> (ø)
badger_v2 1.04% <ø> (ø)
cassandra-4.x-v1-manual 13.26% <ø> (ø)
cassandra-4.x-v2-auto 1.03% <ø> (ø)
cassandra-4.x-v2-manual 1.03% <ø> (ø)
cassandra-5.x-v1-manual 13.26% <ø> (ø)
cassandra-5.x-v2-auto 1.03% <ø> (ø)
cassandra-5.x-v2-manual 1.03% <ø> (ø)
clickhouse 1.16% <ø> (ø)
elasticsearch-6.x-v1 16.62% <ø> (ø)
elasticsearch-7.x-v1 16.65% <ø> (ø)
elasticsearch-8.x-v1 16.80% <ø> (ø)
elasticsearch-8.x-v2 1.04% <ø> (ø)
elasticsearch-9.x-v2 1.04% <ø> (ø)
grpc_v1 7.80% <ø> (ø)
grpc_v2 1.04% <ø> (ø)
kafka-3.x-v2 1.04% <ø> (ø)
memory_v2 1.04% <ø> (ø)
opensearch-1.x-v1 16.70% <ø> (ø)
opensearch-2.x-v1 16.70% <ø> (ø)
opensearch-2.x-v2 1.04% <ø> (ø)
opensearch-3.x-v2 1.04% <ø> (ø)
query 1.04% <ø> (ø)
tailsampling-processor 0.52% <ø> (ø)
unittests 94.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:ci Change related to continuous integration / testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants