Stakeholders
Contributors
Approvers
Background/Context
Once a year a new PostgreSQL major version is released and maintained for five years: https://www.postgresql.org/support/versioning/
Each PostgreSQL major version comes with breaking changes:
- https://www.postgresql.org/docs/13/release-13.html#id-1.11.6.17.4
- https://www.postgresql.org/docs/14/release-14.html#id-1.11.6.14.4
- https://www.postgresql.org/docs/15/release-15.html#id-1.11.6.9.4
- https://www.postgresql.org/docs/16/release-16.html#RELEASE-16-MIGRATION
Therefore FOLIO needs to decide if that major release should be skipped or for which FOLIO flower release it should become officially supported technology.
Assumptions
To make an informed upgrade decision FOLIO needs information how FOLIO is affected by the breaking changes of the new major PostgreSQL version.
Many modules that connect to PostgreSQL use a PostgreSQL container for tests.
Constraints
Module evaluation is needed on request only once per year, we don't need additional costly CI pipelines for continuous evaluation.
Module tests are sufficient to uncover any database upgrade incompatibilities. No additional costly Karate integration tests are needed because it's very unlikely that they find an incompatibility not caught by unit tests.
Rationale
Make module tests configurable to run against a different PostgreSQL version to find any incompatibility the PostgreSQL version might cause.
This is a build time change only, it doesn't affect the runtime.
Proof of concept:
- mod-inventory-storage: https://github.com/folio-org/mod-inventory-storage/compare/master...julianladisch:mod-inventory-storage:TESTCONTAINERS_POSTGRES
- RMB: https://github.com/folio-org/raml-module-builder/pull/1130/files
The TESTCONTAINERS_POSTGRES_IMAGE code and GitHut Action workflow should be merged to the main/master branch of the each module repository that uses a PostgreSQL container for testing so it can be reused in the following years.
Decision
At build time FOLIO modules use TESTCONTAINERS_POSTGRES_IMAGE environment variable to change the default PostgreSQL container used for module unit tests (eg. maven-surefire-plugin) and module integration tests (eg. maven-failsafe-plugin).
FOLIO uses a GitHub Actions workflow in each repository that manually runs the module unit tests and module integration tests, and takes one or multiple PostgreSQL container names as input to set TESTCONTAINERS_POSTGRES_IMAGE.
This applies to modules that use a PostgreSQL container for module tests.
Due date: Quesnelia module release.
Implications
- Pros
- Cons
Other Related Resources
A separate Decision Record will be created for the migration away from PostgreSQL 12.