Improve pre-flight npm access checks - #80334
Conversation
jsnajdr
left a comment
There was a problem hiding this comment.
OK, I'm a bit curious how long it will take to run npm access in loop for 140 packages 🙂
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @myexampl35-dotcom. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.76 MB |
That did come to mind. 😅 I ran some testing locally. Across 50 runs of Another option is to check only the first package, or maybe the first 5 if there's a desire to validate multiple packages. I'm curious what @ciampo prefers given he can speak best to the original intention of these pre-flight checks. |
|
Flaky tests detected in 68ae21e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29447226898
|
|
As also mentioned in Slack, we could drop the npm access check and only keep The npm access command also kind of contradicts the fact that we pass We can keep the |
|
My preference would be to just check |
myexampl35-dotcom
left a comment
There was a problem hiding this comment.
tools/release/commands/packages.js
|
I implemented the |
|
Thanks @jsnajdr! No objections here. |
|
I just cherry-picked this PR to the release/23.7 branch to get it included in the next release: de2e2d7 |
* Improve pre-flight npm access checks. * use npm whoami for simplicity --------- Co-authored-by: desrosj <desrosj@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
What?
This removes the use of
npm access list packages @wordpresscall in favor ofnpm access list collaborators <package-name>.Follow-up to #79904.
Why?
npm access list packagesrequires the current user or token to possess organization-level read access, which cannot be assigned to organization members (only administrators).npm access list collaborators <package-name>does not require any org-level access and even works for unauthenticated users.When combined with
npm whoami, this effectively replaces the need for any organization privileges to be assigned to a token.This also expands the pre-flight checks to confirm that the user has the required permissions to publish every dependency that will be published as a part of running the publish command.
Use of AI Tools
Claude Code was used to create the initial PR.