jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
114 stars 187 forks source link

Function setProps fails adding property lists #759

Open SamBissig opened 1 year ago

SamBissig commented 1 year ago

Describe the bug After upgrading to 3.18.0 we have found a bug in setProps function. If you want to set a property list (propertyName=val1,val2,val3) with the function setProps only the last property of the list will be set (results in propertyName=val3).

This bug was introduced somewhere between 3.11.3 and 3.18.0.

To Reproduce

When setting the keyListB the full list is added to artifactory.

                    "files": [
                            {
                                "pattern":   "test-file.txt",
                                "target":    "<your-repo>/test/",
                                "props":    "keyListB=1,2,3"
                            }
                        ]
                    }"""
                    rtServer.upload(spec: uploadImagesSpec, buildInfo: buildInfo, module: "test")

In the second stage we added additional properties. From keyListC we see only the last item ("three").

"files": [
                        {
                            "pattern": "<your-repo>/test/test-file.txt"
                        }
                    ]
                    }"""
                    rtServer.setProps spec: setPropsSpec, props: "keyA=aSingleValue;keyListC=one,two,three"

See the attached jenkins file Jenkinsfile.txt that contains a Jenkinsfile to reproduce the behaviour.

Expected behavior Also setProps should add the list of values, as it was in previous plugin version.

Versions

Additional context Add any other context about the problem here.

n2N8Z commented 1 year ago

We are affected by this also. Our call is slightly different, but also just the last value in the list is set.

rtSetProps (
                    serverId: serverId,
                    props: properties.collect { /$it.key=$it.value/ }.join(';'),
                    spec: """{
                        "files": [{
                            "pattern": "pattern"
                        }]
                    }"""
                )

where the incoming properties map contains keys with values that are comma separated.