Skip to content

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Aug 4, 2022

When the tool generates a release spec, it will list all packages that
have changed since their last release. Editing the release spec to
remove a package so that it is no longer included in the release is
potentially dangerous, because it means that any package which relies on
that package that is included in the release could be broken in
production.

Since it's sometimes necessary to delay the release of a package, this
commit changes the release spec validation step such that if it detects
that a package that should be listed in the release spec isn't, it
will throw an error, advising the user of the danger, yet provide a
hidden option should the user really want to proceed.


Fixes #10.

@mcmire mcmire requested a review from a team as a code owner August 4, 2022 21:47
}

const errors: { message: string | string[]; lineNumber: number }[] = [];
const errors: { message: string | string[]; lineNumber?: number }[] = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have plans to refactor this function as I know it's getting a bit out of hand. Sorry that this is hard to read in the meantime.

@mcmire mcmire marked this pull request as draft August 5, 2022 03:47
@mcmire mcmire force-pushed the only-list-changed-packages branch from 6c124d0 to 34ccbf1 Compare September 8, 2022 22:07
@mcmire mcmire force-pushed the restrict-to-changed-packages branch from 0ba3ffd to 68165a3 Compare September 8, 2022 22:24
@mcmire
Copy link
Contributor Author

mcmire commented Sep 8, 2022

Rebased!

@mcmire mcmire force-pushed the only-list-changed-packages branch 2 times, most recently from 3b55821 to 00b7396 Compare September 22, 2022 20:28
Base automatically changed from only-list-changed-packages to main September 30, 2022 22:27
When the tool generates a release spec, it will list all packages that
have changed since their last release. Editing the release spec to
remove a package so that it is no longer included in the release is
potentially dangerous, because it means that any package which relies on
that package that *is* included in the release could be broken in
production.

Since it's sometimes necessary to delay the release of a package, this
commit changes the release spec validation step such that if it detects
that a package that should be listed in the release spec *isn't*, it
will throw an error, advising the user of the danger, yet provide a
hidden option should the user really want to proceed.
@mcmire mcmire force-pushed the restrict-to-changed-packages branch from 68165a3 to 6bf8b36 Compare September 30, 2022 22:30
@mcmire
Copy link
Contributor Author

mcmire commented Sep 30, 2022

Rebased again.

@mcmire mcmire marked this pull request as ready for review September 30, 2022 22:34
Gudahtt
Gudahtt previously approved these changes Oct 4, 2022
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM! Just a couple of questions, and one suggested additional test.

@Gudahtt
Copy link
Member

Gudahtt commented Oct 4, 2022

The hidden "intentionally-skip" flag seems like a great idea. It's well documented, but only in the case you run into it. Good compromise for something we want to discourage.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@mcmire mcmire merged commit db188f1 into main Oct 5, 2022
@mcmire mcmire deleted the restrict-to-changed-packages branch October 5, 2022 17:52
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.

Monorepo flow: Warn the user if any packages in the release spec fall outside the set of changed packages

2 participants