-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
ci: Fix reference commit for code size comparison. #16122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Fix reference commit for code size comparison. #16122
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #16122 +/- ##
=======================================
Coverage 98.57% 98.57%
=======================================
Files 164 164
Lines 21345 21345
=======================================
Hits 21040 21040
Misses 305 305 ☔ View full report in Codecov by Sentry. |
Code size report:
|
@@ -1,7 +1,6 @@ | |||
name: Check code size | |||
|
|||
on: | |||
push: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this removed, will the code-size report still update when the PR is updated with addition commits, or force pushed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes: "By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened" (ref), and synchronize
is the event when someone updates the branch.
Pull request workflows don't run if there is a merge conflict, so we won't get a code size report until the conflict is resolved (but that's also the case with the current config, it runs the job but doesn't issue a report.)
EDIT: Fixed the description of status quo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, great, thanks for checking.
15be04b
to
ba8ab19
Compare
Previously the code size comparison was between the merge base (i.e. where the PR branched), and the generated merge commit into master. If the PR branch was older than current master, this meant the size comparison could incorrectly include changes already merged on master but missing from the PR branch. This commit changes it to compare the generated merge commit against current master, i.e. the size impact if this PR was to be merged. This commit also disables running the code size check on "push", it now only runs on pull_request events. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
ba8ab19
to
787c424
Compare
Summary
Follow-up to #16114 after looking into the details of which commits GitHub checks out in PR actions.
Currently the code size comparison is between the merge base (i.e. where the PR branched), and the generated merge commit into master. If the PR branch is older than current master, this means the size comparison could incorrectly include changes already merged on master but missing from the PR branch.
This PR changes it to compare the generated merge commit against current master, i.e. the size impact if this PR was to be merged.
This commit also disables running the code size check on "push", it now only runs on pull_request events.
This work was funded through GitHub Sponsors.
Testing
Similar to #16114, I set this branch as the default branch on my fork and opened some PRs:
Trade-offs and Alternatives