Skip to content

fix(ci): match Python coverage reports to their workflow run - #14651

Merged
Vincent Biret (baywet) merged 2 commits into
mainfrom
fix/coverage-report-run-selection
Oct 23, 2026
Merged

Vincent Biret (baywet) merged 2 commits into
mainfrom
fix/coverage-report-run-selection

Conversation

@baywet

@baywet Vincent Biret (baywet) commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Motivation and Context

Keep Python coverage comments associated with the pull request and revision that produced the report.

Description

Resolve the pull request from workflow-run metadata, with a paginated commit-association lookup when necessary. Confirm the open pull request still matches the run's commit, branch, and repositories before downloading and commenting. Skip reporting with an explicit warning when a unique matching pull request cannot be established.

Use a named coverage artifact containing only the reports and download it to a dedicated directory.

Validation:

  • node --test .github\tests\*.js: passed, 19 existing automation tests.
  • docker run --rm --mount 'type=bind,source=D:\github\semantic-kernel-coverage-report-run-selection,target=/repo,readonly' --workdir /repo rhysd/actionlint:latest -color .github/workflows/python-test-coverage.yml .github/workflows/python-test-coverage-report.yml .github/workflows/github-automation-tests.yml: passed.
  • git diff --check: passed.

The Python unit suite was not run because no Python implementation changed. End-to-end coverage reporting requires GitHub Actions.

Contribution Checklist

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8b0f8941-4558-474e-9eae-005cb5ee0e47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8b0f8941-4558-474e-9eae-005cb5ee0e47

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.

🟢 Approval recommended

The producer and consumer changes align, and no unresolved correctness or security issues were identified.

No open issues 🎉

What changed in this PR

This PR ties Python coverage comments to the pull request and revision that produced the report, replacing artifact-based PR identification with workflow-run metadata.

Changes:

  • Resolve the PR from run metadata or a paginated commit lookup, then validate its state, commit, branch, and repositories before reporting.
  • Share a named, reports-only artifact between the coverage workflows and download it into a dedicated directory.
  • Disable persisted checkout credentials in the reporting workflow.
File Description
.github/​workflows/​python-test-coverage.yml Uploads a named coverage artifact and removes PR-number file handling.
.github/​workflows/​python-test-coverage-report.yml Validates the matching PR and gates artifact download and commenting on successful resolution.

Review effort: Balanced

@baywet
Vincent Biret (baywet) added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 6f1ae42 Oct 23, 2026
21 of 23 checks passed
@baywet
Vincent Biret (baywet) deleted the fix/coverage-report-run-selection branch October 23, 2026 18:10

This branch had an error being deployed

1 failed deployment
github-app-auth — e2b1926e Deployed Oct 23, 2026 by baywet via review #668
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants