@m4ss/pi-skills 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +17 -2
- package/package.json +40 -3
- package/skills/commit/SKILL.md +383 -0
- package/skills/repo-maintenance/SKILL.md +251 -0
- package/skills/repo-maintenance/references/changelogs.md +164 -0
- package/skills/repo-maintenance/references/ci-audit.md +329 -0
- package/skills/repo-maintenance/references/containers.md +287 -0
- package/skills/repo-maintenance/references/forgejo.md +162 -0
- package/skills/repo-maintenance/references/node.md +376 -0
- package/skills/repo-maintenance/references/rust.md +567 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repo-maintenance
|
|
3
|
+
license: MIT
|
|
4
|
+
description: >
|
|
5
|
+
Maintain repository dependencies and CI for Rust (Cargo) and Node.js (pnpm).
|
|
6
|
+
Use when asked to update, upgrade or bump dependencies, handle RustSec or npm
|
|
7
|
+
security advisories, bump the MSRV, audit or refresh GitHub Actions and
|
|
8
|
+
Forgejo Actions workflows, or upgrade the Alpine, Debian, Rust, Node.js,
|
|
9
|
+
database and other container images in Containerfiles, Dockerfiles and
|
|
10
|
+
Compose files.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Repository maintenance
|
|
14
|
+
|
|
15
|
+
Update dependencies and audit CI through small, reviewable local commits, then
|
|
16
|
+
report what still needs a decision.
|
|
17
|
+
|
|
18
|
+
## Pick the procedure
|
|
19
|
+
|
|
20
|
+
| Task | Read |
|
|
21
|
+
| ----------------------------------------------------- | -------------------------- |
|
|
22
|
+
| Rust dependencies, the MSRV, RustSec advisories | `references/rust.md` |
|
|
23
|
+
| Node.js dependencies with pnpm, npm advisories | `references/node.md` |
|
|
24
|
+
| Reviewing an upgrade: changelog and release diff | `references/changelogs.md` |
|
|
25
|
+
| Auditing CI, refreshing pinned actions and toolchains | `references/ci-audit.md` |
|
|
26
|
+
| Forgejo Actions, and our code.m4ss.net runners | `references/forgejo.md` |
|
|
27
|
+
| Container images in Containerfiles and Compose files | `references/containers.md` |
|
|
28
|
+
|
|
29
|
+
Paths are relative to this skill's directory. Inspect `Cargo.lock`,
|
|
30
|
+
`pnpm-lock.yaml`, `.github/workflows/`, `.forgejo/workflows/`,
|
|
31
|
+
`.gitlab-ci.yml`, the Containerfiles (including `Dockerfile`s) and the Compose
|
|
32
|
+
files to see which procedures apply. When you bump the Rust toolchain in CI,
|
|
33
|
+
also bump the Rust images in the Containerfiles. For a Rust workspace with a
|
|
34
|
+
SvelteKit frontend, run both dependency procedures in sequence (run pnpm from
|
|
35
|
+
the directory containing `pnpm-lock.yaml`). Review every major upgrade with
|
|
36
|
+
`references/changelogs.md`.
|
|
37
|
+
|
|
38
|
+
Run the CI audit when asked, or propose it when the workflows haven't changed in
|
|
39
|
+
months (`git log -1 --format=%cs -- .github .forgejo .gitlab-ci.yml`).
|
|
40
|
+
|
|
41
|
+
## Our repositories
|
|
42
|
+
|
|
43
|
+
A repository is **ours** when all of the following hold:
|
|
44
|
+
|
|
45
|
+
1. Any remote in `git remote -v` is on `code.m4ss.net` or under
|
|
46
|
+
`github.com/M4SS-Code` (SSH form `git@github.com:M4SS-Code/...`).
|
|
47
|
+
2. It is **not** a mirror or fork of an external project (exclude
|
|
48
|
+
`Mirror/<repo>` on `code.m4ss.net` whose `original_url` is outside
|
|
49
|
+
`M4SS-Code`, forks under `M4SS-Code`, and action mirrors under `Actions/`
|
|
50
|
+
except `Actions/ci-images`).
|
|
51
|
+
|
|
52
|
+
Two rules apply to our repositories:
|
|
53
|
+
|
|
54
|
+
- **Keep `deny.toml` and CI configs aligned across siblings.** Before changing
|
|
55
|
+
either, compare with sibling repositories (`references/ci-audit.md`, "Keeping
|
|
56
|
+
our repositories alike") and align any drift. If the shared template itself
|
|
57
|
+
needs a fix, fix it here and list every sibling repository that needs the same
|
|
58
|
+
change in the report.
|
|
59
|
+
- **Never reference `code.m4ss.net` outside our repositories.** Its mirrors,
|
|
60
|
+
runner images and conventions (`references/forgejo.md`) are strictly for our
|
|
61
|
+
repositories.
|
|
62
|
+
|
|
63
|
+
## Ground rules
|
|
64
|
+
|
|
65
|
+
- Load the `commit` skill before creating the first commit. It governs staging,
|
|
66
|
+
message formatting and folding fixes into earlier commits; this skill defines
|
|
67
|
+
commit grouping, subjects and required checks. If it is not available, stop
|
|
68
|
+
and ask before the first commit. Never run `git push`, and never bypass hooks
|
|
69
|
+
(`git commit --no-verify`).
|
|
70
|
+
- Record the starting commit (`git rev-parse HEAD`, called `<base>` below),
|
|
71
|
+
check `git status --short` (stop and ask if files the run will touch are
|
|
72
|
+
already dirty), and create a temporary directory outside the repository
|
|
73
|
+
(`mktemp -d`, called `<scratch>` below). Each command may run in a new shell,
|
|
74
|
+
so a variable does not survive: copy the path that `mktemp -d` prints
|
|
75
|
+
literally into later commands, and never save it to a file. Put every
|
|
76
|
+
temporary file in `<scratch>`: baselines, lockfile copies, build logs, test
|
|
77
|
+
projects, downloaded and extracted packages (`tar -xzf <file> -C <scratch>`),
|
|
78
|
+
cloned upstream repositories and `git worktree` checkouts. Never create other
|
|
79
|
+
paths in `/tmp`. Before each commit, check `git status --short` for untracked
|
|
80
|
+
files the run created (extracted crates, tool state such as `.pi/`): move them
|
|
81
|
+
to `<scratch>` or leave them out, and never commit them. At the end of the
|
|
82
|
+
run, remove any worktrees (`git worktree remove`) and then `<scratch>`.
|
|
83
|
+
- Treat code in releases under review as untrusted: read it, and never build,
|
|
84
|
+
test, install or execute anything from it before review.
|
|
85
|
+
- Never run `git log -S`, `-G` or `-p` over a whole history, in the
|
|
86
|
+
repository or in an upstream clone: on a large history it can run for many
|
|
87
|
+
minutes, and in a clone made with `--filter` it also downloads the missing
|
|
88
|
+
blobs one request at a time. In an upstream clone, limit it to a range
|
|
89
|
+
(`<old-sha>..<new-sha>`) and a path, or search the published package files
|
|
90
|
+
instead. In the repository being maintained, a path is enough
|
|
91
|
+
(`git log -S'<text>' -- Cargo.toml`).
|
|
92
|
+
- Use `curl` against `https://api.github.com/...` or
|
|
93
|
+
`raw.githubusercontent.com` for read-only GitHub queries instead of `gh`.
|
|
94
|
+
Pass `-H "Authorization: Bearer ${GITHUB_TOKEN:-$GH_TOKEN}"` only when
|
|
95
|
+
either token is set; with neither set, leave the header out entirely,
|
|
96
|
+
because an empty `Bearer` makes GitHub answer 401 even for public data.
|
|
97
|
+
- Run the exact check commands from the repository's CI with `--locked` or
|
|
98
|
+
`--frozen-lockfile`. For each commit, run the checks covering what changed
|
|
99
|
+
(build, clippy and tests across CI's feature combinations, the MSRV job,
|
|
100
|
+
cargo-deny; or pnpm's `check`, `lint`, `test` and `build`), then run the full
|
|
101
|
+
set at the end. List any CI jobs that cannot run locally (external services,
|
|
102
|
+
large feature powersets, coverage uploads) in the report.
|
|
103
|
+
- Do not run `cargo hack --feature-powerset` locally; list it in the report
|
|
104
|
+
instead. Never interrupt `cargo hack ... --no-dev-deps` or run it in the
|
|
105
|
+
background: it deletes `[dev-dependencies]` from the manifests while it runs
|
|
106
|
+
and restores them only when it exits normally. If one was interrupted,
|
|
107
|
+
restore the manifests with `git checkout -- '*Cargo.toml'`.
|
|
108
|
+
- When a check fails and the reference file specifies a recovery step (such as
|
|
109
|
+
holding back a regressed compatible release or fixing new MSRV lints), follow
|
|
110
|
+
it; otherwise keep the failure visible and stop to ask.
|
|
111
|
+
- Query current versions, release dates, runner labels and advisories on every
|
|
112
|
+
run. Statements marked "at the time of writing" reflect November 2026:
|
|
113
|
+
re-verify them before acting.
|
|
114
|
+
|
|
115
|
+
## When to upgrade within the declared ranges
|
|
116
|
+
|
|
117
|
+
Check when lockfiles were last updated:
|
|
118
|
+
`git log -10 --format='%cs %s' -- '*Cargo.lock' '*pnpm-lock.yaml'`.
|
|
119
|
+
|
|
120
|
+
Run a compatible upgrade when any of the following applies:
|
|
121
|
+
|
|
122
|
+
- the last compatible upgrade is more than a few weeks old;
|
|
123
|
+
- a compatible release fixes an advisory affecting a locked version, or its
|
|
124
|
+
changelog mentions a security fix;
|
|
125
|
+
- a release that ships the lockfile (a binary, container image or deployed app,
|
|
126
|
+
not a library) is about to be cut; or
|
|
127
|
+
- the user explicitly asked for a compatible upgrade.
|
|
128
|
+
|
|
129
|
+
If none applies, ask before running the compatible upgrade, and still run the
|
|
130
|
+
advisory, MSRV and major-version checks.
|
|
131
|
+
|
|
132
|
+
## Security fixes and the release-age gate
|
|
133
|
+
|
|
134
|
+
The one-day release-age gate protects against compromised releases. It never
|
|
135
|
+
outranks a security fix: a fixed vulnerability that stays locked for a day is
|
|
136
|
+
the bigger risk. A release counts as a security fix when either:
|
|
137
|
+
|
|
138
|
+
- an advisory (RUSTSEC, GHSA, CVE) affecting a locked version names it as the
|
|
139
|
+
fix; or
|
|
140
|
+
- its changelog, release notes or release commit says it fixes a security
|
|
141
|
+
issue, even when no advisory exists yet. Advisories are often published days
|
|
142
|
+
after the release.
|
|
143
|
+
|
|
144
|
+
For every release held back by the gate, read its changelog or release notes
|
|
145
|
+
(`references/changelogs.md`) to find these. Take a security fix right away,
|
|
146
|
+
without waiting for the gate or asking, after auditing its release diff. When
|
|
147
|
+
there is no advisory, the changelog rarely says enough to judge whether the
|
|
148
|
+
issue affects us: assume it does, and quote the changelog line in the commit
|
|
149
|
+
body instead of an advisory ID.
|
|
150
|
+
|
|
151
|
+
## Stop and ask
|
|
152
|
+
|
|
153
|
+
Gather the evidence first, then stop and ask the user when:
|
|
154
|
+
|
|
155
|
+
- a newer version is held back by the MSRV;
|
|
156
|
+
- an applicable advisory has no fix, or its fix requires an override, MSRV bump
|
|
157
|
+
or upstream release;
|
|
158
|
+
- an update introduces an unallowed license, or an install script that must run
|
|
159
|
+
(disabling an unneeded install script does not require approval);
|
|
160
|
+
- a version younger than the one-day release-age gate is needed for anything
|
|
161
|
+
other than an audited security fix ("Security fixes and the release-age
|
|
162
|
+
gate");
|
|
163
|
+
- a major upgrade requires a large migration, or upgrades conflict;
|
|
164
|
+
- a workflow in one of our repositories needs an action not yet mirrored on
|
|
165
|
+
`code.m4ss.net`;
|
|
166
|
+
- aligning a repository with siblings would drop an existing check;
|
|
167
|
+
- the repository loads code from a CDN at build or run time (an `import` or
|
|
168
|
+
`<script src>` from jsDelivr, unpkg or esm.sh, or the URLs under `modules` in
|
|
169
|
+
`project.inlang/settings.json`). That code skips the lockfile and the
|
|
170
|
+
release-age gate: report each URL and the version it loads, and ask before
|
|
171
|
+
changing it;
|
|
172
|
+
- any action would push, publish or delete.
|
|
173
|
+
|
|
174
|
+
**Malicious release:** If an advisory, diff or trust check indicates a malicious
|
|
175
|
+
or compromised package, stop all builds/installs immediately and report to the
|
|
176
|
+
user.
|
|
177
|
+
|
|
178
|
+
**Non-interactive runs:** If the user is unavailable to answer, complete the
|
|
179
|
+
independent work, leave blocked items untouched, and place the blocking
|
|
180
|
+
questions at the top of the report.
|
|
181
|
+
|
|
182
|
+
## Commit subjects
|
|
183
|
+
|
|
184
|
+
The repository's own commit history takes precedence (per the `commit` skill).
|
|
185
|
+
Otherwise use these subjects. Anything in `<>`, and `NN`, `N`, `P`, `X.Y`
|
|
186
|
+
and `YYYY`, is a placeholder to fill in. Rows with concrete names (an action,
|
|
187
|
+
an image, a version, `RustCrypto`) are examples: keep the shape and put in the
|
|
188
|
+
names and versions of the actual change.
|
|
189
|
+
|
|
190
|
+
| Change | Subject |
|
|
191
|
+
| ----------------------------------------- | --------------------------------------------------------------- |
|
|
192
|
+
| MSRV bump, library published to crates.io | `build!: bump MSRV to v1.NN` |
|
|
193
|
+
| MSRV bump, binary-only or unpublished | `build: bump MSRV to v1.NN` |
|
|
194
|
+
| Lints enabled by the MSRV bump | `style(clippy): fix warnings enabled by the MSRV bump` |
|
|
195
|
+
| Rust dependencies within declared ranges | `build(deps): upgrade semver compatible Rust dependencies` |
|
|
196
|
+
| Node dependencies within declared ranges | `build(deps): upgrade semver compatible Node dependencies` |
|
|
197
|
+
| Single major upgrade | `build(deps): upgrade <name> to v<major>` |
|
|
198
|
+
| Version younger than a day (security fix) | `build(deps): upgrade <name> to v<version>` |
|
|
199
|
+
| Coupled major upgrades | `build(deps): upgrade <a> and <b> to v<major>` |
|
|
200
|
+
| Family of coupled crates | `build(deps): upgrade RustCrypto dependencies` |
|
|
201
|
+
| Ignore an inapplicable advisory | `build(deps): ignore RUSTSEC-YYYY-NNNN` |
|
|
202
|
+
| Allow a license in `deny.toml` | `build(deps): allow the <license> license` |
|
|
203
|
+
| `deny.toml` targets fixed to match CI | `build(deps): check the targets CI builds in cargo-deny` |
|
|
204
|
+
| Pinned Rust toolchain in CI | `chore(ci): upgrade Rust to v1.NN.P` |
|
|
205
|
+
| Single pinned action | `chore(ci): upgrade actions/checkout to v7.0.1` |
|
|
206
|
+
| Routine refresh of pinned actions | `chore(ci): upgrade the pinned actions` |
|
|
207
|
+
| Runner image | `chore(ci): run on Ubuntu 26.04` |
|
|
208
|
+
| Full image names in a Containerfile | `build(docker): use fully qualified image names` |
|
|
209
|
+
| Floating image tag pinned, same digest | `build(docker): pin Postgres to v19.0` |
|
|
210
|
+
| Rust image in a Containerfile | `build(docker): upgrade Rust to v1.NN` |
|
|
211
|
+
| Alpine image, with the Rust in its tag | `build(docker): upgrade Alpine Linux to v3.NN / Rust to v1.NN` |
|
|
212
|
+
| Debian image | `build(docker): upgrade Debian to Trixie` |
|
|
213
|
+
| Node.js or another image | `build(docker): upgrade Node.js to v26` |
|
|
214
|
+
| Toolchains in `Actions/ci-images` | `ci: bump Rust to 1.NN.P, Node.js to 24.X.Y and pnpm to 12.X.Y` |
|
|
215
|
+
|
|
216
|
+
- For `Actions/ci-images`, name only the toolchains that changed, in the order
|
|
217
|
+
Rust, Node.js, Go, pnpm.
|
|
218
|
+
- `<major>` is the compatibility-defining prefix: `v0.23` for `0.23.x`, `v2`
|
|
219
|
+
for `2.x`.
|
|
220
|
+
- Mark a major upgrade with `!` (`build(deps)!: ...`) and explain what breaks in
|
|
221
|
+
the body when the project publishes a library to crates.io or npm and the
|
|
222
|
+
upgraded dependency is part of its public API (re-exported, or used in public
|
|
223
|
+
types/traits). Unpublished crates (`publish = false`, `"private": true`) and
|
|
224
|
+
binary-only crates do not take `!`, for major upgrades or MSRV bumps. For
|
|
225
|
+
dependency upgrades and MSRV bumps, this rule decides what counts as breaking,
|
|
226
|
+
over the `commit` skill's general `!` rule.
|
|
227
|
+
- Check `git log -- .github .forgejo` for whether the repository uses `ci:` or
|
|
228
|
+
`chore(ci):`.
|
|
229
|
+
- Write prose commit bodies wrapped at 72 columns that explain _why_ and _what
|
|
230
|
+
changed for us_ (`references/changelogs.md`), rather than listing version
|
|
231
|
+
numbers already visible in the lockfile diff.
|
|
232
|
+
|
|
233
|
+
## Report
|
|
234
|
+
|
|
235
|
+
End the run with a report covering:
|
|
236
|
+
|
|
237
|
+
- commits created since `<base>`: short hash, subject and a one-line summary;
|
|
238
|
+
- decisions waiting on the user, with the gathered evidence;
|
|
239
|
+
- crates flagged as unmaintained, with the alternatives the advisory lists
|
|
240
|
+
(replacing one is the user's call);
|
|
241
|
+
- items deliberately left unchanged: skipped majors, ignored advisories, active
|
|
242
|
+
release-age exceptions, versions held back by the MSRV, and standing holds
|
|
243
|
+
(`[patch]`, `=` pins, overrides), each with its reason;
|
|
244
|
+
- CI gaps noticed during the run, even when no CI audit was requested (for
|
|
245
|
+
example, no MSRV job for a library published to crates.io or npm, or
|
|
246
|
+
`cargo-deny` run without `--workspace`);
|
|
247
|
+
- new duplicate crate versions introduced by the run, the offending crates, and
|
|
248
|
+
each offender's upstream status;
|
|
249
|
+
- in our repositories: drift aligned with siblings, and any sibling repositories
|
|
250
|
+
that need a shared fix made here;
|
|
251
|
+
- upstream APIs worth adopting in a follow-up.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Reviewing an upgrade
|
|
2
|
+
|
|
3
|
+
Review every major upgrade and every `<1`-day release-age security exception
|
|
4
|
+
(with or without an advisory) against the version locked immediately before this
|
|
5
|
+
upgrade (i.e., after the compatible-upgrade commit).
|
|
6
|
+
|
|
7
|
+
## 1. Find local usage
|
|
8
|
+
|
|
9
|
+
Identify how the repository uses the dependency before reading upstream changes:
|
|
10
|
+
|
|
11
|
+
- **Rust**: Search for paths and imports (`git grep -n -w '<crate_name>'` with
|
|
12
|
+
hyphens converted to underscores, plus any `package = "..."` renames in
|
|
13
|
+
`Cargo.toml`), enabled features
|
|
14
|
+
(`cargo tree -q -e features -i <crate> --workspace --target all --all-features`),
|
|
15
|
+
implemented traits and macros.
|
|
16
|
+
- **Node.js**: Search for imports
|
|
17
|
+
(`git grep -n -E "['\"]<name>(/[^'\"]*)?['\"]"`), config files loading it
|
|
18
|
+
(`vite.config.*`, `svelte.config.*`, `eslint.config.*`,
|
|
19
|
+
`playwright.config.*`), and CLI invocations in `package.json` `scripts`.
|
|
20
|
+
|
|
21
|
+
## 2. Diff the published releases
|
|
22
|
+
|
|
23
|
+
Compare the artifacts published to the registry rather than git tags. Treat all
|
|
24
|
+
code in the release as untrusted until reviewed: read it, and never build,
|
|
25
|
+
install or execute anything from it.
|
|
26
|
+
|
|
27
|
+
### Rust
|
|
28
|
+
|
|
29
|
+
Cargo caches downloaded `.crate` tarballs and extracted sources under
|
|
30
|
+
`${CARGO_HOME:-$HOME/.cargo}/registry`:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
R="${CARGO_HOME:-$HOME/.cargo}/registry"
|
|
34
|
+
ls $R/cache/index.crates.io-*/<crate>-<version>.crate
|
|
35
|
+
ls -d $R/src/index.crates.io-*/<crate>-<version>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Fetch any missing version via Cargo (`cargo fetch` for versions in
|
|
39
|
+
`Cargo.lock`, `cargo info <crate>@<version>` for others). Verify that each
|
|
40
|
+
cached `.crate`'s `sha256sum` matches the `checksum` recorded in `Cargo.lock`
|
|
41
|
+
(or `git show <commit>:Cargo.lock`). Then diff the extracted directories:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
R="${CARGO_HOME:-$HOME/.cargo}/registry"
|
|
45
|
+
git diff --no-index --stat $R/src/index.crates.io-*/<crate>-<old> $R/src/index.crates.io-*/<crate>-<new>
|
|
46
|
+
git diff --no-index $R/src/index.crates.io-*/<crate>-<old> $R/src/index.crates.io-*/<crate>-<new>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Run each block above as one shell call: `$R` does not survive into the next.
|
|
50
|
+
|
|
51
|
+
Inspect all files in the diff, not only `src/`: check `build.rs`, proc-macro
|
|
52
|
+
code, and the normalized `Cargo.toml` (which carries the resolved dependency
|
|
53
|
+
version numbers, features and `rust-version`).
|
|
54
|
+
|
|
55
|
+
### Node.js
|
|
56
|
+
|
|
57
|
+
Use `npm diff` to compare the registry tarballs directly:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
npm diff --diff=<name>@<old> --diff=<name>@<new> --diff-name-only
|
|
61
|
+
npm diff --diff=<name>@<old> --diff=<name>@<new> -- package.json <paths...>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
When a package ships compiled output, inspect `*.d.ts` for API changes and the
|
|
65
|
+
compiled JS for behavior, falling back to the upstream source repository
|
|
66
|
+
("Read the changelog and migration guide", source 2) when compiled code is
|
|
67
|
+
unreadable.
|
|
68
|
+
|
|
69
|
+
### What to check in the diff
|
|
70
|
+
|
|
71
|
+
- Removed or modified public items we call, and changed defaults, error returns
|
|
72
|
+
or panics.
|
|
73
|
+
- Feature flag changes (Rust) or `exports`, entry points, ESM/CJS changes,
|
|
74
|
+
`engines` and `peerDependencies` (Node.js).
|
|
75
|
+
- Higher `rust-version` or Node.js requirements.
|
|
76
|
+
- New dependencies, or changes to `build.rs`, proc-macros or npm install
|
|
77
|
+
scripts.
|
|
78
|
+
- New upstream APIs that can replace local workarounds, polyfills or
|
|
79
|
+
`FIXME`/`TODO` comments.
|
|
80
|
+
- Deprecations affecting our calls.
|
|
81
|
+
- Supply-chain red flags (`references/node.md` Step 5, or Rust `build.rs` /
|
|
82
|
+
proc-macros accessing network, environment variables or files outside the
|
|
83
|
+
build): if found, stop immediately and report to the user.
|
|
84
|
+
|
|
85
|
+
For large diffs, start with `--stat` and the files touching our usage, then
|
|
86
|
+
skim the rest for supply-chain changes.
|
|
87
|
+
|
|
88
|
+
## 3. Read the changelog and migration guide
|
|
89
|
+
|
|
90
|
+
Read every release entry after the currently locked version up to and including
|
|
91
|
+
the target version. Check sources in this order and stop at the first source
|
|
92
|
+
that covers the target version:
|
|
93
|
+
|
|
94
|
+
First save a filename filter matching standard changelog names, including
|
|
95
|
+
versioned ones such as `CHANGELOG-0.9.md` or `changes_v2.x.rst`, to a file in
|
|
96
|
+
`<scratch>` (a shell variable would not survive into the next command):
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
cat > <scratch>/changelog-filter.txt <<'EOF'
|
|
100
|
+
(^|/)((changelog|changes|history|news|releases|release[-_]?notes)([-_]v?[0-9][0-9.x]*)?(\.(md|rst|txt|adoc))?$|changelog/)
|
|
101
|
+
EOF
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
1. **Published package files**:
|
|
105
|
+
- Rust: the extracted crate from section 2,
|
|
106
|
+
`${CARGO_HOME:-$HOME/.cargo}/registry/src/index.crates.io-*/<crate>-<new>`:
|
|
107
|
+
`(cd <that directory> && find . -type f | grep -i -E -f <scratch>/changelog-filter.txt)`.
|
|
108
|
+
- Node.js: list the files that changed between the two versions with
|
|
109
|
+
`npm diff --diff=<name>@<old> --diff=<name>@<new> --diff-name-only | grep -i -E -f <scratch>/changelog-filter.txt`,
|
|
110
|
+
then read a match with
|
|
111
|
+
`npm diff --diff=<name>@<old> --diff=<name>@<new> -- <path>`. A changelog
|
|
112
|
+
that did not change between the two versions does not show up: if
|
|
113
|
+
nothing matches, try the next source.
|
|
114
|
+
2. **Upstream git repository at the published commit**: Get the repository URL
|
|
115
|
+
(`cargo info <crate>@<version>` or `npm view <name>@<version> repository.url`)
|
|
116
|
+
and commit SHA (`git.sha1` in `.cargo_vcs_info.json`, or
|
|
117
|
+
`npm view <name>@<version> gitHead` / provenance attestation):
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
git clone -q --filter=blob:limit=1m --no-checkout <repository> <scratch>/<name>-repo
|
|
121
|
+
git -C <scratch>/<name>-repo ls-tree -r --name-only <sha> | grep -i -E -f <scratch>/changelog-filter.txt
|
|
122
|
+
git -C <scratch>/<name>-repo show <sha>:<path>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
3. **Forge release notes**:
|
|
126
|
+
- GitHub:
|
|
127
|
+
`curl -sS 'https://api.github.com/repos/<owner>/<repo>/releases?per_page=100' | jq -r '.[] | [.tag_name, .published_at] | @tsv'`,
|
|
128
|
+
then fetch `.body` from `.../releases/tags/<tag>`.
|
|
129
|
+
- Forgejo / Gitea / Codeberg: `GET /api/v1/repos/<owner>/<repo>/releases`.
|
|
130
|
+
- GitLab: `GET /api/v4/projects/<url-encoded-path>/releases`.
|
|
131
|
+
- In monorepos, verify the tag (`v1.2.3`, `<name>-v1.2.3`, `<name>@1.2.3`)
|
|
132
|
+
belongs to the target package. If release notes only list PR titles, fetch
|
|
133
|
+
the PRs that touch our usage.
|
|
134
|
+
4. **Fallback (`git log`)**: If no changelog or release notes exist, inspect
|
|
135
|
+
`git log --oneline <old-sha>..<new-sha>` in the clone (scoped with
|
|
136
|
+
`-- <subdir>` in a monorepo).
|
|
137
|
+
|
|
138
|
+
Also read any migration guide (`MIGRATION.md`, `UPGRADING.md`, or linked docs).
|
|
139
|
+
Trust the published release diff over the changelog whenever they disagree or
|
|
140
|
+
when the changelog omits changes.
|
|
141
|
+
|
|
142
|
+
## 4. Write the commit body
|
|
143
|
+
|
|
144
|
+
Summarize only what affects this repository, wrapped at 72 columns:
|
|
145
|
+
|
|
146
|
+
- breaking changes encountered and how our code was adapted;
|
|
147
|
+
- behavior or default changes in APIs we call (even if no code edit was needed);
|
|
148
|
+
- new requirements (MSRV, Node.js version, features, peer dependencies);
|
|
149
|
+
- new upstream APIs adopted now or noted for follow-up;
|
|
150
|
+
- relevant bug or security fixes.
|
|
151
|
+
|
|
152
|
+
Omit upstream changes to features or APIs this repository does not use. If
|
|
153
|
+
nothing in the upgrade affects our usage, state that in one sentence so
|
|
154
|
+
reviewers know the diff was audited:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
build(deps): upgrade quux to v0.9
|
|
158
|
+
|
|
159
|
+
`Parser::new` now takes the options by value, and `Parser::feed` returns
|
|
160
|
+
the number of bytes it consumed, so the reader loop no longer tracks the
|
|
161
|
+
offset itself. Unknown elements are now an error by default; we keep
|
|
162
|
+
the previous behavior with `Options::lenient`. 0.9 also adds
|
|
163
|
+
`Parser::reset`, which replaces the parser we rebuilt for every message.
|
|
164
|
+
```
|