Skip to content

bugfix: ignore ranges when snapshot versioning is performed (use exact version) - #857

Merged
Andarist merged 4 commits into
changesets:mainfrom
dotansimha:snapshot-exact-fix
Jul 4, 2022
Merged

Andarist merged 4 commits into
changesets:mainfrom
dotansimha:snapshot-exact-fix

Conversation

@dotansimha

Copy link
Copy Markdown
Contributor

Related: #855

@changeset-bot

changeset-bot Bot commented Jun 29, 2022 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0b15dd4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@changesets/cli Patch
@changesets/apply-release-plan Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci

codesandbox-ci Bot commented Jun 29, 2022 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0b15dd4:

Sandbox Source
Vanilla Configuration

@ivanbanov

Copy link
Copy Markdown

uow nice! I've just crossed trough this problem, good timing for me though :)

@dotansimha

Copy link
Copy Markdown
Contributor Author

Thanks for the code review @Andarist . I pushed fixes for all notes :)

@dotansimha
dotansimha requested a review from Andarist July 3, 2022 07:56
Comment thread .changeset/stupid-jars-rest.md Resolved
Comment thread .changeset/stupid-jars-rest.md Resolved
@Andarist
Andarist merged commit 7febb59 into changesets:main Jul 4, 2022
@github-actions github-actions Bot mentioned this pull request Jul 4, 2022
@dotansimha
dotansimha deleted the snapshot-exact-fix branch July 4, 2022 12:45
{
changesets: ["some-id"],
name: "pkg-b",
newVersion: "1.1.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While working on #1008 I've noticed that this test case doesn't reflect how the full thing works in practice. Usually the newVersion should already have the snapshot modifier here. This would be computed here when assembling the release plan:

newVersion: snapshotSuffix
? getSnapshotVersion(
incompleteRelease,
preInfo,
refinedConfig.snapshot.useCalculatedVersion,
snapshotSuffix
)
: getNewVersion(incompleteRelease, preInfo),

This test case still tests that the range modifier gets dropped when snapshot is provided:

let newNewRange = snapshot
? version
: `${getVersionRangeType(depCurrentVersion)}${version}`;

However... this should, sort of, be an impossible setup. Should we validate this anyhow? Should the test case be tweaked to reflect the real usage better?

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