Skip to content

ci(publish): notify prisma-cli after a stable publish - #295

Merged
wmadden-electric merged 3 commits into
mainfrom
chore/notify-prisma-cli-on-publish
Sep 14, 2026
Merged

wmadden-electric merged 3 commits into
mainfrom
chore/notify-prisma-cli-on-publish

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

Linked issue

n/a — small change

Summary

prisma-cli's release automation (docs/oss/release-automation.md there) asks each product repository to send a product-published repository_dispatch after a successful publish, so its update-product-versions workflow opens the repin PR immediately. prisma/orm does this; composer did not, so every composer release was only picked up by prisma-cli's daily schedule, or by hand (as with 0.19.0 and 0.20.0 last week).

The new step runs after the GitHub Release on stable publishes only, since the receiver re-reads the registry at the release dist-tag and a dev publish would be a no-op there. It uses the DEPLOY_GITHUB_TOKEN secret this repository already holds (the spec says the same token lives under that name in all three repositories; it needs Contents write on prisma/prisma-cli), skips with a message when the secret is unset, and is continue-on-error, so it can never fail a publish.

Testing performed

  • The workflow file parses as YAML.
  • The step's shape matches prisma/orm's existing "Notify prisma-cli" step and the gh api invocation in prisma-cli's spec verbatim.
  • Not exercised end to end: the dispatch only fires on a real stable publish from main. The next chore(release) merge will show whether the token has the required scope; if it does not, the step logs a 403 and the daily schedule still covers it.

Checklist

  • All commits are signed off (git commit -s) per the DCO. The DCO status check will block merge if any commit is missing a Signed-off-by: trailer.
  • I read CONTRIBUTING.md and the change is scoped to one logical concern.
  • The PR title is a conventional commit (feat, fix, chore, docs, refactor, test, build) — PR titles drive the auto-generated release notes.
  • Tests are updated (n/a: workflow-only change).

Notes for the reviewer

Whether DEPLOY_GITHUB_TOKEN in this repository was created with Contents write on prisma/prisma-cli is not visible from here. If it was only ever set for another purpose, it needs that scope for the dispatch endpoint to accept the call.

🤖 Generated with Claude Code

prisma-cli's release automation asks each product repository to send a
product-published repository_dispatch after publishing, so its
update-product-versions workflow can open the repin PR right away
instead of waiting for the daily schedule. The ORM repository already
does this; composer did not, so every composer release was picked up a
day late unless someone dispatched the workflow by hand.

Stable publishes only: the receiver re-reads the registry at the release
dist-tag, so a dev publish would be a no-op there. Uses the
DEPLOY_GITHUB_TOKEN secret this repository already holds, skips cleanly
when it is unset, and never fails the publish.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@prisma-gizmo

prisma-gizmo Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

✅ Gizmo reviewed cabc2a6 — posted 0 inline comment(s) this pass.

Open findings: 🔴 1 critical

Change walkthrough

This PR makes prisma/composer emit a product-published repository_dispatch to prisma/prisma-cli right after a stable publish, so prisma-cli's update-product-versions workflow can open the repin PR immediately instead of waiting for its daily scheduled run. A follow-up commit on the same step sends the dispatch fields as raw strings (-f instead of -F).

Workflow change (publish.yml:174-192)

  • The new "Notify prisma-cli" step sits directly after the stable GitHub Release step and copies its gating condition (tag == 'latest' and not a dry-run dispatch) verbatim, so it fires on exactly the same publishes that create a Release. Dev publishes and dry-runs are excluded, matching the receiver's behavior of re-reading the registry at the latest dist-tag.
  • The gh api invocation uses gh's documented nested-parameter syntax (client_payload[package], client_payload[version]) to build the dispatch payload, and sends the package/version as literal strings. The -F → -f fix matters: -F is gh's typed-field flag, which treats a @-prefixed value as a filename to read, so -F 'client_payload[package]=@prisma/composer-cli' would have attempted to open a nonexistent prisma/composer-cli file; combined with continue-on-error the failure would have been swallowed and the notification silently skipped on every release. With -f the literal @prisma/composer-cli package name (a real package in this repo) is transmitted as intended.
  • Failure handling matches the PR's intent: the step is continue-on-error, and the run block exits 0 with a message when DEPLOY_GITHUB_TOKEN is unset, so the notify can never break a publish and the daily schedule in prisma-cli remains the fallback.

Repository fit

  • publish.yml is the only workflow in the repo that writes to the npm registry, so no other publish path needed the same notification.
  • GH_TOKEN + VERSION env style, the steps.version.outputs.* outputs, and the condition expression all mirror the adjacent tag/Release steps, so the change is consistent with how the workflow already solves the "notify GitHub" problem.
  • The one thing not verifiable from the checkout — whether DEPLOY_GITHUB_TOKEN carries Contents write on prisma/prisma-cli — is called out in the PR description, and the step degrades gracefully (403 logged, non-blocking) if it doesn't.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 060c9e49-3758-4aa2-a411-4640d8cfabf9


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

@pkg-pr-new

pkg-pr-new Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: e428583

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: 🔴 1 critical · trace

Comment thread .github/workflows/publish.yml Resolved
gh api -F reads a value that starts with @ from a file, so
'@prisma/composer-cli' failed to parse before any request was made, and
continue-on-error hid it. -f sends the literal string.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: none · trace

Still open from previous reviews: 🔴 1 critical

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Gizmo review threads are resolved and the head commit has been reviewed. Approving.

@wmadden-electric
wmadden-electric merged commit 832b393 into main Sep 14, 2026
28 of 29 checks passed
@wmadden-electric
wmadden-electric deleted the chore/notify-prisma-cli-on-publish branch September 14, 2026 15:15
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.

1 participant