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 incorrect dependent updates on none changesets with updateInternalDependents: "always" #949

Merged
merged 9 commits into from
Sep 19, 2022

Conversation

BPScott
Copy link
Contributor

@BPScott BPScott commented Sep 17, 2022

This PR adds a pair of failing tests, showcasing the issue described in #947.

When updateInternalDependents:'always' is set then transitive dependencies of devDependencies should not be part of the release plan, howevever they currently are.

I believe the root cause of this issue is somewhere around this logic. There needs to be some way of stripping out dependencies of devDependencies from the release plan. I've tried and failed to work out how to do that with small adjustments, but I hope these tests can serve as a useful starting point for an actual fix.


UPDATE: fixes #947

Test that when `updateInternalDependents:'always'` is set then
transitive dependencies of devDependencies should not be part of the
release plan.
@changeset-bot
Copy link

changeset-bot bot commented Sep 17, 2022

🦋 Changeset detected

Latest commit: f344afb

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

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

codesandbox-ci bot commented Sep 17, 2022

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 f344afb:

Sandbox Source
Vanilla Configuration

Comment on lines 1097 to 1105
expect(getPkgJSON("pkg-c", spy.mock.calls)).toEqual(
expect.objectContaining({
name: "pkg-c",
version: "1.0.0",
dependencies: {
"pkg-b": "1.0.0",
},
})
);
Copy link
Member

Choose a reason for hiding this comment

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

Correct me if I'm wrong but this one should not be part of the valid expectation, right? In this situation the pkg-c should be left untouched

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're correct - pkg-c's package.json should be untouched. I didn't spot that getPkgJSON behaves in the same way as getChangelog and throws an error if it wasn't touched.

@Andarist
Copy link
Member

I've pushed out a fix for this here - still need to recheck some other things though before I can land this.

@Andarist Andarist changed the title Add tests for updateInternalDependents:'always' incorrectly handling devDependencies Fixed an issue with incorrect dependent updates on none changesets with updateInternalDependents: "always" Sep 18, 2022
@Andarist Andarist requested a review from emmatown September 18, 2022 16:53
@BPScott
Copy link
Contributor Author

BPScott commented Sep 18, 2022

Fixes and extra tests all look good to me. Thank you for taking this over @Andarist!

@Andarist Andarist merged commit 64585ea into changesets:main Sep 19, 2022
@github-actions github-actions bot mentioned this pull request Sep 19, 2022
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.

updateInternalDependents incorrectly updates version of transitive devDependencies
2 participants