-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Add instructions for creating backport PRs #36593
Conversation
This needs reviews from the RMs too. Added as requested reviewers. |
|
||
git checkout devel | ||
git --fetch upstream | ||
git merge upstream/devel |
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.
actually a pull --rebase
is better to make sure any local changes are 'on top', but this is actually not needed at all since we are updating stable-2.5
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.
Yeah, part of this is based around my workflow, and my devel
is never diverged from upstream/devel
, so a git merge upstream/devel
always applies correctly.
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.
he, i always diverge devel, then push to diff branch
git --fetch upstream | ||
git merge upstream/devel | ||
git checkout stable-2.5 | ||
git pull |
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 should be --rebase
to ensure local changes are applied to the top
this also assumes stable-2.5 was already preexisting on the local repo, i would instead use this step and leave the other as an 'option' if you already have stable-2.5
git checkout upstream/stable-2.5 -b stable-2.5
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.
It doesn't necessarily assume stable-2.5
was already pre-exisiting. The first time you try to checkout a branch, if it's not local, it's pulled from one of the remotes.
In which case, you should never need --rebase
, since that branch is from upstream
.
But yes, there are a lot of assumptions when trying to talk git workflow.
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've had issues with the branch autoselection, but probably cause i have multiple remotes with the branch, in any case you should specify which one.
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.
if checking out new, there is no need for pull, if the branch existed locally, doing pull w/o a --rebase can create issues (user had local commits)
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.
In the end you can reduce most of these lines to 2 steps
git --fetch upstream
git checkout upstream/stable-2.5 -b cherry-pick/2.5/[PR_NUMBER_FROM_DEVEL]
git checkout stable-2.5 | ||
git pull | ||
git checkout -b cherry-pick/2.5/[PR_NUMBER_FROM_DEVEL] | ||
|
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.
not sure why this step is needed, since the instructions assume devel has the commit as seen below
or is this intended to work as a rename? -m ? could just checkout upstream/stable-2.5 directly into the desired name
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.
Not sure I understand this comment. The idea is that we are creating a feature branch from a stable branch, cherry picking into the stable feature branch from devel, so we can push and create a PR.
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.
ah, checkout is not really best way, it seems you just want -m (rename)
|
||
.. note:: | ||
|
||
The choice to use ``cherry-pick/2.5/[PR_NUMBER_FROM_DEVEL]`` as the |
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.
bikeshed: i would recommend 'backport' instead of cherry-pick as sometimes the PR will not be possible to be made by cherry-picking (too much code changed).
simpler workflow
|
||
.. note:: | ||
|
||
These instructions assume that ``https://github.com/ansible/ansible.git`` |
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.
... and that the origin
remote refers to your personal Ansible fork.
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.
he, posted 'edit' with that
added origin note
posted a couple of edits as suggestions, feel free to blow away |
The test
|
#. Prepare your devel, stable, and feature branches: | ||
|
||
:: | ||
git --fetch upstream |
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.
Need a blank line here to fix formatting
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.
Fixed
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 good. Thanks @sivel! Merge at will.
.. note:: | ||
|
||
These instructions assume that ``https://github.com/<yourgithubaccount>/ansible.git`` | ||
is configured as a `git remote`` named ``origin``. If you do not use |
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.
Missing ` in-front of git remote
Tested and worked for me. |
I have not. It wouldn't be too hard, but the changelog part would be omitted, unless whatever did it paused waiting for you to confirm, or tried to do it on it's own with assumptions. It would also have to be tolerant of merge conflicts. Going to proceed with merging this as is. |
* Add instructions for creating backport PRs * Update development_process.rst simpler workflow * Update development_process.rst added origin note * A few adjustments to clarity, use backport instead of cherry pick in branch name * Address formatting issue * fetch isn't a flag * Fix rst formatting (cherry picked from commit 076ea07)
SUMMARY
Add instructions for creating backport PRs
ISSUE TYPE
COMPONENT NAME
docs/docsite/rst/community/development_process.rst
ANSIBLE VERSION
ADDITIONAL INFORMATION