Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-21400

npm dist-tag not replicated with npm dist-tag add

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Done
    • Affects Version/s: 6.17.0
    • Fix Version/s: 7.8.1
    • Component/s: NPM
    • Labels:

      Description

      Steps to reproduce:

      1. Create Artifactory instances A and B
      2. Configure replication from npm-local to npm-local (A -> B)
      3. Enable properties replication; Enable event replication; Set frequent CRON expression (eg. 5 sec)
      4. npm config set registry A
      5. npm login
      6. 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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igoru Igor Usenko [EXT]
              Reporter:
              valeriyp Valeriy Petrov
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: