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 |
timorl
left a comment
There was a problem hiding this comment.
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. |
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: |
|
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 --forceit is for CI to decide to bump the last version onmainto the next one, so developers do not need to track if the version onmainchanged 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,AlephBFTto crates.io - this still holds,git push --forceis we can enablemainas protected branch in GitHub, and that preventsgit push --forcefrom outside as well as forces PR to be raised with given a configurable minimal amount of approvers (this works on our otheraleph-noderepo).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.ymlwas 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.ymlchange was not tested due to its nature,.github/workflows/push-foundation-repo.ymlwas 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