-
Notifications
You must be signed in to change notification settings - Fork 2
Brief: the dev dist-tag must never fall behind latest
#194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wmadden-electric
wants to merge
3
commits into
main
Choose a base branch
from
claude/dev-tag-parity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
.drive/projects/prisma-cli-v8/assets/briefs/dev-tag-parity-handover.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Handover brief — the `dev` dist-tag must never fall behind `latest` | ||
|
|
||
| For the agents working in `prisma/composer` and `prisma/prisma`. Small, self-contained, one step in each publish workflow. | ||
|
|
||
| ## The defect | ||
|
|
||
| A release publish moves `latest` (or `next`) and leaves the `dev` tag where the last routine push to `main` put it. So immediately after a release, `dev` points at an **older** version than `latest`: | ||
|
|
||
| ```console | ||
| $ npm view @prisma/composer-cli dist-tags | ||
| { latest: '0.7.0', dev: '0.6.0-dev.23' } # dev is older than latest | ||
| ``` | ||
|
|
||
| That is wrong on its own terms: `dev` means "the newest build from `main`", and a release commit is a build of `main`. It stays wrong until someone happens to push another commit. | ||
|
|
||
| `prisma/prisma-cli` has the same defect in its own workflow (`dev` at `8.0.0-rc.2-dev.51` while `next` is at `8.0.0-rc.3`) and is fixing it the same way. | ||
|
|
||
| ## Why it matters to us specifically | ||
|
|
||
| `prisma/prisma-cli` follows your `dev` tags to build the CLI's dev channel: a dev build of the CLI depends on your latest dev builds, and a release of the CLI depends on your releases (operator ruling 2026-08-17; `docs/oss/release-automation.md` in prisma-cli). We read the tag and trust it. | ||
|
|
||
| So while your `dev` tag lags, every dev build of the CLI **regresses** to an older version of your product than the released CLI carries. It does not fail any check — a dev build depending on dev builds is exactly what that channel is for — it just quietly tests older code than the release does, which is the opposite of what a dev channel is for. | ||
|
|
||
| We are deliberately not working around it in prisma-cli by comparing versions and picking the newer tag. The tag should be right. | ||
|
|
||
| ## The fix | ||
|
|
||
| Publish a dev build of the release commit too. A release commit is a build of `main`, so it gets a dev version like any other build of `main`: after the release publish succeeds, publish the same tree again as `<version>-dev.<run>`, explicitly tagged: | ||
|
|
||
| ```bash | ||
| npm publish --tag dev | ||
| ``` | ||
|
|
||
| The tag is not optional. Without it npm publishes to `latest`, which would put a dev build in front of every consumer. | ||
|
|
||
| **Do not try to move the tag with `npm dist-tag add`.** If you publish over npm OIDC trusted publishing, that will not work: npm's documentation states that OIDC authentication supports `npm publish` and `npm stage publish` only, and that other commands still require traditional authentication. A dist-tag change is one of those. Reaching for a long-lived npm token to work around it would give up the property that makes trusted publishing worth having — that no credential exists which could publish out-of-band if leaked. Publishing a second version needs no new credential, because it goes through the same `npm publish` path that already works. | ||
|
|
||
| The version this produces sorts above the release under semver (`8.0.0-rc.4-dev.55` > `8.0.0-rc.4`), which is correct: it is a later build of the same code. | ||
|
|
||
| The cost is one extra published version per release. That is the price of the `dev` tag meaning what it says. | ||
|
|
||
| ## How to know it worked | ||
|
|
||
| After the next release, for every published package: | ||
|
|
||
| ```bash | ||
| npm view <package> dist-tags | ||
| ``` | ||
|
|
||
| `dev` should name the dev build of the release commit, and never an older version than the release tag. Assert it in the workflow rather than checking by eye — the failure is silent otherwise: | ||
|
|
||
| ```bash | ||
| npm view <package> dist-tags --json | ||
| ``` | ||
|
|
||
| The pair to expect after releasing `8.0.0-rc.4` is `latest: 8.0.0-rc.4` (or `next:`, per your convention) and `dev: 8.0.0-rc.4-dev.<run>`. Note that the dev version sorts *above* the release under semver, because a longer pre-release with an alphanumeric identifier ranks higher: `8.0.0-rc.4` < `8.0.0-rc.4-dev.55`. That is the ordering you want, and it is worth checking your assertion agrees with it rather than assuming string comparison does the right thing. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.