Search Unity

Package manager not displaying all packages in scoped registry

Discussion in 'Package Manager' started by D3Verdier, Dec 10, 2019.

  1. D3Verdier

    D3Verdier

    Joined:
    Sep 3, 2018
    Posts:
    5
    I'v been using my own npm package server for a while now and everything has been going smoothly, however, recently I noticed that any new packages i publish are not displayed in the package manager. Older packages in the same scope are able to be updated and behave as expected. Although the packages do not show up in the manager they do work if I add them to the package manifest or add them as dependencies of other packages.

    The new packages also look fine on the server, any idea of what could be causing this? Any help is greatly appreciated!
     
  2. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    Hi there,

    Could you share more information with us regarding what has changed? For instance, did you upgrade your sever? Did you upgrade to a new Unity version (if so, from which version to which version)?

    Best,
    Ethan
     
  3. D3Verdier

    D3Verdier

    Joined:
    Sep 3, 2018
    Posts:
    5
    No server changes have been made since it was setup and we have gone from 2019.2 via a few 2019.3betas to finally arrive at 2019.3.0f1. I can't find any other relevant changes that we have made that could cause this issue. I will do more extensive testing with different unity versions today. Do you have any ideas on what could be causing this behavior server side?
     
  4. D3Verdier

    D3Verdier

    Joined:
    Sep 3, 2018
    Posts:
    5
    Status update:

    I'v confirmed it's not a server side issue. But I just can't figure out whats causing the packages not to show up. I have created four separate new projects (2019.3.0f1) on four individual computers and the packages show up on two of them even though they all seem to be identical projects. In projects with 2019.2.12f1 they show up on all four computers.

    What can possibly be causing this very unpredictable behavior is beyond me.

    What factors influences if a package is displayed or not? I'm guessing this issue is somehow related to the minimum unity version of the package, however the packages missing have mo minimum version defined in the package.json
     
    Last edited: Dec 11, 2019
  5. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    104
    Hi there,

    Thanks for your update! I've shared this issue with the team and hopefully we can have some insight. In the mean time, could you file a bug for this so we can look into it further?

    To file a bug, you can see the following link:
    https://unity3d.com/unity/qa/bug-reporting

    Best,
    Ethan
     
  6. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    Has this bug been reported? I'm experiencing this issue as well with our github package registry (not github url packages but actual deployed npm packages on github). Packages don't appear in the UI but if I add them manually they're installed just fine. If I then uninstall the package the entry disappears entirely from the UI.
     
  7. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Yes, there was a bug reported similar to this that was reported and fixed in 2019.3.4f1 and 2018.4.18f1.

    I'm curious, did you manage to make the Github Packages registry feature work with UPM? If so, can you elaborate on how you manage to do this?

    Thanks!

    Pascal
     
  8. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    So I've tried on 2019.3.6f1 and 2020.1.0b4 yet neither of them show my packages either from my github registry OR my public verdaccio registry. Shall I submit another bug report or do I need to downgrade to 2018.4?

    Regarding your question, it was pretty easy. You just add a scoped registry to your manifest like normal except the url needs to be suffixed with the repo owner:

    Code (JavaScript):
    1. "scopedRegistries": [
    2.     {
    3.       "name": "Company Packages",
    4.       "url": "https://npm.pkg.github.com/@USER-OR-ORGANIZATION",
    5.       "scopes": [
    6.         "com.compnay"
    7.       ]
    8.     }
    9.   ],
    And for private repos / packages on github. Following the steps highlighted in the pinned thread for npm registry authentication worked just fine for me.

    FYI, here's a criminally easy github action script to automate the package deployment for you. I'd much rather this process be promoted than the github repo itself being used as a package:

    Code (JavaScript):
    1. name: Publish Unity Package
    2. on:
    3.   release:
    4.     types: [created]
    5. jobs:
    6.   build:
    7.     runs-on: ubuntu-latest
    8.     steps:
    9.     - uses: actions/checkout@v2
    10.     # Setup .npmrc file to publish to GitHub Packages
    11.     - uses: actions/setup-node@v1
    12.       with:
    13.         node-version: '12.x'
    14.         registry-url: 'https://npm.pkg.github.com'
    15.         scope: '@octocat' # Defaults to the user or organization that owns the workflow file
    16.     - run: npm publish
    17.       working-directory: PROJECT-FOLDER/Assets/PACKAGE-FOLDER
    18.       env:
    19.         NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     
  9. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Before doing that, can you try to start Unity with the `-enablePackageManagerTraces` argument and look into `upm.log` if there is anything related to your problem? This could be helpful.

    Nice! I haven't thought of just suffixing the scope registry URL with the scope! This is brilliant! We were looking into accepting both
    @
    and
    /
    characters in package names. This was the current blocker when people tried to set up GitHub Packages registry. I will share this with our users. Thank you very much!

    Regards,

    Pascal
     
    JakHussain likes this.
  10. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Thanks to your help in using the GitHub packages registry through scoped registries, I was able to reproduce your issue. I'm sorry to tell you, as far as I can see, the Github Packages registry does not support NPM search API endpoints (`/-/all` and `/-/v1/search`). Both endpoints return a 405 status code :(. So it won't be possible to show these packages in the Package Manager UI. You will have to resort to installing them manually and asking your users to use GitHub UI to find available packages.

    If I find anything new, I'll let you know.

    Regards,

    Pascal
     
  11. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    @okcompute_unity RIP my hopes and dreams...but thanks for looking into it for me I really appreciate it!
     
  12. KReguieg

    KReguieg

    Joined:
    Oct 27, 2016
    Posts:
    3
    Neither does Azure DevOps implement the API, and that's why Artifacts does not work... :( However, but a selfhosted Verdaccio registry works for me and my team. :)

    Cheers, Khaled.
     
  13. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    82
    after upgrading from 2019.3 to 2019.4.14f1, the 'All packages' becomes 'Unity Registry' in PackageManager, and I could not see all the packages available as it was in 2019.3 (without Proxy setting), with new upgrade 2019.4.14f1, i have to set HTTP_PROXY in system variable to enable the display of all packages available in 'Unity Registry', which is annoying. is there some new domain name that i need to add to white list ?or any solutions ?

    Thanks
     
  14. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Hi @dormouse,

    That's strange, the 'Unity Registry' refers to https://packages.unity.com but this hasn't changed from 2019.3 to 2019.4 so I'm not sure why you would now need to set the HTTP_PROXY variable. Just to be sure, have you overridden the main registry in your project e.g. using the "registry" property in the project manifest or the UPM_REGISTRY environment variable?
     
  15. dariony

    dariony

    Joined:
    May 16, 2015
    Posts:
    19
    @samuelb_unity was there a change between 2020.1 and 2020.2? "My Registries" no longer appears in the Package Manager on 2020.2
     
  16. supita_unity

    supita_unity

    Unity Technologies

    Joined:
    Dec 13, 2019
    Posts:
    226