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