buildkite / buildkite/agent

Artifact glob paths inconsistent between upload and download

Open
#1,087 0 comments 3 reactions 0 assignees View on GitHub
artifacts
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

When an artifact upload is specified with a glob path such as `dist/**/*`, all files recursively under `dist` will be uploaded. However, when the same path is specified for download (via the artifacts plugin or the buildkite-agent directly), only files in subfolders will be downloaded.

For example, with a setup like the following:
```
dist/
|-- assets/
| |-- image.jpg
|-- js/
| |-- script.js
|-- index.html
```

- `buildkite-agent artifact upload "dist/**/*"` will upload:
- `dist/assets/image.jpg`
- `dist/js/script.js`
- `dist/index.html`
- `buildkite-agent artifact download "dist/**/*" .` will only download
- `dist/assets/image.jpg`
- `dist/js/script.js`

This can be worked around by using a separate glob for download: `buildkite-agent artifact download "dist/*" .` will work.

I assume this is because upload collects files by doing a filesystem glob, and download performs a search via the API.

Contributor guide

Open the contributing guide

Research direction

Start with the artifact upload and artifact download command entry points used by buildkite-agent, and reproduce the difference with the dist/**/* example from the issue. Compare how each command handles files directly under dist versus nested folders, then verify that upload and download include the same files.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.