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

Do not create scopedRegistry when scopes are empty #134

Closed
nowsprinting opened this issue Jan 18, 2024 · 2 comments · Fixed by #135
Closed

Do not create scopedRegistry when scopes are empty #134

nowsprinting opened this issue Jan 18, 2024 · 2 comments · Fixed by #135
Labels
bug Something isn't working

Comments

@nowsprinting
Copy link
Contributor

nowsprinting commented Jan 18, 2024

I am running the following command for automated testing of my UPM packages.

openupm -c $(PROJECT_HOME) add -ft MY_PACKAGE_NAME@file:../../

Created manifest.json is:

  "scopedRegistries": [
    {
      "name": "package.openupm.com",
      "url": "https://package.openupm.com",
      "scopes": []
    }
  ],
  "testables": [
    "MY_PACKAGE_NAME"
  ]

An error occurred when opening this project:

[Package Manager] Registry configuration is invalid:
  Scoped registry at position 1 is invalid:
    "scopedRegistries[0].scopes" must contain at least 1 items
[Package Manager] Failed to update project manifest: Registry configuration is invalid:
  Scoped registry at position 1 is invalid:
    "scopedRegistries[0].scopes" must contain at least 1 items

This issue occurs in v1.19.6. The manifest.json at v1.17.0 was as follows:

  "scopedRegistries": [
    {
      "name": "package.openupm.com",
      "url": "https://package.openupm.com",
      "scopes": [
        "com.openupm"
      ]
    }
  ],
  "testables": [
    "MY_PACKAGE_NAME"
  ]

In v1.17.0, scopes existed, so there was no problem.

@ComradeVanti
Copy link
Collaborator

Hm interesting. Yes, it used to be that a com.openupm scope would always be added, which avoided this issue. I guess the solution is to either add a "dummy scope" like that again, or to not add a scoped registry at all if not necessary. What do you think @favoyang?

@favoyang
Copy link
Member

In this case, the scope registry 'package.openupm.com" should not be added to the manifest.json.

@nowsprinting nowsprinting changed the title Do not create scopedRegistries when scopes are empty Do not create scopedRegistry when scopes are empty Jan 19, 2024
favoyang pushed a commit that referenced this issue Jan 20, 2024
* Fix make not create scopedRegistry when scopes are empty

fixed #134

* Add assert shouldNotHaveRegistries into "add pkg@http" and "add pkg@git"
@favoyang favoyang added the bug Something isn't working label Jan 20, 2024
github-actions bot pushed a commit that referenced this issue Jan 20, 2024
## [1.19.7](1.19.6...1.19.7) (2024-01-20)

### Bug Fixes

* make not create scopedRegistry when scopes are empty ([#135](#135)) ([f1a2000](f1a2000)), closes [#134](#134)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants