Skip to content

fix: dynamically increment prerelease versions in publish.sh#1932

Merged
inlined merged 2 commits into
masterfrom
inlined.fix-publish-prerelease
Jul 21, 2026
Merged

fix: dynamically increment prerelease versions in publish.sh#1932
inlined merged 2 commits into
masterfrom
inlined.fix-publish-prerelease

Conversation

@inlined

@inlined inlined commented Jul 16, 2026

Copy link
Copy Markdown
Member

Description

Fixes an issue in scripts/publish.sh where prerelease publishing (e.g. running with --prerelease) would fail if rc.0 was already published on npm for that target version series, since it always bumped from the stable version. It now dynamically checks npm for any existing prerelease versions of the target version series, and performs a prerelease increment (e.g., to rc.1) if one exists.

Newly assumes the jq command exists to avoid silly node scripts (will need to test in prod or build a new container). Now handles gh not existing since it didn't in the past.

Release Notes

relnote: chore: improve release script

@inlined
inlined force-pushed the inlined.fix-publish-prerelease branch from 3b5481e to e1aa47a Compare July 16, 2026 22:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the prerelease versioning logic in scripts/publish.sh to check npm for existing prerelease versions in the target range and increment them if found, rather than always starting from the stable version. The reviewer noted that parsing the raw output of npm view with tail and grep is fragile and prone to errors due to output formatting variations, sorting assumptions, and a hardcoded regex. They suggested a more robust approach using Node.js and the semver package to parse the JSON output safely.

Comment thread scripts/publish.sh Outdated
@inlined
inlined force-pushed the inlined.fix-publish-prerelease branch 5 times, most recently from 8ebf2f0 to 2a51ea7 Compare July 20, 2026 22:40
Comment thread scripts/publish.sh Outdated
Comment thread scripts/publish.sh
@inlined
inlined force-pushed the inlined.fix-publish-prerelease branch 4 times, most recently from 02c8818 to aa1e63c Compare July 21, 2026 20:35
@wiz-9635d3485b

wiz-9635d3485b Bot commented Jul 21, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 1 High 3 Medium 1 Low 2 Info
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 High 3 Medium 1 Low 2 Info

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@inlined
inlined force-pushed the inlined.fix-publish-prerelease branch from aa1e63c to 1f125ce Compare July 21, 2026 20:38
@inlined
inlined force-pushed the inlined.fix-publish-prerelease branch from 1f125ce to b9b7258 Compare July 21, 2026 21:03
@inlined

inlined commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Running the script as if it were the builder locally using BUILD_ID=test ./scripts/publish.sh (and not using --no-dry-run) now shows the correct prerelease incrementing

@inlined
inlined merged commit c2cd3f7 into master Jul 21, 2026
26 checks passed
@inlined
inlined deleted the inlined.fix-publish-prerelease branch July 21, 2026 21:41
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.

3 participants