-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Allow to recreate working branch based on their "base" branch #2018
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Olblak <me@olblak.com>
* Push operation should return a bool that indicate if a push --force allowed and needed * Add mechanism to detect if the Updatelci working branch diverged from the based on Signed-off-by: Olblak <me@olblak.com>
* Align the push function with the one from gitgeneric * Checkout function allow to reset the branch if --force is set to true * Fix a param inheritance issue gs.Submodules = childGHSpec.Submodules * Add a boolean to indicate if a action need to reset the description Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
must be reset after git push --force Signed-off-by: Olblak <me@olblak.com>
Here is a PR that I used to test the force push and pullrequet description update |
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
olblak
added
enhancement
New feature or request
scm-github
SCM of type GiHhub
scm-git
SCM of kind "Git"
scm-gittea
scm-gitlab
scm-stash
core
All things related to Updatecli core engine
labels
Mar 29, 2024
Signed-off-by: Olblak <me@olblak.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
core
All things related to Updatecli core engine
enhancement
New feature or request
scm-git
SCM of kind "Git"
scm-github
SCM of type GiHhub
scm-gitlab
scm-gittea
scm-stash
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #1747
This pullrequest allows to detect if git working branch used by Updatecli diverged from its base one.
If it diverged then Updatecli can recreate the working branch and reapply pipelines.
If a branch is recreated then Updatecli execute a
git push --force
and refresh the pullrequest descriptionPlease note that only GitHub plugin allows to modify a pullrequest body. Gitlab, Gitea, and stash requires additional work which need to be scheduled.
By default, Updatecli won't try to converge the working branch and the base branch. To enable it, we need to add the parameter
force
like in the following exampleTest
It's hard to have automated test for this pullrequest so instead I am going with manual test.
Additional Information
Tradeoff
Potential improvement
Improve the Scm Gitlab, Gitea, Stash to allow customizing the pull request body. This will more than likely require a rewrite of those plugins as I currently rely on the go-scm library