-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: self update if there have been changes to the grammar but it was not built locally #103
Conversation
Here's a PR testing this: #104 (support issue created for CLA bot approval thing: https://github.com/hashicorp/releng-support/issues/248) |
94e408f
to
860a2a3
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.
Thanks for setting this up! I have two questions
…s not built locally This PR adds a new workflow to run on pull requests only while adjusting the existing test workflow to only run on commits on main from now on. The following will happen on PRs now: * `npm run build` will be run as part of a new build job * `copywrite headers` will be run as part of the build job as well * If there are any changes (e.g. to file headers) or to the generated syntax json files the diff will be committed as a new commit and the workflow is aborted * If there are no changes (e.g. when running on the self-update commit after it has been made) the test job will run and decide the fate of whether the workflow fails or succeeds This pattern is something we used over in CDKTF repositories a lot. It stems from the projen.io configuration management tool. This change allows us to forget to run build and still get correct test results. Currently, if you forget to run build locally, the tests might still pass as they run against the now stale generated json grammar files.
This will be handled in a separate workflow, refer to #105 for more
860a2a3
to
121c618
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.
Thanks!
This PR adds a new workflow to run on pull requests only while adjusting the existing test workflow to only run on commits on main from now on.
The following will happen on PRs now:
npm run build
will be run as part of a new build jobcopywrite headers
will be run as part of the build job as wellThis pattern is something we used over in CDKTF repositories a lot. It stems from the projen.io configuration management tool.
This change allows us to forget to run build and still get correct test results. Currently, if you forget to run build locally, the tests might still pass as they run against the now stale generated json grammar files.
Todos
token
on the checkout action in the job that does the patch commit. Without this Github actions won't re-run on the self-update commit.