Skip to content

[JENKINS-75928] copyArtifacts with whitespace after comma copies only the first artifact when using S3 artifact manager #763

@jenkins-infra-bot

Description

@jenkins-infra-bot

When attempting to `copyArtifacts` using S3 manager, only the first matching glob in a list is copied when the filter contains whitespace after comma.

Example:

copyArtifacts(
  filter: '**/*file*.bin, **/*log*.bin, **/*data*.bin, **/*record*.bin',
  fingerprintArtifacts: true,
  flatten: true,
  projectName: 'artifact-producer',
  selector: lastSuccessful()
)

Removing the "optional whitespace" as documented in https://github.com/jenkinsci/copyartifact-plugin/blob/770.va_6c69e063442/src/main/resources/hudson/plugins/copyartifact/CopyArtifact/help-filter.html correctly downloads all matching artifacts.

This behavior was only seen when the S3 artifact manager was enabled and is not observed with the built-in artifact management.

Workaround:
It's simple enough to remove the whitespace either by modifying Jenksfiles or using a shared-library to wrap `copyArtifacts`, but in our case we have a substantial number of Jenkinsfiles that would have to be changed to workaround.


Originally reported by bajotumn, imported from: copyArtifacts with whitespace after comma copies only the first artifact when using S3 artifact manager
  • status: Open
  • priority: Minor
  • component(s): artifact-manager-s3-plugin, copyartifact-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02
Raw content of original issue

When attempting to `copyArtifacts` using S3 manager, only the first matching glob in a list is copied when the filter contains whitespace after comma.

Example:

copyArtifacts(
  filter: '**/*file*.bin, **/*log*.bin, **/*data*.bin, **/*record*.bin',
  fingerprintArtifacts: true,
  flatten: true,
  projectName: 'artifact-producer',
  selector: lastSuccessful()
)

Removing the "optional whitespace" as documented in https://github.com/jenkinsci/copyartifact-plugin/blob/770.va_6c69e063442/src/main/resources/hudson/plugins/copyartifact/CopyArtifact/help-filter.html correctly downloads all matching artifacts.

This behavior was only seen when the S3 artifact manager was enabled and is not observed with the built-in artifact management.

Workaround: It's simple enough to remove the whitespace either by modifying Jenksfiles or using a shared-library to wrap `copyArtifacts`, but in our case we have a substantial number of Jenkinsfiles that would have to be changed to workaround.

environment
Jenkins 2.516.1 LTS jre21 official container<br/>
Amazon ECS fargate task / On Prem deployment in docker-compose stack.<br/>
Artifact Manager on S3: 949.v2567c4c52d79<br/>
Copy Artifact Plugin: 770.va_6c69e063442

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions