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

Fixes publish and dist-tag scripts. #18219

Merged
merged 6 commits into from
Jul 23, 2020
Merged

Conversation

dgp1130
Copy link
Collaborator

@dgp1130 dgp1130 commented Jul 10, 2020

This fixes a few known bugs in publish and dist-tag, as well as a few new ones I found along the way.

Ideally this would have been at least two distinct PRs, but they touched each other when it relates to registries in a way that would have been a pain with multiple PRs.

@dgp1130 dgp1130 added target: patch This PR is targeted for the next patch release target: lts This PR is targeting a version currently in long-term support labels Jul 10, 2020
@dgp1130 dgp1130 requested review from kyliau and clydin July 10, 2020 20:52
docs/process/release.md Outdated Show resolved Hide resolved
scripts/dist-tag.ts Show resolved Hide resolved
scripts/publish.ts Show resolved Hide resolved
scripts/publish.ts Outdated Show resolved Hide resolved
@dgp1130
Copy link
Collaborator Author

dgp1130 commented Jul 21, 2020

@clydin, do you want to take a look at this change as well?

Pure refactor that just pulls the Wombat registry into a separate string constant to be re-used across scripts.
We can't guarantee that the user provided these options at compile time, so all options should include `undefined` in their types. This makes the type system a little smarter and hopefully prevent future mistakes. Fortunately we were already doing the right thing, this will make sure we continue to do so in the future.

I opted to use `Partial<DistTagArgs>` so that all future flags would be implicitly forced to be optional. Otherwise, we may forget to make them optional and potentially introduce a bug.
This includes a new `--registry` flag to the `dist-tag` command and defaults it to Wombat. This way NPM commands will explicitly use the correct registry.
Flag arguments provided by minimist are always strings. Both `--branchCheck` and `--versionCheck` failed to take this into account and were incorrectly typed as a result. Now boolean flags are parsed into actual boolean types which can be used more intuitively.
@kyliau
Copy link
Contributor

kyliau commented Jul 21, 2020

@dgp1130, please open separate patch PR for each LTS that you'd like to target. Currently active LTS are v8 and v9

`--tag` now must be explicitly specified rather than defaulting to `latest`. It is also validated to be one of the expected set of tags. There is a new `--tagCheck false` flag that will skip this in order to handle one-off custom tags if necessary in the future.

Apparently NPM requires that all releases have tags (defaulting to `latest` if not explicitly specified), so there is no way to choose **not** to push a new tag. That means that you can't push `10.0.x` and then push `9.0.x` without either using `v9-lts` or clobbering `latest`. The `--tag` requirement should hopefully enforce this restriction to avoid a potential release footgun.
@clydin
Copy link
Member

clydin commented Jul 21, 2020

For the v8 branch, the nullish coalescing will need to be changed. It's still on TS 3.5.

@dgp1130
Copy link
Collaborator Author

dgp1130 commented Jul 21, 2020

Made separate PRs for LTS branches:
9.1.x: #18324
8.3.x: #18323

@dgp1130 dgp1130 removed the target: lts This PR is targeting a version currently in long-term support label Jul 21, 2020
@dgp1130
Copy link
Collaborator Author

dgp1130 commented Jul 21, 2020

@clydin, thanks for pointing out the TS 3.5 issue on v8. Updated that PR to not use ??.

@alan-agius4
Copy link
Collaborator

@dgp1130, seems like the CLA bot status is stalled.

@dgp1130
Copy link
Collaborator Author

dgp1130 commented Jul 22, 2020

@alan-agius4, strange. This PR was stuck on CLA, while the other two were stuck on 'Missing required status "ci/circleci: integration"'. I did an empty amend and force pushed it, so that should re-trigger all the status checks.

@dgp1130 dgp1130 added the action: merge The PR is ready for merge by the caretaker label Jul 22, 2020
@alan-agius4 alan-agius4 merged commit 4938554 into angular:master Jul 23, 2020
@dgp1130 dgp1130 deleted the publish branch July 23, 2020 17:51
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants