github.com/noironetworks/cilium-net@v1.6.12/contrib/backporting/README.md (about) 1 Cilium Backporting Scripts 2 ========================== 3 4 # check-stable - List commits that need backporting 5 6 `GITHUB_TOKEN=xxx check-stable X.Y` 7 8 The `check-stable` script is derived from `relnotes` and scans for PRs which 9 have been merged and marked with the label `needs-backport/X.Y`. The 10 script will list those PRs and all non-merge commit ids that were part of the 11 merge. There are three columns: first one is the correlated sha of the commit 12 from the master branch, second one is the sha of the commit from the pull 13 request, and third column is the commit subject. The sha from the master 14 branch is then needed for backporting into downstream with the help of the 15 `cherry-pick` script. 16 17 ## Example 18 19 1. Generate a GitHub developer access token. 20 You can access directly from https://github.com/settings/tokens or 21 by open GitHub page and then: User Profile -> Settings -> 22 Developer Settings -> Personal access token -> Generate new token 23 24 The access token requires access to `public_repo`. 25 26 If not already done, install `jq` on your system. 27 28 2. Run the script to generate the list of current backporting TODOs: 29 30 `GITHUB_TOKEN=xxx `./check-stable 1.0` 31 32 The list will be dumped to stdout. 33 34 # cherry-pick - Cherry-pick individual commits 35 36 `cherry-pick <commit-sha>` 37 38 After having run `check-stable`, the `cherry-pick` script takes an individual 39 commit sha as argument and adds the upstream commit into the downstream branch. 40 It will also add a note about the upstream commit id into the commit message 41 and the signed-off-by from the backporter. 42 43 ## Example 44 45 1. Checkout one of the stable branches. Run `./check-stable` to get a TODO 46 list of commits to backport. 47 48 2. Work through the list of commits dumped and pass a non-merge commit sha 49 to `cherry-pick`: 50 51 `./cherry-pick 479dd2d5a92a7035267bcdb91186c512ddd4379e` 52 53 3. Resolve conflicts whenever necessary, and continue with the next commit.