Archive file name does not conform to the specified archive format
- Dominant language
- PHP
- Stars
- 3.3k
- Forks
- 530
- Avg merge
- 6h 53m
- Merged PRs (30d)
- 13
Description
When the `dist type` of the remote archive is different with the `dist type` specified in `satis.json`, the `remote dist type` is used as part of the file name of the archive generated by `satis`, take the following scenario as an example:
```bash
$ cd ~
$ composer create-project composer/satis:dev-master --keep-vcs
$ mkdir satis.server
$ vi satis.server/satis.json
$ # Update satis.json with the following content:
```
```json
{
"name": "satis/test",
"homepage": "https://github.com/composer/satis",
"repositories": [
{ "type": "composer", "url": "https://packagist.org" }
],
"require": {
"monolog/monolog": "1.13.0"
},
"config": {
"secure-http": false
},
"require-dependencies": false,
"require-dev-dependencies": false,
"archive": {
"directory": "dist",
"format": "tar",
"prefix-url": "http://satis.localhost:4680",
"skip-dev": false
}
}
```
```bash
$ satis/bin/satis satis.server/satis.json satis.server
$ ls satis.server/dist/monolog/monolog
$ # The archive file is as follows:
$ monolog-monolog-c41c218e239b50446fd883acb1ecfd4b770caeae-zip-d4a976.tar
```
> NOTE: The dist type `zip` of the remote archive is preserved as part of the archive file name `monolog-monolog-c41c218e239b50446fd883acb1ecfd4b770caeae-zip-d4a976.tar`, this causes a problem when the satis.server is used as an upstream cache for other satis instances because when a 2nd level ratis server fetches archive from the upstream one, the archive will be renamed to `monolog-monolog-c41c218e239b50446fd883acb1ecfd4b770caeae-tar-d4a976.tar`, which causes a cache miss every time.
To fix this issue, an option `override-dist-type` should be added to the `archive` section, when it is set to true, the local dist type takes precendence over the remote one.
Contributor guide
Research direction
Start at the satis/bin/satis entry point and reproduce the archive scenario using the satis.json configuration and commands in the report. Trace how the remote and configured archive formats affect the generated filename, then verify that the configured format is consistently honored when the repository is used as an upstream cache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100