You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing/moving_packages.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -344,10 +344,63 @@ If you made these changes on a fork, you should open a pull request against the
344
344
345
345
## Notes
346
346
347
+
- A pull request should **only** migrate a single package. Please do **not** open pull request which attempts to migrate multiple packages at the same time.
347
348
- Notice that every commit includes a `Ref:` link back to the RFC issue on the main project repository. This is useful for providing additional context regarding changes, especially those involving deprecations.
348
349
- Provided you have properly setup your local repository (see the [contributing][stdlib-contributing] and [development][stdlib-development] guides), linting will be performed after every commit, and, prior to pushing changes to a remote repository, affected unit tests, examples, and benchmarks should automatically run. Depending on how widely used the original package was throughout stdlib, these quality control steps may take considerable time, and it is possible that unrelated lint errors may be flagged. If possible, address any failures, restage the changes, and attempt to commit or push again.
349
350
- As mentioned above, be **very careful** when performing global find-and-replace. It can be easy to mistakenly update non-applicable paths, thus breaking packages and all downstream dependents. You've been warned.
350
351
352
+
* * *
353
+
354
+
## Checklist
355
+
356
+
357
+
358
+
* * *
359
+
360
+
## Reviewers
361
+
362
+
Typically, we prefer to squash commits to a single commit when merging pull requests in stdlib. However, when performing package migrations, we need to preserve the exact sequence of migration commits in order to ensure proper changelog generation and automatic package versioning. Accordingly, the procedure for reviewing and merging migration pull requests diverges from normal protocol and requires additional vigilance to ensure that a migration does not break downstream usage.
363
+
364
+
When reviewing a pull request involving a package migration, one should do the following:
365
+
366
+
1. Verify that the pull request includes at most `4` and only `4` commits (i.e., `feat`, `remove`, `refactor`, and `remove`, in that order). It is possible that the namespace of the original package did not export an associated symbol; in which case, the first `remove` may not be present, and the sequence should be `feat`, `refactor`, and `remove`, in that order.
367
+
368
+
2. Verify that all CI checks pass. If not, investigate and determine whether to block the pull request from being merged.
369
+
370
+
3. Inspect each commit for the following:
371
+
372
+
-`feat`: should only add the new package. Ensure that all `require` paths have been updated and correctly refer to the new package. Ensure that any `include` directories have been renamed. Ensure that header guards have been updated.
373
+
-`remove`: should only remove the symbol from the original package.
374
+
-`refactor`: check as many files as possible, ensuring a wide cross-section of affected files, to ensure that the updated paths correctly point to the new package.
375
+
-`remove`: should only remove the original package.
376
+
377
+
If there exists a public issue associated with the migration, ensure that each commit refers to that public issue with a `ref:` Git trailer.
378
+
379
+
Ensure that each `remove` commit message body includes a `BREAKING CHANGE` section, along with migration steps.
380
+
381
+
4. If the pull request has merge conflicts, inspect the conflicts and determine whether you can easily resolve. If the conflicts cannot be resolved, you'll likely need to block the pull request from being merged. If they can be resolve, go ahead and resolve them, creating a merge commit.
382
+
383
+
5. If everything looks okay, approve the pull request changes.
384
+
385
+
6. If the pull request includes a merge commit, do the following:
386
+
387
+
- Enable "Allow merge commits" (with the default message) on GitHub in repository settings.
388
+
- Refresh the pull request page.
389
+
- Select "Create a merge commit".
390
+
- In the commit body, add a `ref:` trailer which points to the PR URL and add a `reviewed-by:` trailer with your info.
391
+
- Merge.
392
+
- Disable "Allow merge commits" on GitHub in repository settings. Our default merge setting should be "Squash and merge", and we do not want to mistakenly perform merge commits in future PRs.
393
+
- Finished.
394
+
395
+
7. Otherwise, do the following:
396
+
397
+
- Enable "Allow rebase merging" on GitHub in repository settings.
0 commit comments