diff --git a/docs/PERCONA_OBS_TOOL.md b/docs/PERCONA_OBS_TOOL.md index 9d0c2999b..235064c82 100644 --- a/docs/PERCONA_OBS_TOOL.md +++ b/docs/PERCONA_OBS_TOOL.md @@ -861,7 +861,14 @@ package's `macros.yaml` chain in the current checkout, so in a PR the values are the PR's. A project entry gets every package of the project (not its subprojects); an entry of a package-level `qa:` block (`package.yaml`) gets only that package. -Packages whose `_service` declares no version are left out. Test jobs check +Packages whose `_service` declares no version are left out. A project with no versioned +packages of its own (a container project) gets the versions of the local +projects its repositories build from (`subproject:` paths, in path order, the +first project providing a package winning), i.e. what its images install: +`ppg:staging:18:containers` gets `ppg:staging:18`'s versions. A project with no package versions of its own (a container project, whose +images declare none) gets the versions of the local projects its repositories +build from (`subproject:` paths), in path order, the first project providing a +package winning: `ppg:staging:18:containers` gets `ppg:staging:18`'s versions. Test jobs check installed software against these values instead of keeping their own copy, without depending on macro names. An entry that sets `EXPECTED_VERSIONS` itself keeps its value; jobs that do not declare the parameter ignore it. diff --git a/percona_obs/cmd_qa.py b/percona_obs/cmd_qa.py index 771b13000..28efddc9f 100644 --- a/percona_obs/cmd_qa.py +++ b/percona_obs/cmd_qa.py @@ -32,6 +32,7 @@ _print_pending, auto_rootprj_env, REPO_ROOT, + _load_project_config_with_inheritance, apply_macro_substitution, find_packages, load_macros, @@ -481,7 +482,7 @@ def _status_context( EXPECTED_VERSIONS_PARAM = "EXPECTED_VERSIONS" -def _package_versions(project: str) -> dict[str, str]: +def _own_package_versions(project: str) -> dict[str, str]: """Version of each package in *project*, keyed by OBS package name. The version is the one OBS builds: the ``version`` of the package's @@ -513,6 +514,37 @@ def _package_versions(project: str) -> dict[str, str]: return versions +def _package_versions(project: str) -> dict[str, str]: + """Package versions for *project*'s EXPECTED_VERSIONS. + + The project's own package versions (see ``_own_package_versions``). A + project with none of its own (a container project, whose images declare no + package version) tests what its images install: the packages of the local + projects its repositories build from (``subproject:`` paths), in path + order, the first project providing a package winning as in OBS's own + resolution. ppg:staging:18:containers thus gets ppg:staging:18's versions; + ppg:staging:18:extras:containers gets ppg:staging:18:extras's, then 18's, + before the previous major's. + """ + own = _own_package_versions(project) + if own: + return own + config = _load_project_config_with_inheritance(resolve_project_path(project)) + sources: list[str] = [] + for repo in config.get("repositories", []) or []: + for path_info in repo.get("paths", []) or []: + sub = path_info.get("subproject") if isinstance(path_info, dict) else None + if sub and sub != project and sub not in sources: + sources.append(sub) + versions: dict[str, str] = {} + for sub in sources: + if not resolve_project_path(sub).is_dir(): + continue + for name, version in _own_package_versions(sub).items(): + versions.setdefault(name, version) + return versions + + def _expected_versions(versions: dict[str, str], package: str | None = None) -> str: """``package=version`` lines, sorted by package name, for EXPECTED_VERSIONS. diff --git a/root/ppg/staging/16/extras/containers/project.yaml b/root/ppg/staging/16/extras/containers/project.yaml index d3899af02..fad41a47b 100644 --- a/root/ppg/staging/16/extras/containers/project.yaml +++ b/root/ppg/staging/16/extras/containers/project.yaml @@ -57,31 +57,15 @@ project-config: | PublishFlags: withsbom %endif +# QA: the custom (extras) image (docker-server-parallel-custom appends +# percona-distribution-postgresql-custom). qa: - - pipeline: docker-server-parallel-generic + - name: custom + pipeline: docker-server-parallel-custom parameters: - DOCKER_TAG: %!{PG_MAJOR_VERSION} - SERVER_VERSION: %!{PG_VERSION} - TESTING_BRANCH: ricardo-work + DOCKER_TAG: "%!{PG_MAJOR_VERSION}" + SERVER_VERSION: "%!{PG_VERSION}" + TESTING_BRANCH: main REPOSITORY: image: percona-distribution-postgresql-custom repository: ubi9 - WITH_POSTGIS: - - true - - false - matrix: - - WITH_POSTGIS - - - pipeline: ppg-obs-upgrade - parameters: - REPOSITORY: - image: percona-distribution-postgresql-custom - repository: ubi9 - OLD_SERVER_VERSION: "15.19" - NEW_SERVER_VERSION: %!{PG_VERSION} - UPGRADE_DOCKER_TAG: %!{PG_MAJOR_VERSION}-%!{PG_PREV_MAJOR_VERSION} - OLD_DOCKER_REPOSITORY: - image: percona-distribution-postgresql-custom - project: ppg:staging:%!{PG_PREV_MAJOR_VERSION}:extras:containers - repository: ubi9 - TESTING_BRANCH: ricardo-work diff --git a/root/ppg/staging/17/extras/containers/project.yaml b/root/ppg/staging/17/extras/containers/project.yaml index e8a801201..fad41a47b 100644 --- a/root/ppg/staging/17/extras/containers/project.yaml +++ b/root/ppg/staging/17/extras/containers/project.yaml @@ -57,31 +57,15 @@ project-config: | PublishFlags: withsbom %endif +# QA: the custom (extras) image (docker-server-parallel-custom appends +# percona-distribution-postgresql-custom). qa: - - pipeline: docker-server-parallel-generic + - name: custom + pipeline: docker-server-parallel-custom parameters: - DOCKER_TAG: %!{PG_MAJOR_VERSION} - SERVER_VERSION: %!{PG_VERSION} - TESTING_BRANCH: ricardo-work + DOCKER_TAG: "%!{PG_MAJOR_VERSION}" + SERVER_VERSION: "%!{PG_VERSION}" + TESTING_BRANCH: main REPOSITORY: image: percona-distribution-postgresql-custom repository: ubi9 - WITH_POSTGIS: - - true - - false - matrix: - - WITH_POSTGIS - - - pipeline: ppg-obs-upgrade - parameters: - REPOSITORY: - image: percona-distribution-postgresql-custom - repository: ubi9 - OLD_SERVER_VERSION: "16.15" - NEW_SERVER_VERSION: %!{PG_VERSION} - UPGRADE_DOCKER_TAG: %!{PG_MAJOR_VERSION}-%!{PG_PREV_MAJOR_VERSION} - OLD_DOCKER_REPOSITORY: - image: percona-distribution-postgresql-custom - project: ppg:staging:%!{PG_PREV_MAJOR_VERSION}:extras:containers - repository: ubi9 - TESTING_BRANCH: ricardo-work diff --git a/root/ppg/staging/18/extras/containers/project.yaml b/root/ppg/staging/18/extras/containers/project.yaml index 1f28f1e2f..fad41a47b 100644 --- a/root/ppg/staging/18/extras/containers/project.yaml +++ b/root/ppg/staging/18/extras/containers/project.yaml @@ -57,31 +57,15 @@ project-config: | PublishFlags: withsbom %endif +# QA: the custom (extras) image (docker-server-parallel-custom appends +# percona-distribution-postgresql-custom). qa: - - pipeline: docker-server-parallel-generic + - name: custom + pipeline: docker-server-parallel-custom parameters: - DOCKER_TAG: %!{PG_MAJOR_VERSION} - SERVER_VERSION: %!{PG_VERSION} - TESTING_BRANCH: ricardo-work + DOCKER_TAG: "%!{PG_MAJOR_VERSION}" + SERVER_VERSION: "%!{PG_VERSION}" + TESTING_BRANCH: main REPOSITORY: image: percona-distribution-postgresql-custom repository: ubi9 - WITH_POSTGIS: - - true - - false - matrix: - - WITH_POSTGIS - - - pipeline: ppg-obs-upgrade - parameters: - REPOSITORY: - image: percona-distribution-postgresql-custom - repository: ubi9 - OLD_SERVER_VERSION: "17.11" - NEW_SERVER_VERSION: %!{PG_VERSION} - UPGRADE_DOCKER_TAG: %!{PG_MAJOR_VERSION}-%!{PG_PREV_MAJOR_VERSION} - OLD_DOCKER_REPOSITORY: - image: percona-distribution-postgresql-custom - project: ppg:staging:%!{PG_PREV_MAJOR_VERSION}:extras:containers - repository: ubi9 - TESTING_BRANCH: ricardo-work diff --git a/root/ppg/staging/_shared/containers/project.yaml b/root/ppg/staging/_shared/containers/project.yaml index d3d76eb7d..1886bb5c5 100644 --- a/root/ppg/staging/_shared/containers/project.yaml +++ b/root/ppg/staging/_shared/containers/project.yaml @@ -141,14 +141,15 @@ project-config: | %endif - +# QA: the server image per UBI base, with and without PostGIS +# (docker-server-parallel appends percona-distribution-postgresql[-with-postgis]). qa: - name: ubi8 - pipeline: docker-server-parallel-generic + pipeline: docker-server-parallel parameters: DOCKER_TAG: "%!{PG_MAJOR_VERSION}" SERVER_VERSION: "%!{PG_VERSION}" - TESTING_BRANCH: ricardo-work + TESTING_BRANCH: main REPOSITORY: image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs repository: ubi8 @@ -159,11 +160,11 @@ qa: - WITH_POSTGIS - name: ubi9 - pipeline: docker-server-parallel-generic + pipeline: docker-server-parallel parameters: DOCKER_TAG: "%!{PG_MAJOR_VERSION}" SERVER_VERSION: "%!{PG_VERSION}" - TESTING_BRANCH: ricardo-work + TESTING_BRANCH: main REPOSITORY: image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs repository: ubi9 @@ -174,11 +175,11 @@ qa: - WITH_POSTGIS - name: ubi10 - pipeline: docker-server-parallel-generic + pipeline: docker-server-parallel parameters: DOCKER_TAG: "%!{PG_MAJOR_VERSION}" SERVER_VERSION: "%!{PG_VERSION}" - TESTING_BRANCH: ricardo-work + TESTING_BRANCH: main REPOSITORY: image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs repository: ubi10 diff --git a/root/ppg/staging/common/containers/project.yaml b/root/ppg/staging/common/containers/project.yaml index d80a8c8e0..7c8bc2965 100644 --- a/root/ppg/staging/common/containers/project.yaml +++ b/root/ppg/staging/common/containers/project.yaml @@ -167,15 +167,31 @@ project-config: | %endif - +# QA: major-version upgrades with the pg_upgrade mediator image built here; +# the old and new server images are named in their per-major projects. qa: - - name: ubi8 - pipeline: docker-server-parallel-generic + - name: ubi8-14-to-15 + pipeline: docker-server-parallel-upgrade parameters: - DOCKER_TAG: "%!{PG_MAJOR_VERSION}" - SERVER_VERSION: "%!{PG_VERSION}" - TESTING_BRANCH: ricardo-work + OLD_SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + NEW_SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "14" + NEW_VERSION_DOCKER_TAG: "15" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:15:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:14:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:15:containers + UPGRADE_REPOSITORY: image: percona-distribution-postgresql-upgrade repository: ubi8 WITH_POSTGIS: @@ -184,13 +200,118 @@ qa: matrix: - WITH_POSTGIS - - name: ubi9 - pipeline: docker-server-parallel-generic + - name: ubi8-15-to-16 + pipeline: docker-server-parallel-upgrade parameters: - DOCKER_TAG: "%!{PG_MAJOR_VERSION}" - SERVER_VERSION: "%!{PG_VERSION}" - TESTING_BRANCH: ricardo-work + OLD_SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + NEW_SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "15" + NEW_VERSION_DOCKER_TAG: "16" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:16:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:15:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:16:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi8 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi8-16-to-17 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + NEW_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "16" + NEW_VERSION_DOCKER_TAG: "17" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:17:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:16:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:17:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi8 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi8-17-to-18 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + NEW_SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "17" + NEW_VERSION_DOCKER_TAG: "18" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:18:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:17:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi8 + project: ppg:staging:18:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi8 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi9-14-to-15 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + NEW_SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "14" + NEW_VERSION_DOCKER_TAG: "15" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:15:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:14:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:15:containers + UPGRADE_REPOSITORY: image: percona-distribution-postgresql-upgrade repository: ubi9 WITH_POSTGIS: @@ -199,13 +320,208 @@ qa: matrix: - WITH_POSTGIS - - name: ubi10 - pipeline: docker-server-parallel-generic + - name: ubi9-15-to-16 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + NEW_SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "15" + NEW_VERSION_DOCKER_TAG: "16" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:16:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:15:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:16:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi9 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi9-16-to-17 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + NEW_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "16" + NEW_VERSION_DOCKER_TAG: "17" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:17:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:16:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:17:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi9 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi9-17-to-18 + pipeline: docker-server-parallel-upgrade parameters: - DOCKER_TAG: "%!{PG_MAJOR_VERSION}" - SERVER_VERSION: "%!{PG_VERSION}" - TESTING_BRANCH: ricardo-work + OLD_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + NEW_SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "17" + NEW_VERSION_DOCKER_TAG: "18" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:18:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:17:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi9 + project: ppg:staging:18:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi9 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi10-14-to-15 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + NEW_SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "14" + NEW_VERSION_DOCKER_TAG: "15" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:15:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:14:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:15:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi10 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi10-15-to-16 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + NEW_SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "15" + NEW_VERSION_DOCKER_TAG: "16" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:16:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:15:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:16:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi10 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi10-16-to-17 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + NEW_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "16" + NEW_VERSION_DOCKER_TAG: "17" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:17:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:16:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:17:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade + repository: ubi10 + WITH_POSTGIS: + - true + - false + matrix: + - WITH_POSTGIS + + - name: ubi10-17-to-18 + pipeline: docker-server-parallel-upgrade + parameters: + OLD_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + NEW_SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "17" + NEW_VERSION_DOCKER_TAG: "18" + UPGRADE_DOCKER_TAG: "18-17-16-15-14" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:18:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:17:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql # names the plain image only; see "Image references" in docs + repository: ubi10 + project: ppg:staging:18:containers + UPGRADE_REPOSITORY: image: percona-distribution-postgresql-upgrade repository: ubi10 WITH_POSTGIS: diff --git a/root/ppg/staging/common/extras/containers/project.yaml b/root/ppg/staging/common/extras/containers/project.yaml index 3732d939f..0c3c7a478 100644 --- a/root/ppg/staging/common/extras/containers/project.yaml +++ b/root/ppg/staging/common/extras/containers/project.yaml @@ -69,12 +69,54 @@ project-config: | PublishFlags: withsbom %endif +# QA: custom-image upgrades with the mediator image built here. qa: - pipeline: docker-server-parallel-generic - parameters: - DOCKER_TAG: "%!{PG_MAJOR_VERSION}" - SERVER_VERSION: "%!{PG_VERSION}" - TESTING_BRANCH: ricardo-work - REPOSITORY: - image: percona-distribution-postgresql-upgrade-custom - repository: ubi9 + - name: ubi9-16-to-17 + pipeline: docker-server-parallel-custom-upgrade + parameters: + OLD_SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + NEW_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "16" + NEW_VERSION_DOCKER_TAG: "17" + UPGRADE_DOCKER_TAG: "18-17-16" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql-custom + repository: ubi9 + project: ppg:staging:17:extras:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql-custom + repository: ubi9 + project: ppg:staging:16:extras:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql-custom + repository: ubi9 + project: ppg:staging:17:extras:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade-custom + repository: ubi9 + + - name: ubi9-17-to-18 + pipeline: docker-server-parallel-custom-upgrade + parameters: + OLD_SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + NEW_SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + OLD_VERSION_DOCKER_TAG: "17" + NEW_VERSION_DOCKER_TAG: "18" + UPGRADE_DOCKER_TAG: "18-17-16" + TESTING_BRANCH: main + REPOSITORY: + image: percona-distribution-postgresql-custom + repository: ubi9 + project: ppg:staging:18:extras:containers + OLD_REPOSITORY: + image: percona-distribution-postgresql-custom + repository: ubi9 + project: ppg:staging:17:extras:containers + NEW_REPOSITORY: + image: percona-distribution-postgresql-custom + repository: ubi9 + project: ppg:staging:18:extras:containers + UPGRADE_REPOSITORY: + image: percona-distribution-postgresql-upgrade-custom + repository: ubi9 diff --git a/root/ppg/staging/common/tools/containers/project.yaml b/root/ppg/staging/common/tools/containers/project.yaml index 87e827839..640618c7f 100644 --- a/root/ppg/staging/common/tools/containers/project.yaml +++ b/root/ppg/staging/common/tools/containers/project.yaml @@ -178,3 +178,546 @@ project-config: | Prefer: python3.12-psycopg2 python3.12-etcd %endif + +# QA: the pgBackRest and pgBouncer images built here, each run against every +# major's server image (SERVER_REPOSITORY names it in that major's project). +qa: + - name: ubi8-pgbackrest-pg14 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "14" + SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:14:containers + + - name: ubi8-pgbackrest-pg15 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "15" + SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:15:containers + + - name: ubi8-pgbackrest-pg16 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "16" + SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:16:containers + + - name: ubi8-pgbackrest-pg17 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "17" + SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:17:containers + + - name: ubi8-pgbackrest-pg18 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "18" + SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:18:containers + + - name: ubi8-pgbouncer-pg14 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "14" + SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:14:containers + + - name: ubi8-pgbouncer-pg15 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "15" + SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:15:containers + + - name: ubi8-pgbouncer-pg16 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "16" + SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:16:containers + + - name: ubi8-pgbouncer-pg17 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "17" + SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:17:containers + + - name: ubi8-pgbouncer-pg18 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "18" + SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi8 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi8 + project: ppg:staging:18:containers + + - name: ubi9-pgbackrest-pg14 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "14" + SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:14:containers + + - name: ubi9-pgbackrest-pg15 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "15" + SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:15:containers + + - name: ubi9-pgbackrest-pg16 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "16" + SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:16:containers + + - name: ubi9-pgbackrest-pg17 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "17" + SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:17:containers + + - name: ubi9-pgbackrest-pg18 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "18" + SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:18:containers + + - name: ubi9-pgbouncer-pg14 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "14" + SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:14:containers + + - name: ubi9-pgbouncer-pg15 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "15" + SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:15:containers + + - name: ubi9-pgbouncer-pg16 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "16" + SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:16:containers + + - name: ubi9-pgbouncer-pg17 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "17" + SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:17:containers + + - name: ubi9-pgbouncer-pg18 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "18" + SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi9 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi9 + project: ppg:staging:18:containers + + - name: ubi10-pgbackrest-pg14 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "14" + SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:14:containers + + - name: ubi10-pgbackrest-pg15 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "15" + SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:15:containers + + - name: ubi10-pgbackrest-pg16 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "16" + SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:16:containers + + - name: ubi10-pgbackrest-pg17 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "17" + SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:17:containers + + - name: ubi10-pgbackrest-pg18 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbackrest + DOCKER_COMPONENT_TAG: "%!{PGBACKREST_VERSION}" + COMPONENT_VERSION: "%!{PGBACKREST_VERSION}" + DOCKER_SERVER_TAG: "18" + SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbackrest + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:18:containers + + - name: ubi10-pgbouncer-pg14 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "14" + SERVER_VERSION: "14.%!{PG_14_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:14:containers + + - name: ubi10-pgbouncer-pg15 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "15" + SERVER_VERSION: "15.%!{PG_15_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:15:containers + + - name: ubi10-pgbouncer-pg16 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "16" + SERVER_VERSION: "16.%!{PG_16_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:16:containers + + - name: ubi10-pgbouncer-pg17 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "17" + SERVER_VERSION: "17.%!{PG_17_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:17:containers + + - name: ubi10-pgbouncer-pg18 + pipeline: docker-component-parallel + parameters: + COMPONENT: pgbouncer + DOCKER_COMPONENT_TAG: "%!{PGBOUNCER_VERSION}" + COMPONENT_VERSION: "%!{PGBOUNCER_VERSION}" + DOCKER_SERVER_TAG: "18" + SERVER_VERSION: "18.%!{PG_18_MINOR_VERSION}" + WITH_TDE: false + TESTING_BRANCH: main + REPOSITORY: + image: percona-pgbouncer + repository: ubi10 + SERVER_REPOSITORY: + image: percona-distribution-postgresql + repository: ubi10 + project: ppg:staging:18:containers diff --git a/tests/test_qa_entry_name.py b/tests/test_qa_entry_name.py index bc2db8f55..30d0fda3f 100644 --- a/tests/test_qa_entry_name.py +++ b/tests/test_qa_entry_name.py @@ -241,11 +241,16 @@ def test_container_projects_name_all_lanes(): for rel in ( "ppg/staging/_shared/containers/project.yaml", "ppg/staging/common/containers/project.yaml", + "ppg/staging/common/tools/containers/project.yaml", ): text = (repo_root / rel).read_text(encoding="utf-8") qa = yaml.safe_load(text.replace("%!{", "${"))["qa"] - assert isinstance(qa, list) and len(qa) == 3, rel - assert [e["name"] for e in qa] == ["ubi8", "ubi9", "ubi10"], rel + assert isinstance(qa, list), rel + names = [e.get("name") for e in qa] + # every lane is named (distinct checks), and each UBI base has lanes + assert all(names) and len(names) == len(set(names)), rel + for ubi in ("ubi8", "ubi9", "ubi10"): + assert any(n == ubi or n.startswith(ubi + "-") for n in names), (rel, ubi) def test_qa_name_charset_is_validated(tmp_path, monkeypatch): diff --git a/tests/test_qa_expected_versions.py b/tests/test_qa_expected_versions.py index b90a0cc19..8b3f71772 100644 --- a/tests/test_qa_expected_versions.py +++ b/tests/test_qa_expected_versions.py @@ -181,3 +181,63 @@ def test_qa_run_dry_run_shows_it(tmp_path, monkeypatch, capsys): cmd_qa.cmd_qa_run(args) out = capsys.readouterr().out assert "EXPECTED_VERSIONS" in out and "percona-pgbackrest=2.59.2" in out + + +def _container_tree(tmp_path, monkeypatch): + """ppg/staging/{17,18} package projects and 18:containers building from them.""" + root = tmp_path / "root" + staging = root / "ppg" / "staging" + for major, pgbackrest, pgaudit in ( + ("17", "2.59.2", "17.1"), + ("18", "2.59.2", "18.0"), + ): + d = staging / major + _package(d / "percona-pgbackrest", service=_service(pgbackrest)) + _package(d / "percona-pgaudit", service=_service(pgaudit)) + (d / "project.yaml").write_text("title: P\n") + _package(staging / "17" / "percona-only17", service=_service("1.0")) + containers = staging / "18" / "containers" + _package(containers / "percona-distribution-postgresql", service="") + (containers / "project.yaml").write_text( + "title: C\n" + "repositories:\n" + " - name: ubi9\n" + " paths:\n" + " - project: RedHat:UBI:Registry\n" + " repository: images\n" + " - subproject: ppg:staging:18\n" + " repository: UBI_9\n" + " - subproject: ppg:staging:17\n" + " repository: UBI_9\n" + " archs: [x86_64]\n" + "qa:\n" + " - name: ubi9\n" + " pipeline: docker-server-parallel\n" + " parameters:\n" + " DOCKER_TAG: '18'\n" + ) + monkeypatch.setattr(common, "REPO_ROOT", root) + monkeypatch.setattr(cmd_qa, "REPO_ROOT", root) + + +def test_container_project_gets_the_versions_its_images_build_from( + tmp_path, monkeypatch, capsys +): + _container_tree(tmp_path, monkeypatch) + lines = _show("ppg:staging:18:containers", capsys)["ubi9"][ + "EXPECTED_VERSIONS" + ].split("\n") + # first path (18) wins over the second (17); packages only in 17 still appear + assert lines == [ + "percona-only17=1.0", + "percona-pgaudit=18.0", + "percona-pgbackrest=2.59.2", + ] + + +def test_project_with_own_versions_does_not_follow_paths(tmp_path, monkeypatch): + _container_tree(tmp_path, monkeypatch) + assert cmd_qa._package_versions("ppg:staging:18") == { + "percona-pgaudit": "18.0", + "percona-pgbackrest": "2.59.2", + }