Temporarily use beta versions for "latest" dist-tag#1283
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Node-based version calculation and publishing workflow so that publishing under the latest dist-tag produces prerelease-style versions (temporarily) to ensure users on latest receive the beta/preview stream prior to 1.0.0.
Changes:
- Update Node version calculation so
latestincrements as a prerelease (and can continue existing prerelease identifiers). - Update Node tests to assert the new
latestprerelease behavior. - Update the publish workflow to allow prerelease versions under
latestand to create GitHub pre-releases for bothlatestandprerelease.
Show a summary per file
| File | Description |
|---|---|
nodejs/test/get-version.test.ts |
Updates expectations for latest to produce prerelease versions during the temporary beta-as-latest period. |
nodejs/scripts/calculate-version.js |
Changes latest version increment behavior to use prerelease increments and treat latest similarly to prerelease for identifier handling. |
.github/workflows/publish.yml |
Loosens version validation for latest and makes latest publishes create GitHub pre-releases during the temporary period. |
Copilot's findings
Comments suppressed due to low confidence (1)
.github/workflows/publish.yml:231
needs.version.outputs.current-prereleaseis not a valid GitHub Actions expression property access because the output name contains a hyphen. This will be parsed as subtraction and will likely makeNOTES_FLAGempty/incorrect (or fail) when creating the release.
Use bracket notation (e.g., needs.version.outputs['current-prerelease']) or rename the job output key to something without - (e.g., current_prerelease) and update references accordingly.
NOTES_FLAG=""
if git rev-parse "v${{ needs.version.outputs.current-prerelease }}" >/dev/null 2>&1; then
NOTES_FLAG="--notes-start-tag v${{ needs.version.outputs.current-prerelease }}"
fi
- Files reviewed: 3/3 changed files
- Comments generated: 1
Comment on lines
+46
to
55
| // TEMPORARY: "latest" uses prerelease increments so we publish beta versions | ||
| // under the "latest" dist-tag. To ship stable 1.0.0, revert the commit that | ||
| // introduced this temporary change. | ||
| const increment = "prerelease"; | ||
| const isIncrementingExistingPrerelease = semver.prerelease(higherVersion) !== null; | ||
| const prereleaseIdentifier = | ||
| command === "prerelease" | ||
| command === "prerelease" || command === "latest" | ||
| ? isIncrementingExistingPrerelease | ||
| ? undefined | ||
| : "preview" |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We've been using the
latestdist-tag for prior versions like 0.3.0. But since we started shipping beta versions, all the releases have been marked as prerelease, so 0.3.0 was still the currentlatest.This risks people staying on 0.3.0 and not updating to the betas.
So, until 1.0.0 ships, this PR changes the version number calculation logic so that even
latestreleases get beta version numbers. We should uselatestfor any publish that we really want people to use, which is likely all of them.Once 1.0.0 ships, we'll go back to the logic that puts suffixes like
-preview.1onto prereleases and no suffixes for latest/stable releases.