-
Notifications
You must be signed in to change notification settings - Fork 31
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
AZ-219 Replaced statefull force push check when pull requests are merged #168
AZ-219 Replaced statefull force push check when pull requests are merged #168
Conversation
to main with stateless check when a commit on PR to main is pushed.
Please make sure the following happened
|
What if PR changes only files in github workflows and doesnt req bump in version? As I see it, now it will req the version to be bumped anyway. At least the workflow will be run unnecessarily. |
If PR changes only GitHub workflows, so in particular it does not change any files in |
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.
Nice, much better than forcepushing.
ok, but why waste github actions seconds pool for nothing. You can use this: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-ignoring-paths |
Let me try with those paths, agreed if we can make it work so workflow are not spawned for nothing then it's better. |
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 :)
output, also restricting workflow triggers for only certain path that would save Github resources.
I've applied review remarks and it's better now, apart from cleaner bash we don't waste Guthub resources, and it's cleaner to developers than checks are run only if they modify particular files. Testing done: |
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.
<3
Everything worked as expected after merge:
|
This PR replaces a stateful force push check when pull requests are merged with a stateless version bump check when a new commit is pushed to any PR with the target branch as
main
.The motivation of this change is to remove the solution with
git push --force
, and yet still have most of its features:git push --force
it is for CI to decide to bump the last version onmain
to the next one, so developers do not need to track if the version onmain
changed meanwhile sb merged other PR. With the proposed solution we don't have this particular gain, however, it should be rare people won't figure out the version changed meanwhile,AlephBFT
to crates.io - this still holds,git push --force
is we can enablemain
as protected branch in GitHub, and that preventsgit push --force
from outside as well as forces PR to be raised with given a configurable minimal amount of approvers (this works on our otheraleph-node
repo).Once this PR is merged, the other one #165 would be declined (thanks for that work which influenced this PR).
Testing done:
.github/workflows/check-version-bumped.yml
was tested on the fork, see test1: added new line Marcin-Radecki/AlephBFT#3 and history of commits on that PR.github/workflows/push-foundation-repo.yml
change was not tested due to its nature,.github/workflows/push-foundation-repo.yml
was partially tested, with modified version (Marcin-Radecki@ff9475b, Marcin-Radecki@13a890d): on PR merged Feature/testing crates io push Marcin-Radecki/AlephBFT#4 this action was run https://github.com/Marcin-Radecki/AlephBFT/runs/4787358743?check_suite_focus=true