Skip to content

ci: Fix PR resolution in CI Summary Report publish workflow#8159

Merged
yurishkuro merged 2 commits into
jaegertracing:mainfrom
yurishkuro:pass-pr-number
Mar 11, 2026
Merged

ci: Fix PR resolution in CI Summary Report publish workflow#8159
yurishkuro merged 2 commits into
jaegertracing:mainfrom
yurishkuro:pass-pr-number

Conversation

@yurishkuro
Copy link
Copy Markdown
Member

@yurishkuro yurishkuro commented Mar 11, 2026

Fixes a bug where ci-summary-report-publish.yml posted a comment to a completely wrong PR (#1) when the CI Orchestrator was triggered by a push to main. This happened because workflow_run.pull_requests[] can contain spurious matches for push events — GitHub populates it with any open PR whose head SHA matches the pushed commit.

Root Cause

The publish workflow resolved PR_NUMBER from github.event.workflow_run.pull_requests[0].number. For push events, this array is unreliable and returned PR #1, a completely unrelated PR. See the failing run.

Changes

ci-summary-report.yml: Store pr_number (from github.event.pull_request.number) in ci-summary.json. This is accurate because the workflow runs inside the CI Orchestrator, where the event payload is trustworthy. For push/merge_group events the value is null.

ci-summary-report-publish.yml: Simplified PR resolution:

  • workflow_run: Read pr_number from the downloaded ci-summary.json artifact instead of the unreliable event payload. Removed all pull_requests[] access and gh pr list fallback.
  • workflow_dispatch: Now requires both run_id and pr_number as inputs, eliminating API lookups to find the CI Orchestrator run.

The "Resolve source run" step went from ~45 lines of convoluted shell with multiple API calls to ~20 straightforward lines.

AI Usage in this PR (choose one)

See AI Usage Policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@yurishkuro yurishkuro requested a review from a team as a code owner March 11, 2026 00:25
Copilot AI review requested due to automatic review settings March 11, 2026 00:25
@yurishkuro yurishkuro changed the title Pass PR number explicitly between workflows ci: Fix PR resolution in CI Summary Report publish workflow Mar 11, 2026
@yurishkuro yurishkuro added the changelog:ci Change related to continuous integration / testing label Mar 11, 2026
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

This PR improves CI summary publishing by persisting the PR number into the ci-summary artifact and updating the publish workflow to read the PR number from that artifact (rather than relying on workflow_run.pull_requests[], which can be empty for fork PRs). It also changes the manual publish path to accept an explicit CI Orchestrator run_id.

Changes:

  • Write pr_number into .artifacts/ci-summary.json from the CI Orchestrator run.
  • Add workflow_dispatch input run_id and resolve head_sha directly from the run.
  • For workflow_run triggers, read pr_number from the downloaded ci-summary.json.

Reviewed changes

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

File Description
.github/workflows/ci-summary-report.yml Adds PR_NUMBER env and emits pr_number into the structured ci-summary.json artifact.
.github/workflows/ci-summary-report-publish.yml Adds run_id input and changes PR number resolution to come from the ci-summary artifact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread .github/workflows/ci-summary-report-publish.yml
Comment thread .github/workflows/ci-summary-report-publish.yml
Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro merged commit 42b8f74 into jaegertracing:main Mar 11, 2026
67 checks passed
@yurishkuro yurishkuro deleted the pass-pr-number branch March 11, 2026 01:34
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.70%. Comparing base (2c59571) to head (06c1527).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8159      +/-   ##
==========================================
+ Coverage   95.67%   95.70%   +0.02%     
==========================================
  Files         317      317              
  Lines       16746    16746              
==========================================
+ Hits        16022    16026       +4     
+ Misses        571      568       -3     
+ Partials      153      152       -1     
Flag Coverage Δ
badger_v1 9.05% <ø> (ø)
badger_v2 1.04% <ø> (ø)
cassandra-4.x-v1-manual 13.25% <ø> (ø)
cassandra-4.x-v2-auto 1.03% <ø> (ø)
cassandra-4.x-v2-manual 1.03% <ø> (ø)
cassandra-5.x-v1-manual 13.25% <ø> (ø)
cassandra-5.x-v2-auto 1.03% <ø> (ø)
cassandra-5.x-v2-manual 1.03% <ø> (ø)
clickhouse 1.16% <ø> (ø)
elasticsearch-6.x-v1 16.60% <ø> (ø)
elasticsearch-7.x-v1 16.63% <ø> (ø)
elasticsearch-8.x-v1 16.78% <ø> (ø)
elasticsearch-8.x-v2 1.04% <ø> (ø)
elasticsearch-9.x-v2 1.04% <ø> (ø)
grpc_v1 7.79% <ø> (ø)
grpc_v2 1.04% <ø> (ø)
kafka-3.x-v2 1.04% <ø> (ø)
memory_v2 1.04% <ø> (ø)
opensearch-1.x-v1 16.67% <ø> (ø)
opensearch-2.x-v1 16.67% <ø> (ø)
opensearch-2.x-v2 1.04% <ø> (ø)
opensearch-3.x-v2 1.04% <ø> (ø)
query 1.04% <ø> (ø)
tailsampling-processor 0.52% <ø> (ø)
unittests 94.38% <ø> (+0.02%) ⬆️

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