Windows build agents put nested artifacts up with slashes in file name
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 378
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 74
Description
**TLDR; the windows build agents save artifacts with what would be their nested directory structure as part of the file names. Artifacts that should be in the bin folder are named `bin/foo.jpg`.**
Our windows build agents have two steps, one that puts up a bunch of artifacts and one that pulls down a bunch of artifacts and creates several artifacts from them.
There are other Linux build agents that also create artifacts used by the latter of those windows steps.
The first step creates artifacts as follows
artifact_paths:
- "bin*"
- "WebDisplay/bin*" (this contains 400 or so files)
- "Player/Brightsign/Web/*.xml.manifest"
there are Linux step build artifacts that also end up in the bin/ subdirectory of the repo.
If I look on s3 I'll see a bin directory with Linux build artifacts in it as well as the windows artifacts with file names like `bin/foo/bar.baz` IN THE ROOT directory
The second pulls all of the artifacts like this. if I don't do it exactly like this with the artifacts plugin, it will pull the files down with the slashes in their names. which is an issue when we try to change the structure of our pipelines.
plugins:
- artifacts#v1.2.0:
download: [ "**\\*","**/*" ]
Then it creates artifacts with slashes in their names in the root.
artifact_paths:
- "bin/Installers/Carousel*.exe"
- "bin/Installers/Carousel*.msi"
- "bin/Installers/BrightSign*.msi"
- "bin/Installers/InternalTools/*.msi"
- "bin/Installers/Tools/*.msi"
The long story short is, it is certainly writing the files to S3 with slashes in their file name. I tested this by writing to our private bucket and looking at the artifacts. When these artifacts are clicked on in the UI they download with underscores where the slashes would be.
I've also verified that on the build agents themselves pre-upload, they are in the directory structure I would want them to be in and not created with slashes in their names.
Contributor guide
Research direction
Start by tracing how the artifacts plugin handles the listed artifact_paths and the Windows download pattern "**\\*"/"**/*". Reproduce the behavior with nested files such as bin/foo.jpg and inspect the S3 artifact names and downloaded paths. Done means nested artifacts retain their directory structure without requiring the workaround and the listed installer paths still produce the expected artifacts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system, ci-cd, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100