-
Notifications
You must be signed in to change notification settings - Fork 359
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
build: INFENG-885: add lock-api-state.sh pre-commit check #10030
Conversation
✅ Deploy Preview for determined-ui canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10030 +/- ##
==========================================
- Coverage 54.60% 54.60% -0.01%
==========================================
Files 1260 1260
Lines 157635 157635
Branches 3632 3632
==========================================
- Hits 86082 86073 -9
- Misses 71419 71428 +9
Partials 134 134
Flags with carried forward coverage won't be shown. Click here to find out more. |
there are no buf image changes to commit. This was formerly run by rph at the beginning of a release.
we only want to run it once for any proto/** files. * Set files regex back to '^proto/', so we only run this hook when protobuf definitions change.
(probably) necessary to install buf properly.
dccd621
to
4c2add1
Compare
tools/scripts. Similar versions of these now exist under pre-commit, but these specific versions were used by rph, and are no longer necessary, because we should be running them as PR checks via pre-commit, and not at the last minute during a release.
pre-commit script a bit. Clean up lock-published-urls pre-commit script to invoke the new make target.
Docsite preview being generated for this PR. |
Docsite preview being generated for this PR. |
1 similar comment
Docsite preview being generated for this PR. |
Docsite preview being generated for this PR. |
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.
LGTM from infra side. only one NIT would be if the go version is centralized in the config file, since we have go running in actions and in circle ci just in case the version stay in sync
Closing this because I have fundamentally misunderstood a few things about these specific scripts and how they relate to the release process. A big thanks to @stoksc for explaining how they fit in. Stay tuned for possible additional, more-correct changes. |
Ticket
INFENG-885
Description
Add
lock-api-state.sh
andlock-published-urls.sh
pre-commit hooks to ensure protobuf and auto-generated docs changes get committed, instead of making an additional commit on release branches.Currently, these scripts were run as part of
rph
during the release. But because they make modifications and then do commits, we should be doing this as part of the PR process instead of during the release.lock-api-state.sh
regenerates the buf image if there are any protobuf changes, andpre-commit
will fail if this is the case.lock-published-urls.sh
adds new.rst
documents todocs/.redirects/all_published_urls_ever.json
.pre-commit
will also fail if this happens.I've also added a new make target for docs:
lock-published-urls
.Note: this means that, going forward, if you make any changes to protobuf definitions, you will need to run
make -C proto gen-buf-image
(from the repo root) to regenerate the buf image as part of your pull request. If you add any docs files, you will also need to runmake -C docs lock-published-urls
from the repository root to generate the appropriate file and commit it.I apologize for the messy commit history on this. I know we squash anyway, but I still try not to clutter up the PR history if I can help it. I did a lot of GitHub Action testing.
Test Plan
First, ensure you have pre-commit installed and configured.
Using whichever virtual environment or Python installation you use for Determined, install pre-commit if you haven't already (building Determined at any point should install it). Then, run
pre-commit install
from the Determined repository. This will install the pre-commit hooks, which should be done anyway so things are properly checked.lock-api-state
proto/
and make an edit. Adding a comment should suffice.buf.image.bin
file is generated.git restore
both that change and your protobuf definition file change to clean up.pre-commit run lock-api-state --all-files
should return the same failed result.lock-published-urls
.rst
file somewhere underdocs/
. It doesn't need to have anything in it.docs/.redirects/all_published_urls_ever.json
.pre-commit run lock-published-urls --all-files
. It should fail.Checklist
docs/release-notes/
See Release Note for details.