Skip to content

feat(ci): allow custom preview_name for preview publishes - #5632

Merged
abcxff merged 1 commit into
mainfrom
stack/feat-ci-allow-custom-preview_name-for-preview-publishes-ouzuxyom
Sep 3, 2026
Merged

feat(ci): allow custom preview_name for preview publishes#5632
abcxff merged 1 commit into
mainfrom
stack/feat-ci-allow-custom-preview_name-for-preview-publishes-ouzuxyom

Conversation

@abcxff

@abcxff abcxff commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@abcxff

abcxff commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Stack for rivet-dev/actors

Get stack: forklift get 5632
Push local edits: forklift submit
Merge when ready: forklift merge 5632

change ouzuxyom

@railway-app
railway-app Bot temporarily deployed to rivet-frontend / actors-pr-5632 September 2, 2026 00:11 Destroyed
@railway-app

railway-app Bot commented Sep 2, 2026

Copy link
Copy Markdown

🚅 Deployed to the actors-pr-5632 environment in rivet-frontend

Service Status Web Updated
website ❌ Build Failed (View Logs) Web Sep 3, 2026 at 4:47 pm UTC
kitchen-sink 😴 Sleeping (View Logs) Web Sep 2, 2026 at 12:24 am UTC
frontend-cloud 😴 Sleeping (View Logs) Web Sep 2, 2026 at 12:20 am UTC
frontend-inspector 😴 Sleeping (View Logs) Web Sep 2, 2026 at 12:19 am UTC
mcp-hub ✅ Success (View Logs) Web Sep 2, 2026 at 12:12 am UTC
ladle ✅ Success (View Logs) Web Sep 2, 2026 at 12:12 am UTC

@claude

claude Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review

Small, well-scoped CI script change: adds an optional preview_name workflow input that overrides the branch-derived label used for the preview version string and npm dist-tag.

Code quality / correctness

  • The implementation is clean: label cleanly substitutes for branch only in the two places that need it (computeVersion, computeNpmTag), while ctx.branch is preserved unchanged for diagnostics/logging. Good separation.
  • trigger === "branch" && previewName correctly gates the override so preview_name is a no-op on release, matching the description string ("Ignored on release") and the comments stated invariant that it never flips the trigger.
  • Both the CLI flag (--preview-name) and the GITHUB_EVENT_PATH input path are wired consistently with how branch/targets already work, so local/dry-run invocation and the actual workflow_dispatch path behave the same.
  • Comment style follows CLAUDE.md conventions (full sentences, no dashes).

Security

  • No injection risk: previewName flows into the version string and npm dist-tag only through sanitizeBranch, which restricts to [a-z0-9-], so no untrusted characters reach npm publish/dist-tag shell invocations.

Minor nits

  • sanitizeBranchs error message is hardcoded to say branch name "..." sanitized to empty string. If a user passes a preview_name that sanitizes to empty (e.g. all punctuation), the error will misleadingly say "branch name" instead of "preview_name". Not a bug, but could confuse whoever is debugging a bad input. Consider threading a label parameter through for the error message.
  • No test coverage added, but this matches the pre-existing state of scripts/publish/src/lib/context.ts there are no unit tests for resolveContext at all today. Given the branching logic here (trigger x override x event-input precedence) is growing, it might be worth a follow-up to add basic unit tests around resolveContext/computeNpmTag/computeVersion, but I would not block this PR on it.

Overall: looks correct and low risk. Nice to have the sanitize error message improvement but not blocking.

@abcxff
abcxff force-pushed the stack/feat-ci-allow-custom-preview_name-for-preview-publishes-ouzuxyom branch from 11b1617 to b070bdb Compare September 3, 2026 16:47
@railway-app
railway-app Bot temporarily deployed to rivet-frontend / actors-pr-5632 September 3, 2026 16:47 Destroyed
@abcxff
abcxff merged commit b070bdb into main Sep 3, 2026
9 of 13 checks passed
@abcxff
abcxff deleted the stack/feat-ci-allow-custom-preview_name-for-preview-publishes-ouzuxyom branch September 3, 2026 16:47
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