8000 FEAT: Forked PR coverage comment workflow by gargsaumya · Pull Request #375 · microsoft/mssql-python · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@gargsaumya
Copy link
Contributor
@gargsaumya gargsaumya commented Dec 16, 2025

Work Item / Issue Reference

AB#40910

GitHub Issue: #<ISSUE_NUMBER>


Summary

Testing the workflow_run solution for posting coverage comments on forked PRs.

Copilot AI review requested due to automatic review settings December 16, 2025 09:40
@gargsaumya gargsaumya changed the title Test: Forked PR coverage comment workflow FEAT: Forked PR coverage comment workflow Dec 16, 2025
Copy link
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 implements a workflow_run solution to enable posting code coverage comments on pull requests from forked repositories, which normally face token permission restrictions. The implementation splits the coverage reporting into two workflows: one that runs on pull_request events and collects coverage data, and another that runs on workflow_run completion events with elevated permissions to post comments.

Key Changes:

  • Added artifact-based data passing between the coverage workflow and a new comment-posting workflow
  • Created a new workflow triggered by workflow_run events to handle comment posting with proper permissions
  • Added test print statements to main.py to validate the PR workflow

Reviewed changes

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

File Description
.github/workflows/pr-code-coverage.yml Added steps to save coverage data as JSON artifact and conditionally skip PR comments for forked repos
.github/workflows/post-coverage-comment.yml New workflow that downloads coverage artifacts from completed workflow runs and posts PR comments with proper permissions
main.py Added test print statements to validate the workflow (test changes only)

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

Copy link
Collaborator
@bewithgaurav bewithgaurav left a comment

Choose a reason for hiding this comment

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

I have added comments related to logic optimizations, restructuring and code comments. requesting changes on this, please reach out if you need any clarification 👍

Copy link
Collaborator
@bewithgaurav bewithgaurav left a comment

Choose a reason for hiding this comment

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

the forked checks will be done as soon as thi gets merged to main, please test this on forked PRs by pulling latest main - approving the changes

@gargsaumya gargsaumya merged commit c666f6c into microsoft:main Dec 24, 2025
21 checks passed
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.

4 participants

0