Skip to content
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

Fixed an issue with dependant packages not being updated to their highest bump type in pre mode #446

Merged
merged 3 commits into from
Sep 8, 2020

Conversation

Andarist
Copy link
Member

fixes #442

@Andarist Andarist requested a review from emmatown August 17, 2020 14:02
@changeset-bot
Copy link

changeset-bot bot commented Aug 17, 2020

🦋 Changeset is good to go

Latest commit: 688e9f5

We got this.

This PR includes changesets to release 2 packages
Name Type
@changesets/assemble-release-plan Patch
@changesets/cli 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

@@ -92,9 +92,10 @@ function assembleReleasePlan(
snapshotSuffix = getSnapshotSuffix(snapshot);
}

let packagesByName = new Map(
let initialPackagesByName = new Map(
Copy link
Member Author

Choose a reason for hiding this comment

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

Not the best name for this, but I don't know how to name this better. In general, I've spent a surprisingly long time fixing this issue (tracking it down alone was fairly quick and easy) - there is a lot happening here and some structures are faking data from before entering pre mode which makes this fairly hard to reason about. I would say this implementation is a good candidate for a future refactoring, but would definitely have to be done with care.

@@ -886,6 +886,114 @@ describe("pre", () => {
}
]);
});
it("should use the highest bump type between all prereleases when versioning a dependant package", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure if this makes it super obvious what this test is testing for - not sure how to best call a process of versioning because of a dependency upgrade. Both of those 2 newly added tests cover what got described in a changeset - a situation when we need to upgrade a dependant package only because a dependency got upgraded but when that dependant had already a non-patch bump in the current pre mode.

@Andarist
Copy link
Member Author

Andarist commented Sep 8, 2020

friendly 🏓 @mitchellhamilton @Noviny , I believe this has just caused a problem with the recent Emotion prerelease as well ( emotion-js/emotion#1982 )

@emmatown emmatown merged commit 9d99bd1 into master Sep 8, 2020
@emmatown emmatown deleted the fix/pre-mode-bumping branch September 8, 2020 22:32
@github-actions github-actions bot mentioned this pull request Sep 8, 2020
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.

Prereleases with breaking changes have reverted to their previous version number
2 participants