Skip to content
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

Added backports to procedure #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added procedures/assets/tag_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added procedures/assets/version_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions procedures/prs.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,37 @@ See updated changelog file and/or add any other summarized helpful information f
That's it. Once your PR is submitted make sure to keep an eye on your PR notifications for any follow ups, once it's approved, a core team member will merge it.

Thanks for contributing to Kytos-ng.

## Creating a Backport

Backports are necessary to keep old versions updated. When it is agreed to apply changes to released deployments, it is done for two main reasons:
- Bugs found: If a bug is found in an older deployment, it is necessary to address issues like this so as not to interrupt production scenarios.
- New required features: Exceptionally, in certain cases, some features can be desired to be in older versions so it is easier to interact with Kytos. Otherwise, it is recommended to upgrade to a newer version.

### How to create a backport and a new tagged version

- Find the latest version, e.g. `20XX.2.0`, then checkout that tag `20XX.2.0`.
- Create and push a new base branch incrementing the patch version `base/20XX.2.1` (only a core dev or maintainer can push a branch upstream; if such titles are needed, do not hesitate to request them).
- Create another branch `release/20XX.2.1` from `base/20XX.2.1`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a paragraph explaining how to git cherry-pick?

  • You should use git cherry-pick <sha1> to pick the commits being backported. The only exception not to cherry-pick is when the original commit has extra unwanted code, in that case, copy the desired parts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it.

- Make the necessary changes on `release/20XX.2.1`, this could be done with `git cherry-pick <commit>` to pick the commits being backported. The only exception not to cherry-pick is when the original commit has extra unwanted code, in that case, only copy the desired parts.
- Create a pull request (PR) and target the branch `base/20XX.2.1`. New changes will be first in `release/20XX.2.1` and will get merged to `base/20XX.2.1`.
- After the PR is closed, make sure to delete `release/20XX.2.1` branch (most kytos-ng org repos will auto delete it).
- Draft a new release with the name as `20XX.2.1`, choose the tag `20XX.2.1` and target the branch `base/20XX.2.1` from this example.

<div align="center">
<a href="assets/tag_example.png"><img src="assets/tag_example.png"></a>
</div>

- Double check if the new lease is targeting the correct branch. To do so, go to the Github release page, open the newly created release, and open the commit. Verify that the last PR was made on the PR which should target `base/20XX.2.1`. For example, from version `2023.2.8` this is the [commit](https://github.com/kytos-ng/mef_eline/commit/9fad3dd2d5c776b849d3d87cd9bc261174d92add) that can be accessed from the release page (picture from released version).

<div align="center">
<a href="assets/version_example.png"><img src="assets/version_example.png"></a>
</div>

- Send a notification about the new release on the Slack channel.

### Final observations.

PR created for a previous version does not run automatic tests so make sure to run unit tests to enssure that the changes are safe to be merged.

Also, it is allowed to have multiple PRs targetting the same backport version but we never merge on `base/20XX.X.X` more than once.