Skip to content

Commit

Permalink
Minor cleanup for platform repo priorities tests and docs
Browse files Browse the repository at this point in the history
Fix the repos (and the build docs examples) to have objects with version arrays for each package, as Composer prefers it (and how all the tooling has been generating it for a while). No big thing, as the 'old way' still works (but throws a warning, which doesn't affect the tests though).

Also restructure the corresponding test to have a sub-group that describes which test case ran.

GUS-W-17622481
  • Loading branch information
dzuelke committed Jan 17, 2025
1 parent 90e5759 commit f52f5ea
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 75 deletions.
30 changes: 20 additions & 10 deletions support/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,22 +446,32 @@ As package of type `heroku-sys-php` may come bundled with a bunch of extensions,

The repository is a `packages.json` of all manifests, which can be used by Composer as a `packagist` repository type. See [Usage in Applications](#usage-in-applications) for instructions on how to use such a repository with an application.

The structure of a `packagist` type repository is a struct with a single key "`packages`", which is an array containing another array (!) which is a list of all the manifest structs:
The structure of a `packagist` type repository is a struct with a single key "`packages`", which is a hash of package names containing arrays of all the individual manifest structs for that package (in different versions):

{
"packages": [
[
"packages": {
"heroku-sys/php": [
{
"name": "heroku-sys/php",
"version": "8.4.1",
},
{
"name": "heroku-sys/php"
"name": "heroku-sys/php",
"version": "8.4.2",
},
],
"heroku-sys/ext-foobar": [
{
"name": "heroku-sys/ext-foobar"
"name": "heroku-sys/ext-foobar",
"version": "1.0.0",
}
},
]
]
}
}


Expand Down Expand Up @@ -802,8 +812,8 @@ Name this tarball `ext-myext-1.2.3_php-7.3.tar.gz` and make it available at `htt
Assuming that the extension has no stack-specific requirements (meaning it can run on any stack), you can then have a repository at `https://download.example.com/heroku/packages.json` with the following contents:

{
"packages": [
[
"packages": {
"heroku-sys/ext-myext": [
{
"name": "heroku-sys/ext-myext",
"version": "1.2.3",
Expand All @@ -819,7 +829,7 @@ Assuming that the extension has no stack-specific requirements (meaning it can r
"time": "WHEN DID MCFLY COME BACK FROM THE FUTURE",
}
]
]
}
}

**Remember the warning above about version ordering: the PHP 7.3 variant of `ext-myext` version 1.2.3 must be listed before the PHP 7.2 variant, and so forth, to ensure Composer picks the highest possible PHP version.**
Expand Down
Loading

0 comments on commit f52f5ea

Please sign in to comment.