-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Use verdaccio for the template e2e test #34577
Conversation
d10087b
to
f078bb1
Compare
Base commit: 6529383 |
Base commit: 6529383 |
83a5efe
to
73c56c8
Compare
scripts/run-ci-e2e-tests.js
Outdated
@@ -70,6 +72,25 @@ try { | |||
|
|||
const REACT_NATIVE_PACKAGE = path.join(ROOT, 'react-native-*.tgz'); | |||
|
|||
describe('Verdaccio'); | |||
const verdaccioProcess = child_process.spawn('npx', [ | |||
'verdaccio', |
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 didn't see this added to dependencies, so I think we want to lock the version somehow, you can do it like this:
'verdaccio', | |
'verdaccio@5.15.3', |
scripts/run-ci-e2e-tests.js
Outdated
'yarn', | ||
['start', '--max-workers 1'], | ||
{ | ||
env: process.env, |
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 is the default, so you can delete these options afaik
.circleci/verdaccio/config.yml
Outdated
keepAlive: true | ||
maxSockets: 40 | ||
maxFreeSockets: 10 | ||
packages: |
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'd recommend optimisations like facebook/docusaurus#7967 to avoid the registry proxy private packages to outside (publish might fails due network conditions) also help to keep isolated the packages.
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 is perfect, thank you so much 🤞
.circleci/verdaccio/config.yml
Outdated
publish: $all | ||
proxy: npmjs | ||
logs: | ||
- {type: file, path: verdaccio.log, format: pretty, level: debug} |
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.
Debug is really verbose, I'd recommend warn
and also pretty
is pretty expensive in terms of execution, if you don't need the coolers or fancy arrows, you might consider json
instead to boost the registry.
7621118
to
c97a465
Compare
c97a465
to
64ee397
Compare
Thanks for doing this @fortmarek. I haven't had the time to review this yet, but I've posted an update on the Monorepo effort here: #34692 so we're aligned on the next steps |
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.
Great stuff 👍
'@*/*': | ||
access: $all | ||
publish: $authenticated | ||
proxy: npmjs |
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.
Why is this needed?
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 prohibits unauthenticated users to published organization-scoped packages. I've seen this being done both in the Microsoft PR and the docusaurus one. @juanpicado, do you know the exact reasoning behind this?
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.
Great thanks for the clarification 👍
ec56dd1
to
e2f3ac0
Compare
d82ef32
to
9e2f6e6
Compare
9e2f6e6
to
6fafd7a
Compare
Thanks for the review, the comments have been addressed 🤞 |
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @fortmarek in 22940e4. When will my fix make it into a release? | Upcoming Releases |
Summary: This PR adds [verdaccio](https://github.com/verdaccio/verdaccio) to release packages in the `packages` directory during the E2E test on CI. The rationale behind this is the following: - Firstly, we wanted to push the [monorepo RFC](react-native-community/discussions-and-proposals#480). We hit an issue when renaming the packages to follow the same convention caused by the e2e test using the template to fail. This is because the template installs packages from the live version of npm – and if you just rename a package in a given PR without releasing it, the package understandably can't be installed since it's not published, yet – as you can see [here](https://app.circleci.com/pipelines/github/facebook/react-native/15286/workflows/149df51f-f59b-4eb3-b92c-20c513111f04/jobs/282135?invite=true#step-108-283). - Secondly, the current e2e test on `main` does not actually test the latest code of the packages in the `packages` directory as it simply downloads the latest versions from npm. This creates a divide between what's tested and what users should expect when using nightlies or when a new minor is released. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Changed] - Use verdaccio for template e2e test Pull Request resolved: facebook#34577 Test Plan: `test_js` CI check should pass. Additionally, I have temporarily updated the [PR](facebook#34572) renaming `assets` to `assets-registry` to include the verdaccio changes – the `test_js` passes there, additionally proving merging this PR will unblock us with the rename PRs. Reviewed By: cipolleschi Differential Revision: D39723048 Pulled By: cortinico fbshipit-source-id: aeff3811967360740df3b3dbf1df50e506fb72d8
Summary
This PR adds verdaccio to release packages in the
packages
directory during the E2E test on CI.The rationale behind this is the following:
main
does not actually test the latest code of the packages in thepackages
directory as it simply downloads the latest versions from npm. This creates a divide between what's tested and what users should expect when using nightlies or when a new minor is released.Changelog
[Internal] [Changed] - Use verdaccio for template e2e test
Test Plan
test_js
CI check should pass. Additionally, I have temporarily updated the PR renamingassets
toassets-registry
to include the verdaccio changes – thetest_js
passes there, additionally proving merging this PR will unblock us with the rename PRs.