pipeline-aws-plugin icon indicating copy to clipboard operation
pipeline-aws-plugin copied to clipboard

snippet generator generates faulty code (File and IncludePathPattern cannot be used together)

Open m8ram opened this issue 3 years ago • 0 comments

Version report

Jenkins and plugins versions report:

Jenkins 2.263.3 pipeline-aws-plugin version 1.43

  • What Operating System are you using (both controller, and any agents involved in the problem)?

Master and agent run RHEL8

Reproduction steps

  • Install plugin
  • Generate pipeline script using the pipeline snippet snippet generator.

Results

Expected result:

Working code that runs without exception.

Actual result:

s3Upload acl: 'Private', bucket: 'awsbucket', cacheControl: '', excludePathPattern: '', file: 'testfile', includePathPattern: '', metadatas: [''], redirectLocation: '', sseAlgorithm: '', tags: '', text: '', workingDir: ''

Results in

java.lang.IllegalArgumentException: File and IncludePathPattern cannot be used together
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
	at de.taimos.pipeline.aws.S3UploadStep$Execution.run(S3UploadStep.java:349)
	at de.taimos.pipeline.aws.S3UploadStep$Execution.run(S3UploadStep.java:295)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Finished: FAILURE

If the file and includePathPattern are mutually exclusive the snippet generator should not write both of them

Thanks in advance

Bram

m8ram avatar Aug 25 '21 13:08 m8ram