Support packages with empty source fields in archive builder #1049
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes packages like
phpstan/phpstan
that use empty source fields to prevent repository cloning from crashing Satis during archive building.Problem
When packages configure empty source fields in their
composer.json
to prevent cloning (as recommended for large repositories):Satis would crash with:
This happens because Satis attempts to create archives for packages that have neither valid source nor dist information available for archiving.
Solution
Modified
ArchiveBuilderHelper::isSkippable()
to detect and gracefully skip packages with empty source and dist fields during the archive building process. These packages are skipped with an informative log message:Implementation
The fix adds a validation check before archiving:
This approach ensures Satis behavior matches the rest of the Composer ecosystem while maintaining full backward compatibility.
Testing
Closes #XXX
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/bovigo/vfsStream/zipball/fe695ec993e0a55c3abdda10a9364eb31c6f1bf0
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/ca-bundle/zipball/719026bb30813accb68271fee7e39552a58e9f65
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/class-map-generator/zipball/ba9f089655d4cdd64e762a6044f411ccdaec0076
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/composer/zipball/3e38919bc9a2c3c026f2151b5e56d04084ce8f0b
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/spdx-licenses/zipball/edf364cefe8c43501e21e88110aac10b284c3c9f
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/jsonrainbow/json-schema/zipball/ac0d369c09653cf7af561f6d91a705bc617a87b8
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/marc-mabe/php-enum/zipball/bb426fcdd65c60fb3638ef741e8782508fda7eef
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/console/zipball/2b9c5fafbac0399a20a2e82429e2bd735dcfb7db
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/filesystem/zipball/edcbb768a186b5c3f25d0643159a787d3e63b7fd
/usr/bin/php8.3 -n -c /tmp/b2LLr8 /usr/bin/composer install --no-dev
(http block)/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/finder/zipball/2a6614966ba1074fa93dae0bc804227422df4dfe
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638
/usr/bin/php8.3 -n -c /tmp/b2LLr8 /usr/bin/composer install --no-dev
(http block)/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
/usr/bin/php8.3 -n -c /tmp/b2LLr8 /usr/bin/composer install --no-dev
(http block)/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608
/usr/bin/php8.3 -n -c /tmp/b2LLr8 /usr/bin/composer install --no-dev
(http block)/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872
/usr/bin/php8.3 -n -c /tmp/eK7nT7 /usr/bin/composer install --no-interaction
(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.