Steps to reproduce:
- Create Artifactory instances A and B
- Configure replication from npm-local to npm-local (A -> B)
- Enable properties replication; Enable event replication; Set frequent CRON expression (eg. 5 sec)
- npm config set registry A
- npm login
- npm publish && sleep 15 && npm dist-tag add testpackage@1.0.0 release
When publishing with $ npm publish --tag release, the npm client issues PUT request with dist-tags already included:
{
"_id": "testpackage",
"name": "testpackage",
"description": "desc",
"dist-tags": {
"release": "1.0.0"
},...
While $ npm dist-tag add testpackage@1.0.0 release will:
PUT /artifactory/api/npm/npm-local/-/package/testpackage/dist-tags/release
"1.0.0"
Expected:
1. testpackage in Artifactory B has dist-tag "release": "1.0.0" in package.json
2. testpackage-1.0.0.tgz in Artifactory B has property npm.disttag=release
Observed:
1. testpackage in Artifactory B missing dist-tag "release": "1.0.0" in package.json
2. testpackage-1.0.0.tgz in Artifactory B has property npm.disttag=release
To replicate the properties Artifactory A issues a PUT request to Artifactory B with the following content:
PUT "/artifactory/npm-local//testpackage/-/testpackage-1.0.0.tgz*:properties*"
<properties>[\n]
<npm.disttag>latest</npm.disttag>[\n]
<npm.version>1.0.0</npm.version>[\n]
<artifactory.licenses>ISC</artifactory.licenses>[\n]
<npm.description>desc</npm.description>[\n]
<npm.name>testpackage</npm.name>[\n]
<npm.keywords>no_content</npm.keywords>[\n]
<npm.disttag>release</npm.disttag>[\n]
</properties>
from the artifactory.log:
2020-02-26 16:27:39,750 [http-nio-8081-exec-10] [INFO ] (o.a.e.UploadServiceImpl:302) - Deploy properties to 'npm-local:testpackage/-/testpackage-1.0.0.tgz:properties' Content-Length: 344
Setting properties with PUT "/artifactory/npm-local//testpackage/-/testpackage-1.0.0.tgz*:properties*" does not trigger writing package metadata for '.npm/testpackage/package.json'
(PUT *.tgz:properties is used in Replication)
"Recalculate Index" does not fix that, yet we have property npm.disttag replicated successfully
Under certain circumstances might lead to:
a) duplicate npm.disttag properties with the same value for different versions
b) missing dist-tag in package.json
- is cloned by
-
RTFACT-23167 CLONE - npm dist-tag not replicated with npm dist-tag add (clone for 6.22)
- Done
- is related to
-
RTFACT-19292 npm dist-tags are not replicated
- Done