Skip to content

Add a submission:download Artisan command - #4308

Merged
williamjallen merged 1 commit into
Kitware:masterfrom
williamjallen:submission-download-command
Dec 3, 2026
Merged

williamjallen merged 1 commit into
Kitware:masterfrom
williamjallen:submission-download-command

Conversation

@williamjallen

Copy link
Copy Markdown
Member

Adds php artisan submission:download {id}, which writes out a submitted file exactly as CDash received it, so an admin can look at what a client actually sent, such as a file that failed to parse.

By default the file goes to stdout, so it can be piped like cat:

$ php artisan submission:download 01a23476-e1b4-7dae-9743-f0345ce7d6ce | xmllint --format - | less
$ php artisan submission:download 01a23476-e1b6-7333-9c7c-1db817a4e2f5 | tar tv

With --output, it writes a file instead. A directory gets the file under the submission's ID, followed by the client's filename for data files:

$ php artisan submission:download 01a23476-e1b4-7dae-9743-f0345ce7d6ce --output=.
Wrote ./01a23476-e1b4-7dae-9743-f0345ce7d6ce.xml (812 KB)

Details:

  • Messages and errors go to stderr, so stdout carries only the file. A failed write, such as to a full disk, exits 1. A reader that stops early, such as head, ends the command quietly, as with cat.
  • A binary file isn't written to a terminal, since it could leave the terminal unusable. Redirect the output or use --output instead.
  • An existing file isn't overwritten unless --force is given, and a device or named pipe is never replaced. The file is created readable by its owner only, since submissions can contain secrets. It's written beside the target and renamed into place when complete, so a failure never leaves a partial file.
  • The client's filename comes from the uploader, so only its base name is used, with unsafe characters replaced.
  • The file is looked up at the path recorded for the submission. If it isn't there, or storage can't be read, the command says so and exits 1.

Adds `php artisan submission:download {id}`, which writes out a submitted file exactly as CDash received it, so an admin can look at what a client actually sent, such as a file that failed to parse.

By default the file goes to stdout, so it can be piped like `cat`:

```
$ php artisan submission:download 01a23476-e1b4-7dae-9743-f0345ce7d6ce | xmllint --format - | less
$ php artisan submission:download 01a23476-e1b6-7333-9c7c-1db817a4e2f5 | tar tv
```

With `--output`, it writes a file instead. A directory gets the file under the submission's ID, followed by the client's filename for data files:

```
$ php artisan submission:download 01a23476-e1b4-7dae-9743-f0345ce7d6ce --output=.
Wrote ./01a23476-e1b4-7dae-9743-f0345ce7d6ce.xml (812 KB)
```

Details:
- Messages and errors go to stderr, so stdout carries only the file. A failed write, such as to a full disk, exits 1. A reader that stops early, such as `head`, ends the command quietly, as with `cat`.
- A binary file isn't written to a terminal, since it could leave the terminal unusable. Redirect the output or use `--output` instead.
- An existing file isn't overwritten unless `--force` is given, and a device or named pipe is never replaced. The file is created readable by its owner only, since submissions can contain secrets. It's written beside the target and renamed into place when complete, so a failure never leaves a partial file.
- The client's filename comes from the uploader, so only its base name is used, with unsafe characters replaced.
- The file is looked up at the path recorded for the submission. If it isn't there, or storage can't be read, the command says so and exits 1.
@williamjallen
williamjallen force-pushed the submission-download-command branch from 05abf10 to 9b20b6a Compare December 3, 2026 13:41
@williamjallen
williamjallen added this pull request to the merge queue Dec 3, 2026
Merged via the queue into Kitware:master with commit fcf69ac Dec 3, 2026
8 checks passed
@williamjallen
williamjallen deleted the submission-download-command branch December 3, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants