salt icon indicating copy to clipboard operation
salt copied to clipboard

salt artifactory - classifier still not properly being identified

Open retowelti opened this issue 8 years ago • 4 comments

Description of Issue/Question

Follow-up of Issue #31179. When processing the maven-metadata.xml the classifier will already be considered, but not in the context of the extension. The evaluation of the requested version considers only the packaging (or extension) and ignores the classifier. Maybe you get the desired version with classifier or not. This depends on the order of the entries in the maven-metadata.xml.

<snapshotVersion>
  <classifier>my-classifier</classifier>
  <extension>jar</extension>
  <value>4.73.0-20180213.085904-74</value>
  <updated>20180213085904</updated>
</snapshotVersion>
<snapshotVersion>
  <extension>jar</extension>
  <value>4.73.0-20180213.085532-73</value>
  <updated>20180213085532</updated>
</snapshotVersion>

Your snapshot_version_metadata['snapshot_versions'] will look like this:

{
  'my-classifier': '4.73.0-20180213.085904-74',
  'jar': '4.73.0-20180213.085532-73'
}

In this example you get the wrong version 4.73.0-20180213.085532-73 when you request my-classifer.

Setup

Checkout develop branch. Define a state like this:

test_download:
  artifactory.downloaded:
    - artifact:
        artifactory_url: {{ url }}
        repository: {{ repositroy }}
        group_id: {{ group_id }}
        artifact_id: {{ artifact_id }}
        version: '{{ version }}'
        classifier: '{{ classifier }}'
    - target_file: {{ target_file }}

Steps to Reproduce Issue

  1. Build your app with classifier
  2. Build your app without classiffier
  3. let salt download the version with classifier

Versions Report

Salt Version:
           Salt: 2017.7.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8.1
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (default, Jan 31 2018, 02:12:13)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.5.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
 
System Versions:
           dist: centos 6.9 Final
         locale: ANSI_X3.4-1968
        machine: x86_64
        release: 2.6.32-696.20.1.el6.x86_64
         system: Linux
        version: CentOS 6.9 Final

retowelti avatar Feb 14 '18 08:02 retowelti

@areaxx Thanks for the report and the PR.

garethgreenaway avatar Feb 14 '18 16:02 garethgreenaway

Thanks for merging @rallytime, unfortunately I found a bug in my fix :see_no_evil: See #46130

retowelti avatar Feb 21 '18 13:02 retowelti

@areaxx Ah, thanks for following up. :)

rallytime avatar Feb 21 '18 14:02 rallytime

Would it be possible to get this (and #46130) back ported to 2017.7 (or even 2018.3)?

acornett avatar Aug 06 '18 20:08 acornett