Skip to content

A release push also publishes a dev build - #241

Merged
wmadden-electric merged 1 commit into
mainfrom
claude/composer-dev-tag-staleness-943d54
Aug 18, 2026
Merged

A release push also publishes a dev build#241
wmadden-electric merged 1 commit into
mainfrom
claude/composer-dev-tag-staleness-943d54

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

Problem

The publish workflow treated a push to main as either a dev publish or a release — never both. The commit that ships a release therefore never reached the dev dist-tag, and dev sat on a build of the previous base until the next routine push. This bit twice: after 0.7.0, dev stayed on 0.6.0-dev.23 for a day; after 0.8.0, the stale dev tag still peered the broken @prisma/cli-engine@0.1.1 and blocked prisma-cli's 8.0.0-rc.5 publish. Design brief: prisma-cli#194; reference restructure: prisma-cli#195.

Change

  • planPushPublish (new, pure, in determine-version-utils.ts, tested): plans the publish for a push. On a release bump it returns the release version under latest plus a devVersion (<base>-dev.N, continuing the registry counter — so a rerun after a partial failure advances rather than collides).
  • determine-version.ts now emits a third output, devVersion — empty on every event except a release push.
  • publish.yml appends a dev follow-up after the release steps, each step conditioned on devVersion != '': re-stamp with set-version.ts, rebuild, re-run check:publish-deps (the only version-sensitive check; the release steps already ran the full battery against this commit), publish with --tag dev, and create the lightweight v<devVersion> git tag.

Dispatch semantics and the latest leg are unchanged. OIDC trusted publishing is respected — the dev build is a real npm publish, not a dist-tag add.

Invariant delivered: every push to main leaves the dev dist-tag pointing at a build of that same commit.

Validation

  • pnpm test:scripts: 169 pass, including 5 new planPushPublish cases.
  • actionlint on publish.yml: clean.
  • Local smoke run of determine-version.ts for both push shapes (release bump → version=0.8.0, tag=latest, devVersion=0.8.0-dev.2; routine push → version=0.8.0-dev.2, tag=dev, devVersion= empty).
  • Dry-run workflow_dispatch from this branch: run linked in comments below.

Note for the merger

Merging this PR will itself publish a dev build (0.8.0-dev.N) — that push is the fix's first live proof for the routine-push leg. The release leg proves out at the next release. After the next release merge, verify with npm view @prisma/composer-cli dist-tags: dev must be on a -dev.N of the released base.

Also closes out two prisma-cli deferred.md entries: the dev-tag-parity entry (this PR), and "Composer should drop its isCI answer" is stale — composer already dropped it.

🤖 Generated with Claude Code

A push that bumps the root version used to publish only `<base>` under
`latest`, so the release commit never reached the `dev` dist-tag. `dev`
then sat on a build of the previous base until the next routine push;
after 0.8.0 the stale tag still peered the broken @prisma/cli-engine@0.1.1
and blocked a prisma-cli release publish.

determine-version.ts now plans the push publish through a pure
planPushPublish helper that, on a release bump, also emits a devVersion
output (`<base>-dev.N`, continuing the registry counter). The workflow
gains a dev follow-up after the release steps: re-stamp with devVersion,
rebuild, re-run check:publish-deps, publish under `dev`, and tag the
commit. The follow-up only runs when devVersion is non-empty, which only
a release push produces; dispatch semantics and the `latest` leg are
unchanged. Every push to main now leaves `dev` on a build of that commit.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a3f650f1-4ce0-4d21-ab9d-5fb1c4351e43


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@prisma/composer@241
npm i https://pkg.pr.new/@prisma/composer-cli@241
npm i https://pkg.pr.new/@prisma/composer-prisma-cloud@241

commit: 28de6fe

@wmadden-electric

Copy link
Copy Markdown
Contributor Author

Dry-run workflow_dispatch from this branch: https://github.com/prisma/composer/actions/runs/32138798894 — succeeded. All shared pipeline steps (determine version, stamp, build, full check battery, publish --dry-run) passed; every dev follow-up step correctly skipped on dispatch, since devVersion is only emitted on release pushes.

@wmadden-electric
wmadden-electric merged commit 4ae4c0d into main Aug 18, 2026
17 checks passed
@wmadden-electric
wmadden-electric deleted the claude/composer-dev-tag-staleness-943d54 branch August 18, 2026 12:56
birhantprkc pushed a commit to birhantprkc/prisma that referenced this pull request Aug 25, 2026
At a glance: after this change, a merged release PR leaves both
dist-tags on the released base —

```
push to main bumping 8.0.0-rc.6 → 8.0.0-rc.7
  publishes 8.0.0-rc.7        under latest   (as before)
  then publishes 8.0.0-rc.7-dev.1 under dev  (new)
```

**Decision:** the dev and release publishes are no longer alternatives.
Every push to `main` publishes a `<base>-dev.N` build under `dev`; a
version-changing push additionally publishes the release under `latest`
first. Adopted from composer's model in prisma/composer#241 (prisma-cli
made the identical change on 2026-08-18).

Previously a release push skipped the dev leg, so `dev` sat on a dev
build of the previous base until the next routine push. That staleness
caused a real outage on 2026-08-25: after 8.0.0-rc.7 released, `dev`
still pointed at `8.0.0-rc.6-dev.1`, whose `@prisma/orm-toolchain` peers
`@prisma/cli-engine@0.2.2` while the CLI ships 0.2.3. prisma-cli's dev
channel builds against this repo's `dev` tag with no fallback, so its
conformance check failed with an engine-pin mismatch and blocked its
release until the tag was moved by hand.

How it works: `determine-version.ts` now emits a third output,
`devVersion`, which is empty except on release pushes. The workflow
gains a "dev follow-up" leg conditioned on it: re-stamp versions to
`<base>-dev.N`, rebuild, re-run the version-sensitive
dependency-specifier check, publish under `dev`, and create the
lightweight `v<version>-dev.N` tag. The release steps already ran the
full check battery against the same commit, so the follow-up repeats
only the check the version stamp affects. Dev suffixes remain ephemeral
CI stamps and are never committed.

One deliberate deviation from composer's step ordering: the follow-up
runs **before** the "Notify prisma-cli" step. That notification triggers
prisma-cli's auto-repin, which builds its dev channel against this
repo's `dev` tag — notifying before the follow-up would re-create the
exact outage at notify time.

The decision logic moved into a pure `planPushPublish` helper in
`determine-version-utils.ts` (mirroring composer's), with unit tests
covering the dev-only path, the release-plus-follow-up path, counter
continuation, and the unreadable-previous-version fallback.
`docs/oss/versioning.md`'s trigger-model and dist-tag sections are
updated to match.

Alternative considered: running the dev leg unconditionally *before* the
release leg. Rejected to match composer's ordering — publishing the
release first means `latest` never waits on the dev leg, and a failure
in the follow-up leaves the release itself intact.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Development builds are now published on every push to `main` under the
`dev` tag.
* Release pushes publish both the stable package and a corresponding
development build.
  * Development version numbering continues correctly across releases.
* Re-running a release publish also restores the associated development
build.

* **Documentation**
* Updated versioning guidance to describe the new publishing behavior
and release process.

* **Tests**
* Added coverage for development-only publishes, releases, version
lookup failures, dry runs, and continued development numbering.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants