Feature request: built-in scheme for #tool to download an arbitrary HTTPS .zip file
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 3h 37m
- Merged PRs (30d)
- 21
Description
### Parameters
- **Version** parameter: **no**.
There would be no notion of the downloaded tool having a version, so no `version` or `prerelease` parameters.
- **Format** parameter: **maybe**
The format could be autodetected from the content type or file contents in case you eventually support archive formats other than .zip. There probably wouldn't be a need for a `type`/`format` parameter but it might be desirable.
- **Checksum** parameter: **I want this.**
Even if the download is over HTTPS, it's nice to know if something else starts getting served. This would make HTTP/FTP URLs safe too.
If the checksum is missing, Cake could download the file and then include the checksum in an error message requiring the checksum to be present in the .cake file.
Since query parameters in the same URL would collide with the URL to use for the download whether or not they are excluded when downloading, there would need to be a new way to handle this.
### Proposal
`#tool download:` followed by a URL. If the URL contains a comma, it must be URL-encoded.
A parameter may be specified no more than once. Some parameters are required. To specify a parameter, add a comma to the end of the line followed by the parameter name, an equals sign, and a parameter value. If the parameter value contains a double quote character or comma, the whole parameter value must be double-quoted.
Valid parameter names:
- `checksum`: Required. Value must start with `SHA256:` and the remainder must be 32 hex characters, case-insensitive. Future checksums may be supported.
```cs
#tool download:http://static.wixtoolset.org/releases/v3.14.0.3910/wix314-binaries.zip, checksum=SHA256:0904A88A4BCD9DD3C2274CAABE73989CD72767EE90C8FA0BF813D004EEC90D32
```
### Questions
1. Is a `format` parameter desirable even if multiple formats become supported?
2. Should there be support for the `file` scheme or absolute or relative or Windows UNC paths?
3. Should `checksum` be allowed to be omitted for HTTPS downloads? What about HTTP/FTP/file schemes?
Contributor guide
Research direction
No implementation file, test, or entry point is named. Start by reviewing the proposal and resolving the open questions about formats, supported schemes, query parameters, and checksum requirements. Done means the agreed #tool download behavior is implemented and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100