Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildInfo.artifacts is empty with 3.15.0 #610

Closed
Brenne opened this issue Jan 7, 2022 · 8 comments · Fixed by jfrog/build-info#606
Closed

buildInfo.artifacts is empty with 3.15.0 #610

Brenne opened this issue Jan 7, 2022 · 8 comments · Fixed by jfrog/build-info#606
Assignees
Labels
bug Something isn't working

Comments

@Brenne
Copy link

Brenne commented Jan 7, 2022

Describe the bug
The bug exists in 3.15.0 (also 3.15.1) but not in 3.14.2
Jenkins Scripted pipeline:

 BuildInfo uploadInfo = artifactoryServer.upload(spec: ..., failNoOp: true)
 List uploadedArtifacts = uploadInfo?.getArtifacts()

uploadedArtifacts is always empty even when artifacts are uploaded.

Expected behavior
uploadedArtifacts contains a list of artifacts that have been uploaded (this is works for 3.14.2 but for 3.15.0 not anymore)

Versions

  • Jenkins Artifactory plugin version: 3.15.0
  • Jenkins operating system: Unix
@Brenne Brenne added the bug Something isn't working label Jan 7, 2022
@jimjaeger
Copy link

jimjaeger commented Jan 13, 2022

I experienced the same issue:

I tested the following flow in good case (3.14.2) and bad case (3.15.1):

  1. download a sample txt file
  2. copy file into new name
  3. upload the new file to the same path
  4. print upload build result

Summary findings:
Bad Case:

  • buildInfo.artifacts is empty but the information are available in buildInfo.modules[0].artifacts
  • artifact.localPath (in buildInfo.modules[0].artifacts) is null

Good case:

  • buildInfo.artifacts contains uploaded artifact info and the information are available in buildInfo.modules[0].artifacts
  • artifact.localPath information is available

@eyalbe4 Any ideas?

Build Result Bad case:

{
   "env": {
       "sysVars": {},
       "capture": false,
       "cpsScript": {
           "binding": {
               "variables": {
                   "steps": {
                       "keepStepArguments": true
                   },
                   "Artifactory": {}
               }
           }
       },
       "filter": {
           "patternFilter": {
               "excludePatterns": ["*password*", "*psw*", "*secret*", "*key*", "*token*"],
               "includePatterns": []
           }
       },
       "envVars": {},
       "vars": {}
   },
   "dependencies": [],
   "sysVars": {},
   "startDate": "2022-01-13T18:41:17+0000",
   "agentName": null,
   "deployableArtifactsByModule": {},
   "issues": {
       "buildName": "test :: jjtest :: arttest",
       "trackerName": null,
       "affectedIssues": null,
       "aggregateBuildIssues": false,
       "cpsScript": {
           "binding": {
               "variables": {
                   "steps": {
                       "keepStepArguments": true
                   },
                   "Artifactory": {}
               }
           }
       },
       "aggregationBuildStatus": null,
       "project": null
   },
   "modules": [{
           "dependencies": null,
           "type": null,
           "properties": null,
           "md5": null,
           "id": "test :: jjtest :: arttest",
           "excludedArtifacts": null,
           "repository": null,
           "artifacts": [{
                   "localPath": null,
                   "type": "txt",
                   "properties": null,
                   "md5": "eb94fd75a6a8c04306dd341953e7e922",
                   "sha256": null,
                   "remotePath": "jjtest/sample/sample-3.txt",
                   "name": "sample-3.txt",
                   "sha1": "bcc619be73c5088dc73a38392898f2e994178a94"
               }
           ],
           "sha1": null
       }
   ],
   "retention": {
       "maxBuilds": -1,
       "doNotDiscardBuilds": [],
       "maxDays": -1,
       "deleteBuildArtifacts": false,
       "async": false
   },
   "envVars": {},
   "convertedIssues": {
       "affectedIssues": null,
       "aggregateBuildIssues": false,
       "aggregationBuildStatus": null,
       "empty": true,
       "tracker": {
           "version": null,
           "name": null
       }
   },
   "project": null,
   "vcs": [{
           "message": "",
           "revision": "",
           "branch": "",
           "url": "",
           "empty": true
       }
   ],
   "name": "test :: jjtest :: arttest",
   "artifacts": [],
   																									   
   												  
   												   
   														  
   	 
     
   "number": "3"
}

