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

test: improve e2e verdaccio configuration #7967

Merged
merged 7 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- jest.config.mjs
- packages/**
- tsconfig.json
- admin/verdaccio.yaml
- .github/workflows/tests-e2e.yml

concurrency:
Expand Down
21 changes: 21 additions & 0 deletions admin/verdaccio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,32 @@

storage: ../storage

## verdaccio does not allow to publish packages when the client is offline, to avoid
## errors on publish it is disabled
## https://verdaccio.org/docs/configuration#offline-publish
publish:
allow_offline: false

# A list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
# this package is hosted outside the monorepo
# https://github.com/slorber/react-loadable
# thus requires to be fetched from npmjs
'@docusaurus/react-loadable':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to dynamically figure out which packages are in the local monorepo? In the future we may have more scoped (forked) packages not in the main repo.

Copy link
Contributor Author

@juanpicado juanpicado Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, since is committed in the repo is less flexible, but I could try adding the proxy, so any package that match with the namespace is lookup outside so the block above is not need it, it has disadvantages like for every package published will check on npmjs (here is when external network might break your build again).

  '@docusaurus/*':
     access: $all
     publish: $all
     proxy: npmjs

Let me know what do you prefer and I can update the config.

Anyhow, I'm working in a different ways, like https://github.com/verdaccio/verdaccio/blob/master/packages/verdaccio/test/unit/proxy-multilpe-registry.spec.ts#L20 programatically generate the yaml files or stuff like that for the next major (still WIP).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good to know. For now, I think this hardcoded list is fine—we just anticipate another 2~3 forked dependencies + a few to be moved under this scope (ref #6246)

access: $all
publish: $all
proxy: npmjs
# group and isolate all local packages, avoid being proxy from outside
'@docusaurus/*':
access: $all
publish: $all
'@*/*':
access: $all
publish: $authenticated
proxy: npmjs
'**':
# Allow all users (including non-authenticated users) to read and
# publish all packages
Expand Down