Debian Codegraph @

RELEASE.md

raw
1 <!-- edit this in https://github.com/conda/infrastructure -->
2
3 [epic template]: https://github.com/conda/conda-package-handling/issues/new?assignees=&labels=epic&template=epic.yml
4 [compare]: https://github.com/conda/conda-package-handling/compare
5 [new release]: https://github.com/conda/conda-package-handling/releases/new
6 [infrastructure]: https://github.com/conda/infrastructure
7 [rever docs]: https://regro.github.io/rever-docs
8 [release docs]: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
9 [merge conflicts]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts
10 [Anaconda Recipes]: https://github.com/AnacondaRecipes/conda-package-handling-feedstock
11 [conda-forge]: https://github.com/conda-forge/conda-package-handling-feedstock
12
13 # Release Process
14
15 > [!NOTE]
16 > Throughout this document are references to the version number as `MAJOR.MINOR.MINOR`, this should be replaced with the correct version number. Do **not** prefix the version with a lowercase `v`.
17
18 ## 1. Open the release issue and cut a release branch. (do this ~1 week prior to release)
19
20 > [!NOTE]
21 > The new release branch should adhere to the naming convention of `MAJOR.MINOR.x` (note the difference to `MAJOR.MINOR.MINOR`). In the case of patch/hotfix releases, however, do NOT cut a new release branch; instead, use the previously-cut `MAJOR.MINOR.x` release branch.
22
23 Use the issue template below to create the release issue. After creating the release issue, pin it for easy access.
24
25 <details>
26 <summary><h3>Release Template</h3></summary>
27
28 #### Title:
29 ```markdown
30 Release `MAJOR.MINOR.x`
31 ```
32
33 #### Body:
34 ```markdown
35 ### Summary
36
37 Placeholder for `conda-package-handling MAJOR.MINOR.x` release.
38
39 | Pilot | <pilot> |
40 |---|---|
41 | Co-pilot | <copilot> |
42
43 ### Tasks
44
45 [milestone]: https://github.com/conda/conda-package-handling/milestone/<milestone>
46 [process]: https://github.com/conda/conda-package-handling/blob/main/RELEASE.md
47 [releases]: https://github.com/conda/conda-package-handling/releases
48 [main]: https://github.com/AnacondaRecipes/conda-package-handling-feedstock
49 [conda-forge]: https://github.com/conda-forge/conda-package-handling-feedstock
50 [ReadTheDocs]: https://readthedocs.com/projects/continuumio-conda-package-handling/
51 [zulip]: https://conda.zulipchat.com/#narrow/channel/480811-releases
52
53 <details open> <!-- feel free to remove the open attribute once this section is completed -->
54 <summary><h4>The week before release week</h4></summary>
55
56 - [ ] Create release branch (named `MAJOR.MINOR.x`)
57 - [ ] Ensure release candidates are being successfully built (see `conda-canary/label/conda-conda-package-handling-rc-MAJOR.MINOR.x`)
58 - [ ] [Complete outstanding PRs][milestone]
59 - [ ] Check for deprecated features
60 - [ ] Test release candidates
61 <!-- indicate here who has signed off on testing -->
62
63 </details>
64
65 <details open> <!-- feel free to remove the open attribute once this section is completed -->
66 <summary><h4>Release week</h4></summary>
67
68 - [ ] Create release PR (see [release process][process])
69 - [ ] Create Zulip thread on [#releases][zulip]
70 - [ ] Announce `MAJOR.MINOR.MINOR` in-progress
71 - [ ] [Publish release][releases]
72 - [ ] Merge `MAJOR.MINOR.x` back into `main`
73 - [ ] Activate the `MAJOR.MINOR.x` branch on [ReadTheDocs][ReadTheDocs]
74 - [ ] Bump/update feedstocks
75 - [ ] [Anaconda, Inc.'s feedstock][main]
76 - [ ] [conda-forge feedstock][conda-forge]
77 - [ ] Hand off to packaging team(s)
78 - [ ] Announce release
79 - [ ] Create & publish conda.org blog post
80 - [ ] Post on Zulip thread
81
82 </details>
83 ```
84 </details>
85
86 If a patch release is necessary, open a new release issue using the template below.
87
88 <details>
89 <summary><h3>Patch Release Template</h3></summary>
90
91 #### Title:
92 ```markdown
93 Release `MAJOR.MINOR.MINOR`
94 ```
95
96 #### Body:
97 ```markdown
98 <details open> <!-- feel free to remove the open attribute once this section is completed -->
99 <summary><h4>Patch MAJOR.MINOR.MINOR</h4></summary>
100
101 - [ ] <!-- list issues & PRs that need to be resolved here -->
102 - [ ] Create release PR (see [release process][process])
103 - [ ] Update Zulip thread on [#releases][zulip]
104 - [ ] Announce `MAJOR.MINOR.MINOR` in-progress
105 - [ ] [Publish release][releases]
106 - [ ] Merge `MAJOR.MINOR.x` back into `main`
107 - [ ] Bump/update feedstocks
108 - [ ] [Anaconda, Inc.'s feedstock][main]
109 - [ ] [conda-forge feedstock][conda-forge]
110 - [ ] Hand off to packaging team(s)
111 - [ ] Announce release
112 - [ ] Post on Zulip thread
113
114 </details>
115 ```
116
117 </details>
118
119 > [!NOTE]
120 > The [epic template][epic template] is perfect for this; remember to remove the **`epic`** label.
121
122 > [!NOTE]
123 > A patch release is like a regular, i.e., follow the same steps in the process as you would for a regular release. Most patches are authored by existing contributors (most likely maintainers themselves) so running `rever <VERSION>` may succeed on the first pass.
124
125 ## 2. Alert various parties of the upcoming release. (do this ~1 week prior to release)
126
127 Let various interested parties know about the upcoming release; at minimum, conda-forge maintainers should be informed. For major features, a blog post describing the new features should be prepared and posted once the release is completed (see the announcements section of the release issue).
128
129 ## 3. Manually test canary build(s).
130
131 ### Canary Builds for Manual Testing
132
133 Once the release PRs are filed, successful canary builds will be available on `https://anaconda.org/conda-canary/conda-package-handling/files?channel=conda-conda-package-handling-rc-MAJOR.MINOR.x` for manual testing.
134
135 > [!NOTE]
136 > You do not need to apply the `build::review` label for release PRs; every commit to the release branch builds and uploads canary builds to the respective `conda-conda-package-handling-rc-MAJOR.MINOR.x` label.
137
138 ## 4. Ensure `rever.xsh` and `news/TEMPLATE` are up to date.
139
140 These are synced from [`conda/infrastructure`][infrastructure].
141
142 <details>
143 <summary><h2>5. Run rever. (ideally done on the Monday of release week)</h2></summary>
144
145 Currently, there are only 2 activities we use rever for, (1) aggregating the authors and (2) updating the changelog. Aggregating the authors can be an error-prone process and also suffers from a builtin circular dependency (_i.e._, to generate an updated `.authors.yml` we need an updated `.mailmap` but to have an updated `.mailmap` we need an updated `.authors.yml`). This is why the following steps are very heavy-handed (and potentially repetitive) in running rever commands, undoing commits, squashing/reordering commits, etc.
146
147 1. Install [`rever`][rever docs] from the `main` branch:
148
149 ```bash
150 $ pipx install https://github.com/regro/rever.git
151 # or, if you have uv installed:
152 $ uv tool install https://github.com/regro/rever.git
153 ```
154
155 > **Note:** We install from the `main` branch rather than the released version because it contains a bug fix that has not yet been included in a release.
156
157 2. Clone and `cd` into the repository if you haven't done so already:
158
159 ```bash
160 $ git clone [email protected]:/conda-package-handling.git
161 $ cd conda-package-handling
162 ```
163
164 2. Fetch the latest changes from the remote and checkout the release branch created a week ago:
165
166 ```bash
167 $ git fetch upstream
168 $ git checkout MAJOR.MINOR.x
169 ```
170
171 2. Create a versioned branch, this is where rever will make its changes:
172
173 ```bash
174 $ git checkout -b changelog-MAJOR.MINOR.MINOR
175 ```
176
177 2. Run `rever --activities authors <VERSION>`:
178
179 > **Note:** <!-- GH doesn't support nested admonitions, see https://github.com/orgs/community/discussions/16925 -->
180 > Include `--force` when re-running any rever commands for the same `<VERSION>`, otherwise, rever will skip the activity and no changes will be made (i.e., rever remembers if an activity has been run for a given version).
181
182 ```bash
183 $ rever --activities authors --force <VERSION>
184 ```
185
186 - If rever finds that any of the authors are not correctly represented in `.authors.yml` it will produce an error. If the author that the error pertains to is:
187 - **a new contributor**: the snippet suggested by rever should be added to the `.authors.yml` file.
188 - **an existing contributor**, a result of using a new name/email combo: find the existing author in `.authors.yml` and add the new name/email combo to that author's `aliases` and `alterative_emails`.
189
190 - Once you have successfully run `rever --activities authors` with no errors, review the commit made by rever. This commit will contain updates to one or more of the author files (`.authors.yml`, `.mailmap`, and `AUTHORS.md`). Due to the race condition between `.authors.yml` and `.mailmap`, we want to extract changes made to any of the following keys in `.authors.yml` and commit them separately from the other changes in the rever commit:
191 - `name`
192 - `email`
193 - `github`
194 - `aliases`
195 - `alternate_emails`
196
197 Other keys (e.g., `num_commits` and `first_commit`) do not need to be included in this separate commit as they will be overwritten by rever.
198
199 - Here's a sample run where we undo the commit made by rever in order to commit the changes to `.authors.yml` separately:
200
201 ```bash
202 $ rever --activities authors --force MAJOR.MINOR.MINOR
203
204 # changes were made to .authors.yml as per the prior bullet
205 $ git diff --name-only HEAD HEAD~1
206 .authors.yml
207 .mailmap
208 AUTHORS.md
209
210 # undo commit
211 $ git reset --soft HEAD~1
212
213 # undo changes made to everything except .authors.yml
214 $ git restore --staged --worktree .mailmap AUTHORS.md
215 ```
216
217 - Commit these changes to `.authors.yml`:
218
219 ```bash
220 $ git add .
221 $ git commit -m "Update .authors.yml"
222 ```
223
224 - Rerun `rever --activities authors --force <VERSION>` and finally check that your `.mailmap` is correct by running:
225
226 ```bash
227 git shortlog -se
228 ```
229
230 Compare this list with `AUTHORS.md`. If they have any discrepancies, additional modifications to `.authors.yml` is needed, so repeat the above steps as needed.
231
232 - Once you are pleased with how the author's file looks, we want to undo the rever commit and commit the `.mailmap` changes separately:
233
234 ```bash
235 # undo commit (but preserve changes)
236 $ git reset --soft HEAD~1
237
238 # undo changes made to everything except .mailmap
239 $ git restore --staged --worktree .authors.yml AUTHORS.md
240 ```
241
242 - Commit these changes to `.mailmap`:
243
244 ```bash
245 $ git add .
246 $ git commit -m "Update .mailmap"
247 ```
248
249 - Continue repeating the above processes until the `.authors.yml` and `.mailmap` are corrected to your liking. After completing this, you will have at most two commits on your release branch:
250
251 ```bash
252 $ git cherry -v <release branch>
253 + 86957814cf235879498ed7806029b8ff5f400034 Update .authors.yml
254 + 3ec7491f2f58494a62f1491987d66f499f8113ad Update .mailmap
255 ```
256
257
258 4. Review news snippets (ensure they are all using the correct Markdown format, **not** reStructuredText) and add additional snippets for undocumented PRs/changes as necessary.
259
260 > **Note:** <!-- GH doesn't support nested admonitions, see https://github.com/orgs/community/discussions/16925 -->
261 > We've found it useful to name news snippets with the following format: `<PR #>-<DESCRIPTIVE SLUG>`.
262 >
263 > We've also found that we like to include the PR #s inline with the text itself, e.g.:
264 >
265 > ```markdown
266 > ## Enhancements
267 >
268 > * Add `win-arm64` as a known platform (subdir). (#11778)
269 > ```
270
271 - You can utilize [GitHub's compare view][compare] to review what changes are to be included in this release. Make sure you compare the current release branch against the previous one
272
273 - Add a new news snippet for any PRs of importance that are missing.
274
275 - Commit these changes to news snippets:
276
277 ```bash
278 $ git add .
279 $ git commit -m "Update news"
280 ```
281
282 - After completing this, you will have at most three commits on your release branch:
283
284 ```bash
285 $ git cherry -v <release branch>
286 + 86957814cf235879498ed7806029b8ff5f400034 Update .authors.yml
287 + 3ec7491f2f58494a62f1491987d66f499f8113ad Update .mailmap
288 + 432a9e1b41a3dec8f95a7556632f9a93fdf029fd Update news
289 ```
290
291 5. Run `rever --activities changelog`:
292
293 > **Note:** <!-- GH doesn't support nested admonitions, see https://github.com/orgs/community/discussions/16925 -->
294 > This has previously been a notoriously fickle step (likely due to incorrect regex patterns in the `rever.xsh` config file and missing `github` keys in `.authors.yml`) so beware of potential hiccups. If this fails, it's highly likely to be an innocent issue.
295
296 ```bash
297 $ rever --activities changelog --force <VERSION>
298 ```
299
300 - Any necessary modifications to `.authors.yml`, `.mailmap`, or the news snippets themselves should be amended to the previous commits.
301
302 - Once you have successfully run `rever --activities changelog` with no errors simply revert the last commit (see the next step for why):
303
304 ```bash
305 # undo commit (and discard changes)
306 $ git reset --hard HEAD~1
307 ```
308
309 - After completing this, you will have at most three commits on your release branch:
310
311 ```bash
312 $ git cherry -v <release branch>
313 + 86957814cf235879498ed7806029b8ff5f400034 Update .authors.yml
314 + 3ec7491f2f58494a62f1491987d66f499f8113ad Update .mailmap
315 + 432a9e1b41a3dec8f95a7556632f9a93fdf029fd Update news
316 ```
317
318 6. Now that we have successfully run the activities separately, we wish to run both together. This will ensure that the contributor list, a side-effect of the authors activity, is included in the changelog activity.
319
320 ```bash
321 $ rever --force <VERSION>
322 ```
323
324 - After completing this, you will have at most five commits on your release branch:
325
326 ```bash
327 $ git cherry -v <release branch>
328 + 86957814cf235879498ed7806029b8ff5f400034 Update .authors.yml
329 + 3ec7491f2f58494a62f1491987d66f499f8113ad Update .mailmap
330 + 432a9e1b41a3dec8f95a7556632f9a93fdf029fd Update news
331 + a5c0db938893d2c12cab12a1f7eb3e646ed80373 Update authorship for MAJOR.MINOR.MINOR
332 + 5e95169d0df4bcdc2da9a6ba4a2561d90e49f75d Update CHANGELOG for MAJOR.MINOR.MINOR
333 ```
334
335 7. Since rever does not include stats on first-time contributors, we will need to add this manually.
336
337 - Use [GitHub's auto-generated release notes][new release] to get a list of all new contributors (and their first PR) and manually merge this list with the contributor list in `CHANGELOG.md`. See [GitHub docs][release docs] for how to auto-generate the release notes.
338
339 - Commit these final changes:
340
341 ```bash
342 $ git add .
343 $ git commit -m "Add first-time contributions"
344 ```
345
346 - After completing this, you will have at most six commits on your release branch:
347
348 ```bash
349 $ git cherry -v <release branch>
350 + 86957814cf235879498ed7806029b8ff5f400034 Update .authors.yml
351 + 3ec7491f2f58494a62f1491987d66f499f8113ad Update .mailmap
352 + 432a9e1b41a3dec8f95a7556632f9a93fdf029fd Update news
353 + a5c0db938893d2c12cab12a1f7eb3e646ed80373 Update authorship for MAJOR.MINOR.MINOR
354 + 5e95169d0df4bcdc2da9a6ba4a2561d90e49f75d Update CHANGELOG for MAJOR.MINOR.MINOR
355 + 93fdf029fd4cf235872c12cab12a1f7e8f95a755 Add first-time contributions
356 ```
357
358 8. Push this versioned branch.
359
360 ```bash
361 $ git push -u upstream changelog-MAJOR.MINOR.MINOR
362 ```
363
364 9. Open the Release PR targeting the `MAJOR.MINOR.x` branch.
365
366 <details>
367 <summary>GitHub PR Template</summary>
368
369 ```markdown
370 ## Description
371
372 ✂️ snip snip ✂️ the making of a new release.
373
374 Xref #<RELEASE ISSUE>
375 ```
376
377 </details>
378
379 10. Update release issue to include a link to the release PR.
380
381 11. [Create][new release] the release and **SAVE AS A DRAFT** with the following values:
382
383 > **Note:** <!-- GH doesn't support nested admonitions, see https://github.com/orgs/community/discussions/16925 -->
384 > Only publish the release after the release PR is merged, until then always **save as draft**.
385
386 | Field | Value |
387 |---|---|
388 | Choose a tag | `MAJOR.MINOR.MINOR` |
389 | Target | `MAJOR.MINOR.x` |
390 | Body | copy/paste blurb from `CHANGELOG.md` |
391
392 </details>
393
394 ## 6. Wait for review and approval of release PR.
395
396 ## 7. Merge release PR and publish release.
397
398 To publish the release, go to the project's release page (e.g., https://github.com/conda/conda-package-handling/releases) and add the release notes from `CHANGELOG.md` to the draft release you created earlier. Then publish the release.
399
400 > [!NOTE]
401 > Release notes can be drafted and saved ahead of time.
402
403 ## 8. Merge/cherry pick the release branch over to the `main` branch.
404
405 <details>
406 <summary>Internal process</summary>
407
408 1. From the main "< > Code" page of the repository, select the drop down menu next to the `main` branch button and then select "View all branches" at the very bottom.
409
410 2. Find the applicable `MAJOR.MINOR.x` branch and click the "New pull request" button.
411
412 3. "Base" should point to `main` while "Compare" should point to `MAJOR.MINOR.x`.
413
414 4. Ensure that all of the commits being pulled in look accurate, then select "Create pull request".
415
416 > [!NOTE]
417 > Make sure NOT to push the "Update Branch" button. If there are [merge conflicts][merge conflicts], resolve them by merging `main` into the `MAJOR.MINOR.x` branch, then push the resulting merge commit. This is now a "bridging branch" to resolve the merge conflict without placing changes from `main` on to the `MAJOR.MINOR.x` branch.
418
419 5. Review and merge the pull request the same as any code change pull request.
420
421 > [!NOTE]
422 > The commits from the release branch need to be retained in order to be able to compare individual commits; in other words, a "merge commit" is required when merging the resulting pull request vs. a "squash merge". Protected branches will require permissions to be temporarily relaxed in order to enable this action.
423
424 </details>
425
426 ## 9. Open PRs to bump [Anaconda Recipes][Anaconda Recipes] and [conda-forge][conda-forge] feedstocks to use `MAJOR.MINOR.MINOR`.
427
428 > [!NOTE]
429 > Conda-forge's PRs will be auto-created via the `regro-cf-autotick-bot`. Follow the instructions below if any changes need to be made to the recipe that were not automatically added (these instructions are only necessary for anyone who is _not_ a conda-forge feedstock maintainer, since maintainers can push changes directly to the autotick branch):
430 > - Create a new branch based off of autotick's branch (autotick's branches usually use the `regro-cf-autotick-bot:XX.YY.[$patch_number]_[short hash]` syntax)
431 > - Add any changes via commits to that new branch
432 > - Open a new PR and push it against the `main` branch
433 >
434 > Make sure to include a comment on the original `autotick-bot` PR that a new pull request has been created, in order to avoid duplicating work! `regro-cf-autotick-bot` will close the auto-created PR once the new PR is merged.
435 >
436 > For more information about this process, please read the ["Pushing to regro-cf-autotick-bot branch" section of the conda-forge documentation](https://conda-forge.org/docs/maintainer/updating_pkgs.html#pushing-to-regro-cf-autotick-bot-branch).
437
438
439 ## 10. Hand off to Anaconda's packaging team.
440
441 > [!NOTE]
442 > This step should NOT be done past Thursday morning EST; please start the process on a Monday, Tuesday, or Wednesday instead in order to avoid any potential debugging sessions over evenings or weekends.
443
444 <details>
445 <summary>Internal process</summary>
446
447 1. Open packaging request in #package_requests Slack channel, include links to the Release PR and feedstock PRs.
448
449 2. Message packaging team/PM to let them know that a release has occurred and that you are the release manager.
450
451 </details>
452
453 ## 11. Continue championing and shepherding.
454
455 Remember to make all relevant announcements and continue to update the release issue with the latest details as tasks are completed.