-
Notifications
You must be signed in to change notification settings - Fork 146
ci: periodically run update-generated #1386
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
Conversation
This introduces a GitHub workflow to periodically run `cargo xtask update-generated` in order to keep the docs up-to-date with the latest changes. It will create a PR if changes are detected. Signed-off-by: Micah Abbott <[email protected]>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
I put this together with some help from Gemini. I don't know if auto-generated PRs are desired in this repo, so feel free to close it if not. |
cgwalters
left a comment
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!
| run: cargo xtask update-generated | ||
| shell: bash | ||
|
|
||
| - name: 'Create Pull Request' |
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.
I think this is missing a step like https://github.com/coreos/fedora-coreos-config/blob/ba564a93c463f9bd051cf3333822138f38bf0a69/.github/workflows/bump-fedora-bootc.yaml#L36 to do a diff right?
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.
Based on my read of how the action behaves, it will silently exit if there are no changes detected - https://github.com/peter-evans/create-pull-request?tab=readme-ov-file#action-behaviour
How the action behaves:
- If there are changes (i.e. a diff exists with the checked-out base branch), the changes will be pushed to a new branch and a pull request created.
- If there are no changes (i.e. no diff exists with the checked-out base branch), no pull request will be created and the action exits silently.
When I tested this in my fork, it correctly created a PR that looked like #1385
Hmm...I should apply those changes to my main branch and see if the action just no-ops. Will report back here with results!
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.
Ohh hmm, then maybe some of these FCOS actions have been unnecessarily doing a diff? Either way thanks so much for testing this out!
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.
Looks like my understanding was correct; after applying the generated changes to my main branch, the next time I ran the action there was no PR generated.
https://github.com/miabbott/bootc/actions/runs/15917569924/job/44897979972
Ohh hmm, then maybe some of these FCOS actions have been unnecessarily doing a diff?
In the example you linked, I think you could simplify the "Check if there are new commits" step to just do a git submodule update. If there was a new submodule commit, the PR action would generate the PR otherwise it would no-op.
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '15 3 * * *' |
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.
Another option would be to have this fire on every push to main
on:
push:
branches:
- main
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.
That said, we could also just do this as a check on PRs and require the submitter to do it...
But yeah since you already wrote it this way I'm fine to run with it for now.
This introduces a GitHub workflow to periodically run
cargo xtask update-generatedin order to keep the docs up-to-date with the latest changes. It will create a PR if changes are detected.Signed-off-by: Micah Abbott [email protected]