Hi @caterina ,
I agree and there doesn't seem to be any good usecases or official guidance from npm tags command, but we do not recommend using them: https://blog.inedo.com/npm/smarter-npm-versioning-with-semver/
From the api/technical standpoint, npm tags are a little weird -- a package themselves doesn't contain tags. Instead, the registry has a key/value tag store. By convention, the store has keys like latest and values like 4.8.1, but it seems to allow anything? At least from data we've seen on npmjs.org
In any case, the npm client seems to set a latest tag, so we'll just support that use case then.
FYI here is the logic/code I added:
var tags = await this.GetPackageTagsAsync(purl.Name, false, cancellationToken: cancellationToken);
if (tags.TryGetValue("latest", out var latestVersion) && latestVersion == PackageVersion<SemanticVersion2>.Parse(purl.Version))
await DB.Npm_SetTagVersionAsync(toFeed.FeedId, purl.Name.Id, "latest", purl.Version, DateTime.UtcNow);
It sets the latest tag on the other feed if the current feed's latest tag points to the package you are promoting.
Thanks,
Alana