feat: derive build matrix from distros and PG versions in extension's metadata#251
Open
NiccoloFei wants to merge 5 commits into
Open
feat: derive build matrix from distros and PG versions in extension's metadata#251NiccoloFei wants to merge 5 commits into
NiccoloFei wants to merge 5 commits into
Conversation
… metadata Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Load order only matters for conflicts, e.g the same variable default or the same target attribute defined in both files. There was never a data-dependency reason to put metadata first. The override layering now works the intuitive way. docker-bake.hcl is the shared base, metadata.hcl is the per-extension layer that wins on conflicts (labels, args, file-level variable defaults), with annotations appending. Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Entries under requires.vars only support name and enum, there is no desc field in the schema. Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com> Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
GabriFedi97
approved these changes
Jun 26, 2026
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.
Description
Previously the build matrix was the cross-product of two hardcoded lists
(distributions × pgVersions), which forced:Compute the matrix instead from the explicit
(distro, PgMajor)pairs declared inmetadata.versions, so each extension can declare their own valid combinations:docker-bake.hcl:getBuildMatrix(): collapse the two distributions/pgVersions default variables into a singlebuildobject that contains explicit pairs of (distro, pgVersion), deriving them from
metadata.versionsgetBuildName()function to centralize the target name generation (this is useful because extension's that want to override variables or add extra args need to declare the correct bake target name insidemetadata.hcl)dagger/maintenance: mirror the new bake logic in the dagger module.buildMatrixnow holds explicit[]buildCombopairs with hasDistribution/contains helpers and deterministic ordering.parseBuildMatrix()now parses the extension'smetadata.hcldirectly instead of usingbake.ParseFiles()and resolving bothdocker-bake.hcl+metadata.hcltogether. Given that,github.com/docker/buildxis no longer needed and has been dropped as a module dependency (hence why all those indirect deps have been removed).UpdateOSLibs and GenerateCatalogs updated accordingly.
Added unit-tests for
buildMatrixFromMetadata()andbuildMatrixmethods.Fixed load order between
docker-bake.hclandmetadata.hclto ensure per-extension overriding/appending of labels/annotations/args etc. now works properly.Type of change
Closes #242
Contributor checklist
compliance (
git commit -s).mainbranch of the upstream repository.task checks:allpasses locally.tests pass (e.g.
task bake TARGET=<ext>,task e2e:test:full TARGET=<ext>).// renovate:comments touched inmetadata.hcl/README.mdremainintact (
suite=,depName=,extractVersion=).README.md,BUILD.md, ...) updated where relevant.Maintainer review checklist
// renovate:annotations preserved so automated version tracking keepsworking.
_sharedfilter in.github/workflows/bake.ymlwas updated when all extensions must rebuild.mainand is ready to merge.