-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add workflow to check for expected @wordpress/components CHANGELOG updates #49443
Conversation
Flaky tests detected in 4c8bea2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4620681022
|
3b9dd59
to
514cb9a
Compare
- name: Checkout code | ||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | ||
- name: Fetch origin/trunk | ||
run: git fetch --quiet origin trunk |
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.
Not sure if I'm reading this correctly, but it looks like the search for changes to the CHANGELOG file is done against the latest trunk
(ie. from the origin
remote). I wonder what happens if the CHANGELOG file is changed on trunk
?
In my mental model, we should check for differences against the commit that the current PR is based off (something similar to what described in this article), and not against latest origin / trunk
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.
Good point, and thanks for the example, it helped a lot.
I've reworked the PR so it should now check against the PR's base commit. While changing this, I also realized I didn't like that we were fetching all of origin/trunk
when we really only need to go back as far as the base commit, so I've made the fetch depth dynamic to only pull what the given PR needs.
28e2390
to
d338282
Compare
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.
Tested in #49619, works as per testing instructions 🚀
use workflow `paths` filter instead of scripted logic fix test folder exclusion add git fetch origin uncomment the logic because im a dummy fetch origin/trunk only suppress git fetch output update naming and step structure
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
d338282
to
4c8bea2
Compare
I see it is because I'm making changes to some files within the |
What?
Adds an automated check to PRs editing the @wordpress/components package to ensure the CHANGELOG has been updated.
Why?
This is an easy step to miss, and a common part of reviews, so it makes sense to automate it.
How?
The new check will only be run on PRs that change files in the
packages/components/**
directory, but not if all of those files are stories or unit tests, as those changes don't need to be entered in the changelog.If any files outside of tests and stories are modified, a
git diff
is run to confirm that/packages/components/CHANGELOG.md
is included in the files changed by the PR. If it isn't, the check fails with an error message asking the author to add an entry.Testing Instructions
Verify @wordpress/components CHANGELOG update
was NOT run.Verify @wordpress/components CHANGELOG update
still was NOT run.Verify @wordpress/components CHANGELOG update
IS run.details
on the check, you should see output asking you to add a CHANGELOG entry.Verify @wordpress/components CHANGELOG update
runs and passes.