-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ci(release): support release/* branches with version-comparison gating #3530
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
Draft
ericallam
wants to merge
4
commits into
main
Choose a base branch
from
chore/release-branch-flow
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.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
dbf4a40
ci(release): support release/* branches with version-comparison gating
ericallam 06136c5
ci(release): combine GITHUB_OUTPUT writes into a single block (SC2129)
ericallam da5dd7a
docs(scripts): add JSDoc to enhance-release-pr.mjs new/changed functions
ericallam 4268187
docs(scripts): JSDoc the remaining functions in enhance-release-pr.mjs
ericallam 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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major: silent npm-view failure can flip a lagged hotfix into
:latest.npm view ... 2>/dev/null || truecollapses transient registry failures (network, 5xx, auth) into the same state as "nolatesttag yet". Combined with the0.0.0default, any hotfix fromrelease/X.Y.xbecomes "newer than current latest" andIS_LATEST=true— which then promotes the hotfix to npmlatest, Docker:v4-beta, and the GitHub "Latest" badge. That's the exact failure mode this whole PR is designed to prevent.The 0.0.0 default is only safe when there genuinely is no
latest(first publish). After the first release, an empty/error response should fail fast or retry rather than fall through to "becomes latest".🛡️ Distinguish "no latest yet" from "npm unreachable"
- name: Compare new version to current latest id: compare run: | set -euo pipefail NEW=$(jq -r '.version' packages/cli-v3/package.json) - CURRENT=$(npm view `@trigger.dev/sdk` dist-tags.latest 2>/dev/null || true) - if [ -z "$CURRENT" ] || [ "$CURRENT" = "undefined" ]; then - CURRENT="0.0.0" - fi + # Retry npm view to ride out transient registry blips. Only fall back + # to 0.0.0 on an explicit "no latest yet" response, never on errors — + # a silent network failure here would incorrectly promote a lagged + # hotfix to :latest / :v4-beta / GitHub "Latest". + for i in 1 2 3; do + if CURRENT=$(npm view `@trigger.dev/sdk` dist-tags.latest 2>&1); then + break + fi + echo "npm view failed (attempt $i): $CURRENT" >&2 + CURRENT="" + sleep $((i * 5)) + done + if [ -z "$CURRENT" ]; then + echo "Error: could not read `@trigger.dev/sdk` dist-tags.latest from npm." >&2 + exit 1 + fi + if [ "$CURRENT" = "undefined" ]; then + # Genuine "no latest dist-tag yet" — first publish. + CURRENT="0.0.0" + fi🤖 Prompt for AI Agents