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
workflows: auto create PRs for license data updates #8021
Conversation
I think we should instead change |
Hi Jon, I think that's a good idea. Tagged releases should be more reliable than changes made to the HEAD. The change to |
.github/workflows/spdx.yml
Outdated
|
||
on: | ||
schedule: | ||
- cron: '*/60 * * * *' |
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.
Maybe run it less frequently? Like once per 8 hours?
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.
With #8023 this could conceivably be as infrequent as once a day?
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.
A couple of suggestions but otherwise ok. Nice work!
Needs a |
Yes, it is. |
Let's try it. Good job @Bo98 ! |
@@ -16,8 +16,8 @@ def update_license_data_args | |||
|
|||
Update SPDX license data in the Homebrew repository. | |||
EOS | |||
switch "--fail-if-changed", | |||
description: "Return a failing status code if current license data's version is different from " \ | |||
switch "--fail-if-not-changed", |
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.
This makes it the opposite of brew man
which seems undesirable. Can you explain why they are better being inconsistent?
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.
Because, for the purposes of the workflow, I want to make sure I am only detecting when there is a change.
If I make it fail on change then I still can't be certain it has changed as it could have failed for other reasons like the download failing, GitHub API having issues, etc.
Making it a success exit code instead means I can be sure that it has downloaded successfully and it really has detected a change.
The use case of the exit code is different here than brew man
. The idea is not to fail the workflow here but rather to check the exit code and push a branch if a change is detected. Accurracy of detection is important if you want to prevent the workflow pushing new branches to the repo without any changes.
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.
Ok, makes sense, thanks 👍 . Given that: it might make sense to make brew man
(maybe even eventually brew style --fix
?) behave the same and similarly be able to auto-open PRs?
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.
Possibly. The only thing is brew man
CI failures are likely caused by the PR in question (and should be fixed in the same PR), unlike outdated spdx.json data, so any new workflow would perhaps not replace the existing CI step like we did here.
There is some argument however that we should have something that sends brew man
PRs for commits to Homebrew/bundle, Homebrew/services and Homebrew/test-bot.
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.
All true. Probably worth punting on for now, I guess. Thanks!
brew style
with your changes locally?brew tests
with your changes locally?Like Dependabot, but for data/spdx.json.
Currently set up to run every 12 hours, with the commit author being BrewTestBot.