feat(docs): Hugo
[csit.git] / docs / content / introduction / branches.md
1 ---
2 bookHidden: true
3 title: "Git Branches in CSIT"
4 ---
5
6 # Git Branches in CSIT
7
8 ## Overview
9
10 This document describes how to create and remove git branches in CSIT project.
11
12 To be able to perform everything described in this file, you must be **logged
13 in as a committer**.
14
15 ## Operational Branches
16
17 For more information about operational branches see
18 [CSIT/Branching Strategy](https://wiki.fd.io/view/CSIT/Branching_Strategy) and
19 [CSIT/Jobs](https://wiki.fd.io/view/CSIT/Jobs) on
20 [fd.io](https://fd.io) [wiki](https://wiki.fd.io/view/CSIT) pages.
21
22 > Note: The branch `rls2009_lts` is used here only as an example.
23
24 ### Pre-requisites
25
26 1. The last builds of weekly and semiweekly jobs must finish with status
27    *"Success"*.
28 1. If any of watched jobs failed, try to find the root cause, fix it and run it
29    again.
30
31 The watched jobs are:
32
33 - master:
34   - [csit-vpp-device-master-ubuntu1804-1n-skx-weekly](https://jenkins.fd.io/view/csit/job/csit-vpp-device-master-ubuntu1804-1n-skx-weekly)
35   - [csit-vpp-device-master-ubuntu1804-1n-skx-semiweekly](https://jenkins.fd.io/view/csit/job/csit-vpp-device-master-ubuntu1804-1n-skx-semiweekly)
36 - 2009_lts:
37   - [csit-vpp-device-2009_lts-ubuntu1804-1n-skx-weekly](https://jenkins.fd.io/view/csit/job/csit-vpp-device-2009_lts-ubuntu1804-1n-skx-weekly)
38   - [csit-vpp-device-2009_lts-ubuntu1804-1n-skx-semiweekly](https://jenkins.fd.io/view/csit/job/csit-vpp-device-2009_lts-ubuntu1804-1n-skx-semiweekly)
39
40 ### Procedure
41
42 **A. CSIT Operational Branch**
43 1. Take the revision string from the last successful build of the **weekly**
44    job, e.g. **Revision**: 0f9b20775b4a656b67c7039e2dda4cf676af2b21.
45 1. Open [Gerrit](https://gerrit.fd.io).
46 1. Go to
47    [Browse --> Repositories --> csit --> Branches](https://gerrit.fd.io/r/admin/repos/csit,branches).
48 1. Click `CREATE NEW`.
49 1. Fill in the revision number and the name of the new operational branch. Its
50    format is: `oper-YYMMDD` for master and `oper-rls{RELEASE}-{YYMMDD}` or
51    `oper-rls{RELEASE}_lts-{YYMMDD}` for release branches.
52 1. Click "CREATE".
53 1. If needed, delete old operational branches by clicking "DELETE".
54
55 **B. VPP Stable version**
56 1. Open the console log of the last successful **semiweekly** build and search
57    for VPP version (e.g. vpp_21 ...).
58 1. You should find the string with this structure:
59    `vpp_21.01-rc0~469-g7acab3790~b368_amd64.deb`
60 1. Modify [VPP_STABLE_VER_UBUNTU_BIONIC](../../VPP_STABLE_VER_UBUNTU_BIONIC)
61    and [VPP_STABLE_VER_CENTOS](../../VPP_STABLE_VER_CENTOS) files.
62 1. Use a string with the build number, e.g. `21.01-rc0~469_g7acab3790~b129`
63    for [VPP_STABLE_VER_CENTOS](../../VPP_STABLE_VER_CENTOS) and a string
64    without the build number, e.g. `21.01-rc0~469_g7acab3790` for
65    [VPP_STABLE_VER_UBUNTU_BIONIC](../../VPP_STABLE_VER_UBUNTU_BIONIC).
66 1. Update the stable versions in master and in all LTS branches.
67
68 ## Release Branches
69
70 > Note: VPP release 21.01 is used here only as an example.
71
72 ### Pre-requisites
73
74 1. VPP release manager sends the information email to announce that the RC1
75    milestone for VPP {release}, e.g. 21.01, is complete, and the artifacts are
76    available.
77 1. The artifacts (*.deb and *.rpm) should be available at
78    `https://packagecloud.io/fdio/{release}`. For example see artifacts for the
79    [VPP release 20.01](https://packagecloud.io/fdio/2101). The last available
80    build is to be used.
81 1. All CSIT patches for the release are merged in CSIT master branch.
82
83 ### Procedure
84
85 **A. Release branch**
86
87 1. Open [Gerrit](https://gerrit.fd.io).
88 1. Go to
89    [Browse --> Repositories --> csit --> Branches](https://gerrit.fd.io/r/admin/repos/csit,branches).
90 1. Save the revision string of master for further use.
91 1. Click `CREATE NEW`.
92 1. Fill in the revision number and the name of the new release branch. Its
93    format is: `rlsYYMM`, e.g. rls2101.
94 1. Click "CREATE".
95
96 **B. Jenkins jobs**
97
98 See ["Add CSIT rls2101 branch"](https://gerrit.fd.io/r/c/ci-management/+/30439)
99 and ["Add report jobs to csit rls2101 branch"](https://gerrit.fd.io/r/c/ci-management/+/30462)
100 patches as an example.
101
102 1. [csit.yaml](https://github.com/FDio/ci-management/blob/master/jjb/csit/csit.yaml):
103    Documentation of the source code and the Report
104    - Add release branch (rls2101) for `csit-docs-merge-{stream}` and
105      `csit-report-merge-{stream}` (project --> stream).
106 1. [csit-perf.yaml](https://github.com/FDio/ci-management/blob/master/jjb/csit/csit-perf.yaml):
107    Verify jobs
108    - Add release branch (rls2101) to `project --> jobs -->
109      csit-vpp-perf-verify-{stream}-{node-arch} --> stream`.
110    - Add release branch (rls2101) to `project --> project: 'csit' --> stream`.
111    - Add release branch (rls2101) to `project --> project: 'csit' --> stream_report`.
112 1. [csit-tox.yaml](https://github.com/FDio/ci-management/blob/master/jjb/csit/csit-tox.yaml):
113    tox
114    - Add release branch (rls2101) to `project --> stream`.
115 1. [csit-vpp-device.yaml](https://github.com/FDio/ci-management/blob/master/jjb/csit/csit-vpp-device.yaml):
116    csit-vpp-device
117    - Add release branch (rls2101) to `project --> jobs (weekly / semiweekly) --> stream`.
118    - Add release branch (rls2101) to `project --> project: 'csit' --> stream`.
119
120 **C. VPP Stable version**
121
122 See the patch
123 [Update of VPP_REPO_URL and VPP_STABLE_VER files](https://gerrit.fd.io/r/c/csit/+/30461)
124 and / or
125 [rls2101: Update VPP_STABLE_VER files to release version](https://gerrit.fd.io/r/c/csit/+/30976)
126 as an example.
127
128 1. Find the last successful build on the
129    [Package Cloud](https://packagecloud.io) for the release, e.g.
130    [VPP release 20.01](https://packagecloud.io/fdio/2101).
131 1. Clone the release branch to your PC:
132    `git clone --depth 1 ssh://<user>@gerrit.fd.io:29418/csit --branch rls{RELEASE}`
133 1. Modify [VPP_STABLE_VER_UBUNTU_BIONIC](../../VPP_STABLE_VER_UBUNTU_BIONIC)
134    and [VPP_STABLE_VER_CENTOS](../../VPP_STABLE_VER_CENTOS) files with the last
135    successful build.
136 1. Modify [VPP_REPO_URL](../../VPP_REPO_URL) to point to the new release, e.g.
137    `https://packagecloud.io/install/repositories/fdio/2101`.
138 1. You can also modify the [.gitreview](../../.gitreview) file and set the new
139    default branch.
140 1. Wait until the verify jobs
141    - [csit-vpp-device-2101-ubuntu1804-1n-skx](https://jenkins.fd.io/job/csit-vpp-device-2101-ubuntu1804-1n-skx)
142    - [csit-vpp-device-2101-ubuntu1804-1n-tx2](https://jenkins.fd.io/job/csit-vpp-device-2101-ubuntu1804-1n-tx2)
143
144    successfully finish and merge the patch.
145
146 **D. CSIT Operational Branch**
147
148 1. Manually start (Build with Parameters) the weekly job
149    [csit-vpp-device-2101-ubuntu1804-1n-skx-weekly](https://jenkins.fd.io/view/csit/job/csit-vpp-device-2101-ubuntu1804-1n-skx-weekly)
150 1. When it successfully finishes, take the revision string e.g. **Revision**:
151    876b6c1ae05bfb1ad54ff253ea021f3b46780fd4 to create a new operational branch
152    for the new release.
153 1. Open [Gerrit](https://gerrit.fd.io).
154 1. Go to
155    [Browse --> Repositories --> csit --> Branches](https://gerrit.fd.io/r/admin/repos/csit,branches).
156 1. Click `CREATE NEW`.
157 1. Fill in the revision number and the name of the new operational branch. Its
158    format is: `oper-rls{RELEASE}-YYMMDD` e.g. `oper-rls2101-201217`.
159 1. Click "CREATE".
160 1. Manually start (Build with Parameters) the semiweekly job
161    [csit-vpp-device-2101-ubuntu1804-1n-skx-semiweekly](https://jenkins.fd.io/view/csit/job/csit-vpp-device-2101-ubuntu1804-1n-skx-semiweekly)
162 1. When it successfully finishes check in console log if it used the right VPP
163    version (search for `VPP_VERSION=`) from the right repository (search for
164    `REPO_URL=`).
165
166 **E. Announcement**
167
168 If everything is as it should be, send the announcement email to
169 `csit-dev@lists.fd.io` mailing list.
170
171 *Example:*
172
173 Subject:
174 ```text
175 CSIT rls2101 branch pulled out
176 ```
177
178 Body:
179 ```text
180 CSIT rls2101 branch [0] is created and fully functional.
181
182 Corresponding operational branch (oper-rls2101-201217) has been created too.
183
184 We are starting dry runs for performance ndrpdr iterative tests to get initial
185 ndrpdr values with available rc1 packages as well as to test all the infra
186 before starting report data collection runs.
187
188 Regards,
189 <signature>
190
191 [0] https://git.fd.io/csit/log/?h=rls2101
192 ```