Skip to content

Commit 8e1d261

Browse files
INSTA-31060 INSTANA_README: fix tag creation, add patching/release info (#16)
* INSTANA_README: fix tag creation, add patching/release info Fix the description of how to create a tag after the synch: incorporate the procedure of how to retrieve the last upstream commit and indicate where exactly you need to write it in the tag message. Add patching and release info. The patching mechanism was completely missing from the README, now it is explained in detail. The Release procedure is explained and detailed with an Example, based on the latest Release. Details of where to find the pipelines in IBM Cloud are given. * INSTANA_README: add Example in patching
1 parent 5cab070 commit 8e1d261

1 file changed

Lines changed: 83 additions & 9 deletions

File tree

INSTANA_README.md

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ It is very likely that you will receive a list of conflicts: be sure to copy pas
5454
4. Solve conflicts
5555
To solve a conflict, open the file with the conflict. The "HEAD" is the content of the downstream `synch_<year>_<n>_wip` branch, the other stream comes from the upstream's `main` branch.
5656
Once you identify what is the correct content of the file, save the file and run
57-
`git add <file>
58-
when you solved all the conflicts, you are ready to finalize your Merge. If you are not able to solve all the conflicts, go to "partial merges" section.
57+
`git add <file>`
58+
When you solve all the conflicts, you are ready to finalize your Merge. If you are not able to solve all the conflicts, go to "partial merges" section.
5959

6060
5. How to finalize your merge
6161
Before doing this, be sure to have the following directory ready somewhere else:
@@ -65,29 +65,38 @@ Execute
6565
if it is needed, execute
6666
`git push --force origin synch_2025_01_wip`
6767
Be careful when you format the Merge Message.
68-
Format the first line of the commit message as `Sync from upstream (yeah-month-day)`
68+
Format the first line of the commit message as `Sync from upstream (year-month-day)`
6969
Format the body of the message as a list of commit messages, coming from the upstream. Be sure to mention Author and Co-author, for every commit.
7070
You can view this info executing the following command on the local clone of the upstream's opentelemtry-ebpf-profiler:
7171
`git log --pretty=format:"%an <%ae> %s %nCo-authored-by: %cN <%cE>"`
72-
Explanation of formatting
72+
Explanation of formatting:
73+
```
7374
%an: Author name
7475
%ae: Author email
7576
%s: Commit message
7677
%cN: Co-author name
7778
%cE: Co-author email
79+
```
7880
This format shows the commit hash, author, and commit message, and if there are co-authors, it will display them under "Co-authored-by".
7981

80-
6. Open a PR from branch `synch_2025_01_wip`.
81-
When manual testing is finished and the Pr is approved and merged on `main`, you are ready to create a synch tag.
82+
6. Open a PR from the synch branch, for example from `synch_2025_01_wip`.
83+
When manual testing is finished and the PR is approved and merged on `main`, you are ready to create a synch tag.
8284

83-
7. Create the tag of the latest synch commit.
85+
7. Note down the last commit merged from the upstream in the Synch PR
86+
The merged PR commits can be seen in the GitHub interface in the Conversation or in the Commits section.
87+
Check the commits before your merge commit, and note down its value: it is really important, since this is a code for releasing the software!
8488

89+
8. Create the tag of the latest synch commit.
90+
91+
Attention: you need the value <last-upstream-commit>, calculated in the previous step.
8592
Checkout the local branch main, with HEAD origin/main:
8693
`git checkout main`
8794
Be sure you have all the recent updates:
8895
`git pull`
96+
Create a new tag in the following exact way (otherwise you break our release pipeline):
8997
```
90-
git tag -a synch_<year>_<n> -m "Synch <year> number <n>"
98+
tag-name = synch_<year>_<n> # compose the tag-name carefully
99+
git tag -a <tag-name> -m "Synch <year> number <n> upstream commit <last-upstream-commit>"
91100
git push origin <tag-name>
92101
```
93102

@@ -107,8 +116,73 @@ To resolve the merge conflict by choosing the upstream version for binary files,
107116

108117
When merging from the upstream, there can be so many complicated conflicts in one commit, that you prefer to stop merging and continue later on after checking more indepently how to re-apply the conflicting commit. But the problem with aborting a merge after you solved a few conflicting commits already is that you “lose” the work you did on fixing those. To not lose partial work, you can "Partially rebase your tree".
109118

110-
You have fixed already a few conflicting commits, but then you hit a big conflict and want to stop the merge. To save your rebase progress, you need to just save your current HEAD.
119+
You have fixed already a few conflicting commits, but then you hit a big conflict and want to stop the merge. To save your rebase progress, you need to just save your current `HEAD`.
111120
So from this very point, create a branch:
112121
```
113122
git branch synch_<year>_<n>_partial
114123
```
124+
125+
## The Patching system
126+
127+
The release pipeline applies patches on top of a tag, this is why is so important to create a tag with the correct name.
128+
To create n patches from the last tag, apply the following command:
129+
```
130+
git format-patch -<n> HEAD
131+
```
132+
You will notice that <n> files are created.
133+
You want to create patches for all the commits done after the last synch.
134+
Example
135+
If the following is the top of your git history:
136+
6bc0800 Teresa Noviello 2025-03-18_08:51:17 "INSTANA_README: fix tag creation, add patching/release info"
137+
5cab070 Teresa Noviello 2025-01-29_12:44:48 "README: add BUILD_IMAGE, BUILD_ENV info (#15)"
138+
3939695 Teresa Noviello 2025-01-27_17:37:47 "INSTA-16822: Lint update toolchain: Bump golangci-lint to 1.63.4, install clang-format-17 (#14)"
139+
35b4183 Teresa Noviello 2025-01-24_16:22:36 "Makefile: specify the build image, the tty interactive (#13)"
140+
270db14 Teresa Noviello 2025-01-21_12:23:16 "Sync from upstream (2025-01-17) (#11)"
141+
You do want to create 4 patches, 1 for every commit after the commit "Sync from upstream (2025-01-17) (#11)".`
142+
So you run:
143+
```
144+
git format-patch -4 HEAD
145+
```
146+
output:
147+
```
148+
0001-Makefile-specify-the-build-image-the-tty-interactive.patch
149+
0002-INSTA-16822-Lint-update-toolchain-Bump-golangci-lint.patch
150+
0003-README-add-BUILD_IMAGE-BUILD_ENV-info-15.patch
151+
0004-INSTANA_README-fix-tag-creation-add-patching-release.patch
152+
```
153+
Now you need to add the patches to the correct repository.
154+
155+
Clone locally the repository https://github.ibm.com/instana/ebpf-profiler-cicd, create a branch checking-out from `main` branch and add the patch file(s) in the directory `patches`, paying attention to:
156+
1. Substitute the hyphens with underscores
157+
2. Simplify the file name
158+
3. Modify the file name to start with a sequential number, respecting the order of the patches already present in the directory `patches`.
159+
4. Reach the pipeline `epbf-profiler-patch-and-build` at
160+
https://cloud.ibm.com/devops/pipelines/tekton/978df0ca-be40-4139-a131-a22bf1bf421b?env_id=ibm:yp:us-south
161+
and modify these environment properties:
162+
`scripts-repo-branch` from `main` to the branch of ebpf-profiler-cd where the new patches were added
163+
`repotag` to the last synch tag
164+
5. Run the manual trigger: if there are no errors, you are ready to release :-)
165+
166+
## Release process
167+
168+
When a new tag is created, and the testing described in the section [The Patching system](#the-patching-system) are successful, you are ready to release.
169+
1. Reach the pipeline `ebpf-profiler-release` at
170+
https://cloud.ibm.com/devops/pipelines/tekton/029fbce8-7b0d-4f68-a04e-69f5e4723ac7?env_id=ibm:yp:us-south
171+
2. Edit the settings of the pipeline, change the variable `artifact-version` with the value of the upstream commit reported in the last tag message.
172+
173+
Example
174+
`git show synch_2025_01`
175+
The initial snipped output is:
176+
```
177+
tag synch_2025_01
178+
Tagger: Teresa Noviello <Teresa.Noviello@ibm.com>
179+
Date: Tue Mar 18 09:31:54 2025 -0700
180+
181+
Synch 2025 number 1 upstream commit 2698137
182+
```
183+
From te output above, we save can retreave the <last-upstream-commit> as 2698137.
184+
We reach the pipeline `ebpf-profiler-release` at
185+
https://cloud.ibm.com/devops/pipelines/tekton/029fbce8-7b0d-4f68-a04e-69f5e4723ac7?env_id=ibm:yp:us-south
186+
We edit the pipeline environment variable `artifact-version`, setting the value of <last-upstream-commit>, so 2698137.
187+
We save the new environment and run the Manual Trigger.
188+
If no errors are found in the building, we can retrace the upload on Artifactory in the jobs `upload-agent-x86` and `upload-agent-arm64`.

0 commit comments

Comments
 (0)