Skip to content

feat(php): fill Packagist metadata#3380

Open
countradooku wants to merge 3 commits into
apache:masterfrom
countradooku:feat/php-packagist-metadata
Open

feat(php): fill Packagist metadata#3380
countradooku wants to merge 3 commits into
apache:masterfrom
countradooku:feat/php-packagist-metadata

Conversation

@countradooku
Copy link
Copy Markdown
Contributor

Summary

  • fill out foreign/php/composer.json Packagist metadata: homepage, keywords, authors, support links, and an explicit empty autoload section
  • switch the package type to php-ext and add PIE php-ext metadata for the iggy_php extension
  • add archive exclusions so Composer package archives stay scoped to the PHP extension source and omit dev/test/vendor output

Closes #3303.

Validation

  • php -r 'json_decode(file_get_contents("foreign/php/composer.json"), true, flags: JSON_THROW_ON_ERROR);'
  • composer validate --strict foreign/php/composer.json
  • composer archive --format=zip from foreign/php and inspected the archive contents
  • PATH=/tmp/iggy-addlicense-bin:$PATH prek run --files foreign/php/composer.json
  • pre-push hook: cargo clippy passed; Go/Java/C# hooks skipped as no relevant files changed

Notes

The archive excludes use composer.json instead of root .gitattributes so Apache source-release archives created with git archive are not affected.

The PHP SDK composer manifest only had the minimum fields, which left the package thin for Packagist and PIE publication. Fill in discovery metadata, PIE extension metadata, and archive exclusions so the package has the expected Composer shape before publication is enabled.

Constraint: PIE extension packages require type php-ext and php-ext metadata; the extension name must be the publishable underscore form.

Rejected: Root .gitattributes export-ignore | it would affect Apache source-release git archives that intentionally package the full repository.

Confidence: high

Scope-risk: narrow

Directive: Keep archive exclusions compatible with running composer archive from foreign/php so source-build files such as Cargo.toml and .cargo/config.toml stay packaged.

Tested: php JSON_THROW_ON_ERROR decode of foreign/php/composer.json

Tested: composer validate --strict foreign/php/composer.json

Tested: composer archive --format=zip from foreign/php and inspected archive contents

Tested: PATH=/tmp/iggy-addlicense-bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/opt/homebrew/bin:/Users/radudiaconu/.vite-plus/bin:/Users/radudiaconu/.codex/tmp/arg0/codex-arg0noojQ9:/Users/radudiaconu/.opencode/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/4.0.0/bin:/Users/radudiaconu/.local/bin:/Users/radudiaconu/Library/Application Support/Herd/bin/:/Users/radudiaconu/.bun/bin:/opt/zerobrew/bin:/Users/radudiaconu/.zerobrew/bin:/Users/radudiaconu/.cargo/bin:/Users/radudiaconu/Library/Application Support/JetBrains/Toolbox/scripts:/Users/radudiaconu/Library/Android/sdk/platform-tools:/Applications/Codex.app/Contents/Resources:/Users/radudiaconu/Library/Application Support/JetBrains/Toolbox/scripts prek run --files foreign/php/composer.json
@countradooku countradooku marked this pull request as ready for review May 30, 2026 04:17
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label May 30, 2026
Comment thread foreign/php/composer.json Outdated
Comment thread foreign/php/composer.json
Comment thread foreign/php/composer.json
Comment thread foreign/php/composer.json Outdated
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Jun 1, 2026
Review pointed out that Composer archive exclusions are package-root relative and do not affect the GitHub source archives that Packagist and PIE consume. Move package filtering into a scoped foreign/php .gitattributes file and drop the empty native-extension autoload key.

Constraint: Public Packagist and PIE source fallback consume GitHub archives that honor export-ignore attributes, not composer archive.exclude.

Rejected: Root .gitattributes export-ignore | would affect Apache source-release archives for the full repository.

Confidence: high

Scope-risk: narrow

Directive: Keep build-critical PHP extension files such as Cargo.toml, .cargo/config.toml, README.md, src, and scripts packaged.

Tested: composer validate --strict foreign/php/composer.json

Tested: git check-attr export-ignore for PHP package include/exclude paths

Tested: PATH=/tmp/iggy-addlicense-bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/opt/homebrew/bin:/Users/radudiaconu/.vite-plus/bin:/Users/radudiaconu/.codex/tmp/arg0/codex-arg02FDRYS:/Users/radudiaconu/.opencode/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/4.0.0/bin:/Users/radudiaconu/.local/bin:/Users/radudiaconu/Library/Application Support/Herd/bin/:/Users/radudiaconu/.bun/bin:/opt/zerobrew/bin:/Users/radudiaconu/.zerobrew/bin:/Users/radudiaconu/.cargo/bin:/Users/radudiaconu/Library/Application Support/JetBrains/Toolbox/scripts:/Users/radudiaconu/Library/Android/sdk/platform-tools:/Applications/Codex.app/Contents/Resources:/Users/radudiaconu/Library/Application Support/JetBrains/Toolbox/scripts prek run --files foreign/php/composer.json foreign/php/.gitattributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author PR is waiting on author response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP SDK: fill out Packagist metadata

2 participants