Skip to content

Fixes publish and dist-tag scripts.#18219

Merged
alan-agius4 merged 6 commits into
angular:masterfrom
dgp1130:publish
Jul 23, 2020
Merged

Fixes publish and dist-tag scripts.#18219
alan-agius4 merged 6 commits into
angular:masterfrom
dgp1130:publish

Conversation

@dgp1130
Copy link
Copy Markdown
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 clydin and kyliau July 10, 2020 20:52
Comment thread docs/process/release.md Outdated
Comment thread scripts/dist-tag.ts
Comment thread scripts/publish.ts
Comment thread scripts/publish.ts Outdated
@dgp1130
Copy link
Copy Markdown
Collaborator Author

dgp1130 commented Jul 21, 2020

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

dgp1130 added 4 commits July 21, 2020 14:34
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
Copy Markdown
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

Comment thread tests/legacy-cli/e2e/setup/010-local-publish.ts
`--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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

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

@dgp1130
Copy link
Copy Markdown
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
Copy Markdown

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.

5 participants