[ADD] postgis_extension copier flag for geo-dependent OCA repos - #354
Closed
dnplkndll wants to merge 1 commit into
Closed
[ADD] postgis_extension copier flag for geo-dependent OCA repos#354dnplkndll wants to merge 1 commit into
dnplkndll wants to merge 1 commit into
Conversation
Adds a boolean copier option (default: no) that swaps the CI postgres service from the vanilla image to postgis/postgis:<pg>-<postgis> when the repo installs Odoo modules that need PostGIS (geo_* field types, base_geoengine, etc.). WHY Today, every PR on OCA/geospatial needs to hand-patch .github/workflows/test.yml to swap the postgres image, otherwise 'CREATE EXTENSION postgis' fails at install time and the test job dies with 'could not open extension control file postgis.control'. The 17.0 and 18.0 branches of OCA/geospatial already shipped a postgis/postgis:13-3.4 override, but each copier update wipes that modification — so reviewers see the workflow patch as 'out of scope' on every cohort PR and authors have to defend it (see e.g. OCA/geospatial#446 where the workflow change triggered a multi-turn thread). This flag makes the override declarative — set 'postgis_extension: yes' once in copier-answers.yml, and the workflow regenerates with the right image on every future copier update. IMAGE CHOICE Conservative defaults aligned with the existing postgres-version ladder: - odoo_version < 16 -> postgis/postgis:13-3.4 - 16 <= odoo_version < 19 -> postgis/postgis:13-3.4 - odoo_version >= 19 -> postgis/postgis:14-3.5 VALIDATION Tested against the integrated OCA/geospatial 19.0 cohort (PRs #446 + #450 + #451 + #452 + #453) merged on a fork branch: https://github.com/ledoent/geospatial/actions/runs/26052247018 All three test jobs (test with Odoo, test with OCB, Detect unreleased dependencies) pass green with postgis/postgis:14-3.5 driving install + tests for base_geoengine + geoengine_partner + geoengine_base_geolocalize + website_geoengine + website_geoengine_store_locator. OPT-IN BEHAVIOR Default is 'no'. Repos with no geo modules see zero diff after copier update; the postgres:* images stay exactly as today.
Contributor
Author
|
@sbidoul — worth a look? Tiny default-off flag mirroring Toil evidence: test.yml has been re-patched after every dotfiles regen — 17.0: 5 |
dnplkndll
marked this pull request as ready for review
May 18, 2026 19:42
Member
|
Thanks for this contrib. A somewhat simpler solution to achieve the same goal has been merged in #355. |
Contributor
Author
|
nice, have not considered the other ext cases like pgvector. thanks for the update. |
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.
Why
OCA/geospatial 17.0 and 18.0 already ship
postgis/postgis:13-3.4as their CI postgres service soCREATE EXTENSION postgissucceeds at module install time. Everycopier updatewipes that override because the vanilla template hardcodespostgres:*, so every cohort PR has to re-patch.github/workflows/test.ymland defend it as in-scope. See OCA/geospatial#446 for the canonical example of a workflow-change defense thread.This flag makes the override declarative — set
postgis_extension: yesonce in the repo'scopier-answers.yml, and the workflow regenerates with the right image on every futurecopier update. Eliminates a recurring toil for geospatial-flavored OCA repos.What
copier.ymlbooleanpostgis_extension, defaultno, gated toodoo_version >= 16(postgis/postgis:9.6-* tags are EOL).src/.github/workflows/test.yml.jinjathat swapspostgres:*→postgis/postgis:<pg>-<postgis>when the flag is on:16 ≤ odoo < 19→postgis/postgis:13-3.4(matches OCA/geospatial 17.0 + 18.0 baseline)odoo ≥ 19→postgis/postgis:14-3.5(matches the choice in [19.0][MIG] base_geoengine: migrate to 19.0 geospatial#446)Both PG versions are inside Odoo's documented PostgreSQL support window (Odoo 17/18 → PG 12-16, Odoo 19 → PG 13-17).
Validation
Aggregated the OCA/geospatial 19.0 cohort (#446 + #450 + #451 + #452 + #453) onto a single branch on the ledoent fork and ran CI with the equivalent workflow change:
https://github.com/ledoent/geospatial/actions/runs/26052247018
All three jobs pass green with
postgis/postgis:14-3.5driving install + tests forbase_geoengine+geoengine_partner+geoengine_base_geolocalize+website_geoengine+website_geoengine_store_locator:test with Odootest with OCBDetect unreleased dependenciesBackwards compatibility
default: no— repos that don't opt in see zero diff on their nextcopier update. The vanillapostgres:*images stay exactly as today for every existing OCA repo. Only repos that explicitly setpostgis_extension: yes(today: OCA/geospatial; in the future: any geo-flavored OCA repo) get the postgis variant.