Skip to content

Commit 9fce3c9

Browse files
authored
Add instructions for major updates to AzL (#425)
1 parent 0ca6790 commit 9fce3c9

1 file changed

Lines changed: 52 additions & 10 deletions

File tree

docs/release-process/azurelinux-spec-update.md

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ For each version released:
1414

1515
1. Find and open the [microsoft-go](https://dev.azure.com/dnceng/internal/_build?definitionId=958) build that produced the new Microsoft build of Go release.
1616
1. From the URL, copy the build ID.
17-
* For example, in `[...]results?buildId=2535309&view=results`, it is `2535309`.
17+
* For example, in `[...]results?buildId=2535309&view=results`, it is `2535309`.
1818
1. Go to [microsoft-go-infra-update-azure-linux](https://dev.azure.com/dnceng/internal/_build?definitionId=1405).
1919
1. Click "Run pipeline", and:
20-
1. For `The ID of the microsoft-go build pipeline`, paste the build ID.
21-
1. Fill other fields as instructed in the dialog.
22-
1. Click "Run".
20+
1. For `The ID of the microsoft-go build pipeline`, paste the build ID.
21+
1. Fill other fields as instructed in the dialog.
22+
1. Click "Run".
2323
1. Wait for the pipeline to complete.
2424
1. Go to the generated PR: either look in the pipeline's logs for the link or check your GitHub notifications.
25+
1. **If** this is a new major release, follow instructions in [Adding a new major version](#adding-a-new-major-version) before proceeding.
2526
1. Follow the instructions in the PR to finalize it.
2627
1. Done!
2728

@@ -30,28 +31,69 @@ For each version released:
3031
This workflow uses tools to avoid time consuming copy paste and manual CI retry after tarball mirroring.
3132

3233
1. Use https://github.com/microsoft/go-lab/tree/main/goaztool to mirror the source tarballs to Azure Linux storage.
33-
* For example, `go run github.com/microsoft/go-lab/goaztool/cmd/azlmirror -versions 1.24.5-1,1.25.3-1`
34-
* Make sure to do this first, so you don't have to manually re-run the GitHub CI pipelines later.
34+
* For example, `go run github.com/microsoft/go-lab/goaztool/cmd/azlmirror -versions 1.24.5-1,1.25.3-1`
35+
* Make sure to do this first, so you don't have to manually re-run the GitHub CI pipelines later.
3536

3637
Follow manual workflow to create PRs:
3738

3839
1. Find and open each microsoft-go build...
3940
1. ... See above manual workflow ...
4041
1. Wait for each microsoft-go-infra-update-azure-linux pipeline to complete.
42+
1. **If** this is a new major release, follow instructions in [Adding a new major version](#adding-a-new-major-version) before proceeding.
4143

4244
Ignore instructions in each PR, and instead:
4345

4446
1. Use https://github.com/microsoft/go-lab/tree/main/goaztool to create a buddy build for each PR:
45-
1. For example, `go run github.com/microsoft/go-lab/goaztool/cmd/azlbuddy -prs 1234`
46-
* Replace `1234` with the PR URL or number.
47-
1. Paste a link to the buddy build from the command output into the PR conversation.
48-
1. Mark the PR ready to review.
47+
1. For example, `go run github.com/microsoft/go-lab/goaztool/cmd/azlbuddy -prs 1234`
48+
* Replace `1234` with the PR URL or number.
49+
1. Paste a link to the buddy build from the command output into the PR conversation.
50+
1. Mark the PR ready to review.
4951
1. Done!
5052

5153
## Automated workflow
5254

5355
Tracked by [microsoft/go-lab#79](https://github.com/microsoft/go-lab/issues/79).
5456

57+
## Adding a new major version
58+
59+
The tool doesn't totally handle the creation of a new major version of Go.
60+
The expected end state is that we only have `golang.spec` (for `N`) and `golang-<N-1>.spec` files.
61+
No old `golang-<X>.spec` files should be left around.
62+
63+
This process should have a good result for a new major version `N`, supported `N-1`, and removing `N-2`:
64+
65+
1. Open the auto-PR locally.
66+
1. Go to `SPECS/golang/golang.spec`.
67+
1. Reset to the original `3.0-dev` branch state for:
68+
`golang.spec`
69+
`golang.signatures.json`
70+
* E.g. `git restore --source=origin/3.0-dev --staged --worktree -- golang.spec golang.signatures.json`
71+
1. Copy:
72+
`golang.spec` to `golang-<N-1>.spec`
73+
`golang.signatures.json` to `golang-<N-1>.signatures.json`
74+
1. Restore the auto-generated updates to `golang.spec` and `golang.signatures.json`.
75+
* E.g. `git restore --source=HEAD --staged --worktree -- golang.spec golang.signatures.json`
76+
1. Delete:
77+
`golang-<N-2>.spec`
78+
`golang-<N-2>.signatures.json`
79+
1. If the new major version of Go requires an update to the bootstrap version of Go, update `golang.spec` accordingly.
80+
1. Add a new `SourceX` entry.
81+
1. Add a new `%prep` entry.
82+
1. Add a new `%build` call to `go_bootstrap X`.
83+
1. In the repo root `cgmanifest.json`, remove the entry with name `golang` and `version` `<N-2>.*`.
84+
1. Update `LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md` and `LICENSES-AND-NOTICES/SPECS/data/licenses.json`.
85+
* E.g. (Linux/WSL with podman (or Docker))
86+
```
87+
podman pull mcr.microsoft.com/azurelinux/base/core:3.0
88+
podman run -v "$(pwd):/work:z" -w /work -it --rm mcr.microsoft.com/azurelinux/base/core:3.0
89+
tdnf install -y python3 python3-pip
90+
pip install -r ./toolkit/scripts/requirements.txt
91+
./toolkit/scripts/license_map.py --no_check --update --remove_missing LICENSES-AND-NOTICES/SPECS/data/licenses.json LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md SPECS SPECS-EXTENDED SPECS-SIGNED
92+
exit
93+
```
94+
* If this doesn't turn out quite right, don't worry: AzL GitHub Actions CI will catch it and fail.
95+
1. Commit the changes and push back to the automatically opened PR.
96+
5597
## Resources
5698
5799
The Azure Linux PR generation implementation is in [/cmd/releasego/update-azure-linux.go](../../cmd/releasego/update-azure-linux.go).

0 commit comments

Comments
 (0)