Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-16475

DELETE asset REST endpoint for yum should not delete component

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.9.0
    • Fix Version/s: None
    • Component/s: REST, Yum
    • Labels:
    • Story Points:
      3

      Description

      I noticed that when a delete by asset is done on a yum hosted repository that it also deletes the component, this in turn will delete the remaining assets of the component.

       To reproduce:

      1. Upload two rpms for different architectures, I used bakefile from http://mirror.centos.org/centos/6/extras/i386/Packages/bakefile-0.2.8-3.el6.centos.i686.rpm and http://mirror.centos.org/centos/6/extras/x86_64/Packages/bakefile-0.2.8-3.el6.centos.x86_64.rpm
      2. Use the rest api to perform a search: http://localhost:8081/service/rest/beta/search?repository=yum-hosted&format=yum&name=bakefile&version=0.2.8-3.el6.centos will return something similar to the response shown below, i.e. one component containing two assets.
      3. Use one of the assets id value to issue a delete http://localhost:8081/service/rest/beta/assets/eXVtLWhvc3RlZDoyZmZmNTA5YTdjMmE5ZWJlMjI1MmIxNTY5OWI3MzdjYg
      1. Perform the same search as in step 1
      2. Observe that the component and all rpms have now been deleted.

       

      {
      
          "items": [
      
              {
      
                  "id": "eXVtLWhvc3RlZDpkMDY0ODA0YThlZDVhZDZlNjhmZGU5MWNmM2NiZTgzMw",
      
                  "repository": "yum-hosted",
      
                  "format": "yum",
      
                  "group": null,
      
                  "name": "bakefile",
      
                  "version": "0.2.8-3.el6.centos",
      
                  "assets": [
      
                      {
      
                          "downloadUrl": "http://localhost:8081/repository/yum-hosted/Packages/bakefile-0.2.8-3.el6.centos.i686.rpm",
      
                          "path": "Packages/bakefile-0.2.8-3.el6.centos.i686.rpm",
      
                          "id": "eXVtLWhvc3RlZDoyZmZmNTA5YTdjMmE5ZWJlMjI1MmIxNTY5OWI3MzdjYg",
      
                          "repository": "yum-hosted",
      
                          "format": "yum",
      
                          "checksum": {
      
                              "sha1": "998b85a31cf312a606d60f8bdd39ba4e0a8a6c48",
      
                              "sha512": "1d46970a27058884860da581cd569a75c7266e31c7512f9eced9613e663bd9796ea0b117eea442fe69950d37cc6d2b4c6ed07dfd14ef1e847a719b4fd1817c78",
      
                              "sha256": "4dbabf0c42761b478cd64379d46ed903567e655ca1d345f16e17c5ffb122563b",
      
                              "md5": "0b59132945f9d60ec000e21c480d864a"
      
                          }
      
                      },
      
                      {
      
                          "downloadUrl": "http://localhost:8081/repository/yum-hosted/Packages/bakefile-0.2.8-3.el6.centos.x86_64.rpm",
      
                          "path": "Packages/bakefile-0.2.8-3.el6.centos.x86_64.rpm",
      
                          "id": "eXVtLWhvc3RlZDoyNGMxZmUzMzVkMjY2NTJmODdmYTdhNzQ5ZWI0YTUwYQ",
      
                          "repository": "yum-hosted",
      
                          "format": "yum",
      
                          "checksum": {
      
                              "sha1": "24ec6ddf8bbcdf0eefaed3daeac705747f025eb9",
      
                              "sha512": "6d2f131fac7fb69073c88bfbe7f689b54b0e1d943292483e8a455d80764fd8183f2cbdbf05cb4c9071a36ca3897bd61c4fabbf204c276b73df0f7cac195c32b3",
      
                              "sha256": "261f2006a15aae21008181b687878d8b81081b52a1df74f82e8cc326c40c78c3",
      
                              "md5": "71c01c1f9a0f155650e517609ecc065a"
      
                          }
      
                      }
      
                  ],
      
                  "tags": []
      
              }
      
          ],
      
          "continuationToken": null
      
      }
      

      Acceptance Criteria

      1. delete by asset should not delete the component when other assets are associated with the component.
      2. delete by component should delete itself and all associated assets.

        Attachments

          Activity

            People

            Assignee:
            mdodgson Mark Dodgson
            Reporter:
            mdodgson Mark Dodgson
            Last Updated By:
            Peter Lynch Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title