-
Notifications
You must be signed in to change notification settings - Fork 16
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: pre-commit check for generated files #199
Conversation
5bc7b1b
to
a5d8b0d
Compare
Co-authored-by: Will Vedder <willvedd@gmail.com>
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.
Great job 👍
✨ nice!
I wonder if maybe the github action we have today can reuse the same logic introduced in the precommit script? |
I deleted my comment b/c realized we're not modifying the github action in this PR. In a follow up PR, can you fix that? https://github.com/openfga/api/blob/main/.github/workflows/review.yaml#L33-L36 We don't need to limit to docs and protos, any change anywhere should error. (not a big issue b/c at the moment, we're not likely to modify those files, but if that changes or e.g. someone updates go.mod manually and keeps go.sum not updated) |
Description
When updating a proto file last week, I forgot to update the docs. We have a github action check for this scenario but it's annoying to have to wait for such a simple fix.
This PR adds a
nonblocking pre-commit hook to remind the author if the docs or generated files need updating.It does the following:
.proto
file is being committed/docs
and/proto/openfga/
folder are also being committed/docs
and/proto/openfga/
are being committed, hook exits successfullyremind the author to update the docs but also exit successfully (non-blocking)block the commit and remind the author to update the generated files.hook.message.mov