Good case:

{
   "env": {
       "sysVars": {},
       "capture": false,
       "cpsScript": {
           "binding": {
               "variables": {
                   "steps": {
                       "keepStepArguments": true
                   },
                   "Artifactory": {}
               }
           }
       },
       "filter": {
           "patternFilter": {
               "excludePatterns": ["*password*", "*psw*", "*secret*", "*key*", "*token*"],
               "includePatterns": []
           }
       },
       "envVars": {},
       "vars": {}
   },
   "dependencies": [],
   "sysVars": {},
   "startDate": "2022-01-13T18:30:31+0000",
   "agentName": null,
   "deployableArtifactsByModule": {},
   "issues": {
       "buildName": "test :: jjtest :: arttest",
       "trackerName": null,
       "affectedIssues": null,
       "aggregateBuildIssues": false,
       "cpsScript": {
           "binding": {
               "variables": {
                   "steps": {
                       "keepStepArguments": true
                   },
                   "Artifactory": {}
               }
           }
       },
       "aggregationBuildStatus": null,
       "project": null
   },
   "modules": [{
           "dependencies": null,
           "type": null,
           "properties": null,
           "md5": null,
           "id": "test :: jjtest :: arttest",
           "excludedArtifacts": null,
           "repository": null,
           "artifacts": [{
                   "localPath": "/home/abc/workspace/test/jjtest/arttest/bazinga/jjtest/sample/sample-2.txt",
                   "type": "txt",
                   "properties": null,
                   "md5": "eb94fd75a6a8c04306dd341953e7e922",
                   "sha256": null,
                   "remotePath": "jjtest/sample/sample-2.txt",
                   "name": "sample-2.txt",
                   "sha1": "bcc619be73c5088dc73a38392898f2e994178a94"
               }
           ],
           "sha1": null
       }
   ],
   "retention": {
       "maxBuilds": -1,
       "doNotDiscardBuilds": [],
       "maxDays": -1,
       "deleteBuildArtifacts": false,
       "async": false
   },
   "envVars": {},
   "convertedIssues": {
       "affectedIssues": null,
       "aggregateBuildIssues": false,
       "aggregationBuildStatus": null,
       "empty": true,
       "tracker": {
           "version": null,
           "name": null
       }
   },
   "project": null,
   "vcs": [{
           "message": "",
           "revision": "",
           "branch": "",
           "url": "",
           "empty": true
       }
   ],
   "name": "test :: jjtest :: arttest",
   "artifacts": [{
           "localPath": "/home/abc/workspace/test/jjtest/arttest/bazinga/jjtest/sample/sample-2.txt",
           "md5": "eb94fd75a6a8c04306dd341953e7e922",
           "remotePath": "jjtest/sample/sample-2.txt",
           "sha1": "bcc619be73c5088dc73a38392898f2e994178a94"
       }
   ],
   "number": "2"
}

@jimjaeger
Copy link

jimjaeger commented Jan 13, 2022

The reason for empty buildInfo.artifacts is a combination from 2 aspects:

@eyalbe4 @Or-Geva Any chance to get a fast solution and new version that fix the issue?

@Or-Geva
Copy link

Or-Geva commented Jan 16, 2022

Thank you guys for your time and effort to open and investigate this @Brenne & @jimjaeger.
I have opened a fix-PR to resolve this issue.
I will update this thread once this gets released.

@jimjaeger
Copy link

Thanks @Or-Geva. What is the plan to release the fix with a new jenkins-artifactory-plugin plugin version?

@Or-Geva
Copy link

Or-Geva commented Jan 20, 2022

@jimjaeger, Jenkins Artifactory plugin 3.15.2 is released.
Feel free to upgrade and share your feedback.

@jimjaeger
Copy link

The entries are back again. Great thanks.

Does the issue show that there is a test gap? Do you plan an additional testcase?

@eyalbe4
Copy link

eyalbe4 commented Jan 21, 2022

Yes @jimjaeger.
We'll be adding a pipeline to the plugin's testing suite, to cover this API.
Thanks!

@shgilboa
Copy link

Hi,

This also happens for gradle publish in scripted pipeline.
rtGradle.run returns a buildInfo with empty artifacts array, but the artifacts can be found in the modules array.

Jenkins Artifactory plugin 3.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants