Resolve PHP version dynamically from lang-php#45
Merged
Conversation
The lang-php S3 bucket no longer allows anonymous ListObjects, which broke all extension builds that depend on a php-8.X.* wildcard dep. Anonymous HEAD requests to specific objects still work, so we resolve the latest available PHP patch version by walking php/php-src GitHub releases newest-first and HEAD-checking each against lang-php until one is found. The exact version is then used as the dep instead of the wildcard, avoiding ListObjects entirely. https://claude.ai/code/session_01AFwaaf18yMZsVygqC4aF1Z
Replaces the inline Python script with a concise github-script step using the built-in github, core, and fetch objects. https://claude.ai/code/session_01AFwaaf18yMZsVygqC4aF1Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The
lang-phpS3 bucket (Heroku's upstream PHP package bucket) no longer allows anonymousListObjectsrequests. All extension builds specify aphp-8.X.*wildcard dep, which causes bob to callListObjectsto find the latest matching tarball — now blocked withAccessDenied. This broke every build across all PHP versions and stacks.Anonymous
HEADrequests to specific objects inlang-phpstill work fine.Fix
Add a Resolve PHP version step before the extension builds that:
php/php-srcGitHub releases API (newest first) for the minor version being builtHEADrequest againstlang-phpto check if the tarball existsPHP_VERSIONin$GITHUB_ENVAll subsequent build steps use
php-${{ env.PHP_VERSION }}(e.g.php-8.2.30) instead ofphp-${{ matrix.series.php }}.*(e.g.php-8.2.*). bob then fetches the specific object directly viaHEAD/GETinstead ofListObjects, bypassing the restriction entirely.This also means builds automatically pick up new PHP patch releases as Heroku publishes them to
lang-php, without any manual version bumping.https://claude.ai/code/session_01AFwaaf18yMZsVygqC4aF1Z