Skip to content

Commit 586683f

Browse files
authored
Minor cleanup for platform repo priorities tests and docs (#773)
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
1 parent 90e5759 commit 586683f

File tree

5 files changed

+174
-75
lines changed

5 files changed

+174
-75
lines changed

support/build/README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,22 +446,32 @@ As package of type `heroku-sys-php` may come bundled with a bunch of extensions,
446446

447447
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.
448448

449-
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:
449+
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):
450450

451451
{
452-
"packages": [
453-
[
452+
"packages": {
453+
"heroku-sys/php": [
454+
{
455+
"name": "heroku-sys/php",
456+
"version": "8.4.1",
457+
458+
},
454459
{
455-
"name": "heroku-sys/php"
460+
"name": "heroku-sys/php",
461+
"version": "8.4.2",
456462
457463
},
458464
465+
],
466+
"heroku-sys/ext-foobar": [
459467
{
460-
"name": "heroku-sys/ext-foobar"
468+
"name": "heroku-sys/ext-foobar",
469+
"version": "1.0.0",
461470
462-
}
471+
},
472+
463473
]
464-
]
474+
}
465475
}
466476

467477

@@ -802,8 +812,8 @@ Name this tarball `ext-myext-1.2.3_php-7.3.tar.gz` and make it available at `htt
802812
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:
803813

804814
{
805-
"packages": [
806-
[
815+
"packages": {
816+
"heroku-sys/ext-myext": [
807817
{
808818
"name": "heroku-sys/ext-myext",
809819
"version": "1.2.3",
@@ -819,7 +829,7 @@ Assuming that the extension has no stack-specific requirements (meaning it can r
819829
"time": "WHEN DID MCFLY COME BACK FROM THE FUTURE",
820830
}
821831
]
822-
]
832+
}
823833
}
824834

825835
**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.**

0 commit comments

Comments
 (0)