Open leabaertschi opened 7 months ago
Hi @leabaertschi - thanks for opening an issue. I don't quite understand from your message. When you use the term "tag," are you referring to the Pro tagging feature. If so, as a Pro customer someone from your organization can open a ticket with Sonatype Support.
If it's not in relation to that feature, can you provide a few more specific examples of package names/versions, and what the resulting metadata looks like?
Hi @nblair. I'm talking about npm
dist tags. I'll try to explain some more.
Let's say we have a package named MyPackage
. While working on it I'm creating a pre release with a version 1.3.0-story-4750.1
so I can use and test it in another project. We publish this package to the npm-snapshots
repository with an npm
dist-tag
canary
by executing npm publish --tag canary --registry REGISTRY/npm-snapshots
from within MyPackage
. If I now look at the metadata for MyPackage
I get the following dist-tags:
"dist-tags":{"canary":"1.3.0-story-4750.1","latest":"1.3.0-story-4750.1"}
My expectation is that there is only a canary
tag, I never tagged this package with the latest
tag.
Now I'm done with my changes and release a proper version 1.3.0
of MyPackage
and push that one to npm-releases
with an npm dist-tag latest
.
When looking at the metadata in the npm-releases
package, I get a latest
dist-tag with version 1.3.0
, as expected. If I now however look at the metadata for MyPackage
in the group repository (consisting of npm-releases
and npm-snapshots
in that order), I get again:
"dist-tags":{"canary":"1.3.0-story-4750.1","latest":"1.3.0-story-4750.1"}
Since npm-releases
comes first in the order of repositories, I expect to get
"dist-tags":{"canary":"1.3.0-story-4750.1","latest":"1.3.0"}
or
"dist-tags":{"latest":"1.3.0"}
I hope this helps. Let me know if I can provide more information.
Hi! Got exact same issue.
We are publishing pre-release versions into "dev" repository with dist-tag latest_testing
and releases into "release" with latest
dist-tag. Both repositories accessible through group repository, where release-repo is above dev-repo. When I pull from group repo by latest
tag, often I receive packages from dev-repo.
@leabaertschi may be you found some workaround to share?
Unfortunately not
@leabaertschi @zarom Unfortunately, the npm registry spec doesn't look like it was designed to handle the case of a component whose versions are split between two registries. Supposedly, every component must have a latest tag defined, which means there must be a latest version in @zarom's dev or snapshots registries, not just the releases registry.
We mostly publishing via Nexus rest-api from CI, perhaps the problem is related to this method of publishing.
@mrprescott
latest_testing
for pre-release and latest
after releaselatest
tag is found in the first repository, that is the one that is used. By timestamp would only work if there was no latest
tag in the snapshot repositorycanary
tag
We have a Nexus 3 with a group npm repositories. In there are the following repositories:
To npm-releases we only publish packages with tag
latest
and to npm-snapshots we only publish packages with tagcanary
. Nevertheless, when accessing the meta data for a package in npm-snapshots, thedist-tags
contain the expectedcanary
tag, but also alatest
tag with the same version (they are all pre-release versions like1.3.0-story-4750.3
). The metadata in the npm-releases repo correctly only shows alatest
tag with the stable version of the latest release. When looking now at the metadata of said package in the group repo it shows thelatest
andcanary
tags from npm-snapshots, although npm-releases comes first in the order of repositories.In my opinion there are two things that don't work as expected:
latest
tagDo you have a workaround you are using at present? no
What feature or behavior is this required for? npm install package@latest installs the correct version
Tell us about your Nexus Repository deployment: what version, operating system, and database are you using? OSS 3.66.0-02 Linux OrientDB