-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improve npm publishing infra #7287
Improve npm publishing infra #7287
Conversation
@@ -19,7 +19,7 @@ packages: | |||
'@tensorflow/**': | |||
access: $all | |||
publish: $all | |||
# Don't set proxy to avoid accidentally publishing to npm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be possible without an OTP, so it's okay to set proxy to npm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this statement is incorrect, the proxy
property does not allow publishing on npmjs, in fact only works in one way, from npmjs to your local cache. If you set proxy: npmjs
what is gonna happens is when you publish a package that match @tensorflow/**
will ask first npmjs if already exist there or not, if you are publishing a snapshot with a random version probably will goes through allow yo to publish otherwise you will have 409 publish conflict. That's the unique thing the proxy does, but never never verdaccio publish on npmjs, this never happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification. I was wondering if this comment was correct, and I couldn't find any description of this publishing behavior in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I'll try to highlight it better 👍🏼
@@ -25,108 +25,150 @@ | |||
import * as argparse from 'argparse'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: Just review this as a new file. It shares very little logic with the previous implementation.
It may be worth writing tests for some parts of this PR, but we don't have any tests for our |
Nightly tests run with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @Linchenn and @mattsoulanille)
scripts/publish-npm.ts
line 86 at r2 (raw file):
}); parser.addArgument(['--auto', '--guess-version'], {
the argument name does not seem to match the description, maybe auto-publish-local-newer
?
scripts/publish-npm.ts
line 180 at r2 (raw file):
run(`${login}yarn --registry '${registry}' publish-npm ${dashes} ${otpFlag} --tag=${tag} --force`)); } else { if (registry === NPM_REGISTRY && pkg.startsWith('tfjs-node')) {
should this be done after the publish is succeeded?
scripts/release-util.ts
line 229 at r1 (raw file):
/** * A wrapper around shell.exec for readability. * @param cmd The bash commaond to execute.
command
scripts/release-util.ts
line 243 at r1 (raw file):
export function $async(cmd: string, env: Record<string, string> = {}): Promise<string> {
are there tabs on this line?
scripts/release-util.ts
line 488 at r1 (raw file):
* Get the next minor update version for the given version. * * i.e. given a.b.c, return a.b+1.0
a.b + 0.1.0 ?
e2e/scripts/local-registry.sh
line 34 at r1 (raw file):
# Set registry to local registry #npm set registry "$custom_registry_url"
remove these commented out lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @Linchenn and @pyu10055)
scripts/publish-npm.ts
line 86 at r2 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
the argument name does not seem to match the description, maybe
auto-publish-local-newer
?
Done.
scripts/publish-npm.ts
line 180 at r2 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
should this be done after the publish is succeeded?
Good point. Done.
scripts/release-util.ts
line 229 at r1 (raw file):
command
I'm not sure what you mean. I think the @param matches the argument name.
scripts/release-util.ts
line 243 at r1 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
are there tabs on this line?
Not sure how that happened. Fixed.
scripts/release-util.ts
line 488 at r1 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
a.b + 0.1.0 ?
This is saying the first part of the new version is a
, the second part is b+1
, and the third part is 0
, so a . b+1 . 0
. I replaced it with an example, which should be more clear.
e2e/scripts/local-registry.sh
line 34 at r1 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
remove these commented out lines?
I don't see them in the diff on github.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 10 files at r1, 2 of 4 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @Linchenn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Sorry for the late review.
Nightly tests 4 (hopefully these don't have any weird connection issues like the last ones) |
The current npm publishing infra is more manual than necessary. This PR makes the following improvements:
yarn publish-npm
multiple times.A future PR will move our nightly verdaccio e2e tests to use this infra, which will allow us to avoid setting the npm registry globally. This will let us run verdaccio tests in parallel with the rest of nightly tests, which should reduce the time taken.
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.
This change is