Joey Armstrong | 54fd779 | 2024-01-18 09:12:30 -0500 | [diff] [blame^] | 1 | .. _coding-release-bugfix: |
| 2 | |
| 3 | Create a patch on a release branch |
| 4 | ================================== |
| 5 | |
| 6 | Clone & Checkout Release Branch |
| 7 | ------------------------------- |
| 8 | |
| 9 | .. code-block:: shell-session |
| 10 | :caption: Release patch: checkout |
| 11 | |
| 12 | # ------------------------------------------------ |
| 13 | # Clone a repostiory of interest (ex: votlha-lib-go) |
| 14 | # Checkout release branch voltha-2.12 for patching |
| 15 | # ------------------------------------------------ |
| 16 | % git clone "ssh://gerrit.opencord.org:29418/voltha-lib-go.git" |
| 17 | % cd voltha-lib-go |
| 18 | % git checkout voltha-2.12 |
| 19 | |
| 20 | # ------------------------------------------------------ |
| 21 | # Or if something is amiss checkout by tag for diagnosis |
| 22 | # ------------------------------------------------------ |
| 23 | % cat VERSION |
| 24 | % git checkout tags/v{VERSION-FILE-STRING} |
| 25 | |
| 26 | Command output |
| 27 | |
| 28 | :: |
| 29 | % git checkout voltha-2.12 |
| 30 | Branch 'voltha-2.12' set up to track remote branch 'voltha-2.12' from 'origin'. |
| 31 | Switched to a new branch 'voltha-2.12' |
| 32 | |
| 33 | |
| 34 | .. code-block:: shell-session |
| 35 | :caption: Create a dev branch from release |
| 36 | |
| 37 | % git checkout -b dev-joey |
| 38 | % git branch -a |
| 39 | |
| 40 | master |
| 41 | * voltha-2.12 <<---** Commits land here |
| 42 | remotes/origin/HEAD -> origin/master |
| 43 | remotes/origin/master |
| 44 | remotes/origin/voltha-2.11 |
| 45 | remotes/origin/voltha-2.12 |
| 46 | |
| 47 | |
| 48 | Verify sandbox tag and branch are release |
| 49 | ----------------------------------------- |
| 50 | |
| 51 | .. code-block:: shell-session |
| 52 | :caption: Release patch: Verify checkout |
| 53 | |
| 54 | # ---------------------------------------------------------------- |
| 55 | # Verify tags and branch for your release patch are correct. |
| 56 | # HEAD will be attached to the branch (and most recent release tag) |
| 57 | # ---------------------------------------------------------------- |
| 58 | % git fetch --tags |
| 59 | % cat VERSION |
| 60 | 7.5.3 |
| 61 | % git log --graph --decorate --oneline $@ |
| 62 | |
| 63 | HEAD will be attached to origin/voltha-2.12 and the latest release tag v7.5.3 |
| 64 | |
| 65 | :: |
| 66 | |
| 67 | git log --graph --decorate --oneline $@ |
| 68 | |
| 69 | * aeb3c4f (HEAD -> voltha-2.12, tag: v7.5.3, origin/voltha-2.12) [VOL-5245] -- release patch |
| 70 | * ad265dd (tag: v7.5.2) [VOL-5245] - branch and release repo:voltha-lib-go |
| 71 | * 9cdee9f (tag: v7.5.1, tag: v2.12.0) [VOL-5245] branch and release repo:voltha-lib-go |
| 72 | |
| 73 | |
| 74 | Edit and commit |
| 75 | --------------- |
| 76 | |
| 77 | .. code-block:: shell-session |
| 78 | :caption: Edit, commit, rebase and review |
| 79 | |
| 80 | # ---------------------------------------------------------------- |
| 81 | # Edit sources to taste |
| 82 | # ---------------------------------------------------------------- |
| 83 | {emacs,vi,$EDITOR} ... |
| 84 | |
| 85 | # :ref:`pull-request--commit-message` |
| 86 | % git commit -F ./commit-message |
| 87 | |
| 88 | |
| 89 | Rebase against the release branch |
| 90 | --------------------------------- |
| 91 | |
| 92 | .. code-block:: shell-session |
| 93 | :caption: Rebase against release branch ``NOT branch=master`` |
| 94 | |
| 95 | # Run one of |
| 96 | % rebase -i HEAD |
| 97 | % rebase -i voltha-2.12 |
| 98 | |
| 99 | |
| 100 | Code Review |
| 101 | ----------- |
| 102 | |
| 103 | .. code-block:: shell-session |
| 104 | :caption: Push to gerrit, code review |
| 105 | |
| 106 | % git review --reviewers foo@bar.tans |
| 107 | |
| 108 | |
| 109 | Verify Patch |
| 110 | ------------ |
| 111 | |
| 112 | Now visit gerrit and verify your release bugfix is correctly decorated. |
| 113 | In gerrit, review the 'Repo|Branch' item in the top left corner. |
| 114 | 'votlha-2.12' or the release tag will be visible. If branch 'master' is |
| 115 | listed abandon the patch beucase it will not be applied to the proper branch. |