Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/PERCONA_OBS_TOOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
34 changes: 33 additions & 1 deletion percona_obs/cmd_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
_print_pending,
auto_rootprj_env,
REPO_ROOT,
_load_project_config_with_inheritance,
apply_macro_substitution,
find_packages,
load_macros,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
30 changes: 7 additions & 23 deletions root/ppg/staging/16/extras/containers/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 7 additions & 23 deletions root/ppg/staging/17/extras/containers/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 7 additions & 23 deletions root/ppg/staging/18/extras/containers/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 8 additions & 7 deletions root/ppg/staging/_shared/containers/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading
Loading