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

Make interlink dependency auto bump logic configurable #358

Merged
merged 6 commits into from
May 11, 2020

Conversation

Blasz
Copy link
Contributor

@Blasz Blasz commented May 8, 2020

Relates to #117 and #189.

We'd like the ability to opt-out of the auto dependency bumping that occurs to min version ranges when two or more packages are released together, specifically in the case where the dependency has only been patch bumped.

This PR includes one way of achieving this via a interLinkAutoBump config option (I couldn't think of a good name, ideas welcome) which specifies the minimum bump type that the auto bumping of inter linked dependencies will apply to. By default it's set to 'patch' which should not change current behaviour of changesets.
I was originally going to add 'major' as an option as well but then decided against it since there isn't a way to specify bumping dependents (#117) and this configuration option doesn't change that.

It's unfortunate that adding a new feature behind a configuration option has resulted in two major releases. In my opinion, the package structure, function signaturres and/or versioning may need a rethink to avoid this going forward.

@changeset-bot
Copy link

changeset-bot bot commented May 8, 2020

🦋 Changeset is good to go

Latest commit: 8573e24

We got this.

This PR includes changesets to release 15 packages
Name Type
@changesets/apply-release-plan Major
@changesets/types Major
@changesets/config Minor
@changesets/cli Minor
@changesets/assemble-release-plan Patch
@changesets/changelog-git Patch
@changesets/changelog-github Patch
@changesets/get-dependents-graph Patch
@changesets/get-release-plan Patch
get-workspaces Patch
@changesets/git Patch
@changesets/parse Patch
@changesets/pre Patch
@changesets/read Patch
@changesets/write 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

@Blasz Blasz requested review from Noviny and lukebatchelor May 8, 2020 07:42
@Noviny
Copy link
Collaborator

Noviny commented May 11, 2020

Some quick thoughts:

I'd add a changeset for the CLI so this becomes available, and tests failed, but otherwise happy with this.

This does up the need for #117

Re: two major versions. This makes sense for those packages, and I don't really mind doing it.

@@ -61,6 +61,8 @@ export type Config = {
linked: Linked;
access: AccessType;
baseBranch: string;
/** Whether to auto bump inter-linked dependencies part of the same release on patch bumps and above (default) or minor bumps and above. */
interLinkAutoBump: "patch" | "minor";
Copy link
Collaborator

Choose a reason for hiding this comment

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

updateInternalDependencies is more clear to me, but I'm not super convinced.

@codecov
Copy link

codecov bot commented May 11, 2020

Codecov Report

Merging #358 into master will increase coverage by 0.11%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #358      +/-   ##
==========================================
+ Coverage   79.85%   79.96%   +0.11%     
==========================================
  Files          40       40              
  Lines        1072     1083      +11     
  Branches      246      247       +1     
==========================================
+ Hits          856      866      +10     
- Misses        206      207       +1     
  Partials       10       10              
Impacted Files Coverage Δ
packages/apply-release-plan/src/version-package.ts 96.29% <87.50%> (-3.71%) ⬇️
packages/apply-release-plan/src/index.ts 92.47% <100.00%> (ø)
packages/config/src/index.ts 98.36% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09f62f9...8573e24. Read the comment docs.

@Noviny Noviny merged commit 2b49d66 into master May 11, 2020
@Noviny Noviny deleted the configurable-interlinked-autobump branch May 11, 2020 03:38
@github-actions github-actions bot mentioned this pull request May 11, 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.

None yet

3 participants