[Piuparts-devel] [Git][debian/piuparts][develop] gitlab-ci: move "upstream" pipelines to their own namespace
Nicolas Dandrimont (@olasd)
gitlab at salsa.debian.org
Mon May 4 20:45:06 BST 2026
Nicolas Dandrimont pushed to branch develop at Debian / piuparts
Commits:
333ba115 by Nicolas Dandrimont at 2026-05-04T21:44:56+02:00
gitlab-ci: move "upstream" pipelines to their own namespace
This should let us import the salsaci pipelines without having to maintain a
list of overrides.
- - - - -
5 changed files:
- .gitlab-ci.yml
- − .gitlab-ci/check-salsaci-overrides
- .gitlab-ci/lint.yml
- − .gitlab-ci/salsaci-overrides.yml
- .gitlab-ci/test.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -5,18 +5,17 @@ variables:
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
- - .gitlab-ci/salsaci-overrides.yml
- .gitlab-ci/lint.yml
- .gitlab-ci/test.yml
stages:
- .pre
- - lint
+ - upstream/lint
+ - upstream/test
+ - provisioning
+ - build
+ - publish
- test
- - salsaci/provisioning
- - salsaci/build
- - salsaci/publish
- - salsaci/test
image: $CI_REGISTRY_IMAGE:ci
=====================================
.gitlab-ci/check-salsaci-overrides deleted
=====================================
@@ -1,138 +0,0 @@
-#!/usr/bin/python3
-#
-# Copyright © 2022 Nicolas Dandrimont (nicolas at dandrimont.eu)
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program. If not, see <https://www.gnu.org/licenses/>
-
-from __future__ import annotations
-
-import os
-import sys
-
-import requests
-import yaml
-
-"""Check that salsaci-overrides.yml overrides all of the common salsaci pipelines"""
-
-KNOWN_TOPLEVEL_KEYS = {"include", "variables", "defaults"}
-
-
-def merge(source, destination):
- """
- run me with nosetests --with-doctest file.py
-
- >>> a = { 'first' : { 'all_rows' : { 'pass' : 'dog', 'number' : '1' } } }
- >>> b = { 'first' : { 'all_rows' : { 'fail' : 'cat', 'number' : '5' } }, 'list': [1, 2] }
- >>> merge(b, a) == { 'first' : { 'all_rows' : { 'pass' : 'dog', 'fail' : 'cat', 'number' : '5' } }, 'list': [1, 2] }
- True
- """
- for key, value in source.items():
- if isinstance(value, dict):
- # get node or create one
- node = destination.setdefault(key, {})
- merge(value, node)
- elif isinstance(value, list):
- node = destination.setdefault(key, [])
- destination[key] = destination[key] + value
- else:
- destination[key] = value
-
- return destination
-
-
-def get_gitlabci_config(git_root: str) -> Dict[str, Any]:
- """Retrieve the full gitlab-ci config out of the git root"""
-
- gitlabci_path = os.path.join(git_root, ".gitlab-ci.yml")
- return yaml.safe_load(open(gitlabci_path, "r"))
-
-
-def fetch_config(url: str) -> Dict[str, Any]:
- """Fetch a gitlab-ci config, resolving any includes"""
- req = requests.get(url)
- req.raise_for_status()
-
- config = yaml.safe_load(req.content)
-
- merged_config = {}
- for include in config.pop("include", []):
- included_config = fetch_config(include)
- merge(included_config, merged_config)
-
- merge(config, merged_config)
- return merged_config
-
-
-def get_salsaci_config(gitlabci_config: Dict[str, Any]) -> Dict[str, Any]:
- """Retrieve the config of the salsaci jobs, out of .gitlab-ci.yml includes"""
- includes = gitlabci_config.get("include", [])
- if not includes:
- raise ValueError("No includes found in .gitlab-ci.yml")
-
- for include in includes:
- if include.endswith("pipeline-jobs.yml"):
- break
- else:
- raise ValueError("No include for pipeline-jobs.yml found in .gitlab-ci.yml")
-
- return fetch_config(include)
-
-
-def get_salsaci_overrides(
- git_root: str, gitlabci_config: Dict[str, Any]
-) -> Dict[str, Any]:
- """Retrieve the salsaci overrides, out of .gitlab-ci.yml includes"""
- includes = gitlabci_config.get("include", [])
- if not includes:
- raise ValueError("No includes found in .gitlab-ci.yml")
-
- for include in includes:
- if include.endswith("salsaci-overrides.yml"):
- break
- else:
- raise ValueError("No include for salsaci-overrides.yml found in .gitlab-ci.yml")
-
- return yaml.safe_load(open(os.path.join(git_root, include), "r"))
-
-
-if __name__ == "__main__":
- git_root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
- gitlabci_config = get_gitlabci_config(git_root)
- salsaci_config = get_salsaci_config(gitlabci_config)
- salsaci_overrides = get_salsaci_overrides(git_root, gitlabci_config)
-
- keys_missing = {
- key
- for key in salsaci_config.keys()
- - salsaci_overrides.keys()
- - KNOWN_TOPLEVEL_KEYS
- if not key.startswith(".")
- }
-
- for key in keys_missing:
- print("missing", key, salsaci_config[key])
-
- keys_extra = {
- key
- for key in salsaci_overrides.keys()
- - salsaci_config.keys()
- - KNOWN_TOPLEVEL_KEYS
- if salsaci_overrides[key]["stage"].startswith("salsaci/")
- }
-
- for key in keys_extra:
- print("extra", key, salsaci_overrides[key])
-
- if keys_missing or keys_extra:
- sys.exit(1)
=====================================
.gitlab-ci/lint.yml
=====================================
@@ -1,6 +1,6 @@
---
flake8:
- stage: lint
+ stage: upstream/lint
script:
- flake8 --format gl-codeclimate --output-file gl-code-quality-report.json
artifacts:
@@ -10,7 +10,7 @@ flake8:
allow_failure: true
mypy:
- stage: lint
+ stage: upstream/lint
script:
- mypy --check-untyped-defs --no-error-summary piupartslib/ *.py | tee mypy-output.txt || return_code=$?
- PYTHONHASHSEED=0 mypy-gitlab-code-quality < mypy-output.txt > gl-code-quality-report.json
@@ -22,6 +22,6 @@ mypy:
allow_failure: true
black:
- stage: lint
+ stage: upstream/lint
script:
- black --check --diff .
=====================================
.gitlab-ci/salsaci-overrides.yml deleted
=====================================
@@ -1,77 +0,0 @@
----
-check-salsaci-overrides:
- stage: lint
- script:
- - ./.gitlab-ci/check-salsaci-overrides
-
-build:
- stage: salsaci/build
-build i386:
- stage: salsaci/build
-build arm64:
- stage: salsaci/build
-build armel:
- stage: salsaci/build
-build armhf:
- stage: salsaci/build
-build riscv64:
- stage: salsaci/build
-build ppc64el:
- stage: salsaci/build
-build source:
- stage: salsaci/build
-aptly:
- stage: salsaci/publish
-test-build-any:
- stage: salsaci/test
-test-build-all:
- stage: salsaci/test
-reprotest:
- stage: salsaci/test
-atomic-reprotest:
- stage: salsaci/test
-lintian:
- stage: salsaci/test
-piuparts:
- stage: salsaci/test
-autopkgtest:
- stage: salsaci/test
-autopkgtest armhf:
- stage: salsaci/test
-autopkgtest armel:
- stage: salsaci/test
-autopkgtest i386:
- stage: salsaci/test
-autopkgtest arm64:
- stage: salsaci/test
-blhc:
- stage: salsaci/test
-rc-bugs:
- stage: salsaci/test
-missing-breaks:
- stage: salsaci/test
-test-crossbuild-arm64:
- stage: salsaci/test
-test-build-twice:
- stage: salsaci/test
-test-build-profiles:
- stage: salsaci/test
-wrap-and-sort:
- stage: salsaci/test
-licenserecon:
- stage: salsaci/test
-build-reverse-dependencies:
- stage: salsaci/test
-test-build-validate-cleanup:
- stage: salsaci/test
-generate-build-rdep-config:
- stage: salsaci/test
-debrebuild:
- stage: salsaci/test
-
-variables:
- SALSA_CI_REPROTEST_ENABLE_DIFFOSCOPE: 1
- # Go doesn't like build-path variation
- SALSA_CI_REPROTEST_ARGS: --vary=-build_path
- # doesn't work for python arch-all packages
- SALSA_CI_DISABLE_CROSSBUILD_ARM64: 1
=====================================
.gitlab-ci/test.yml
=====================================
@@ -1,7 +1,7 @@
---
pythontests:
- stage: test
+ stage: upstream/test
script:
- python3 -m pytest -v --cov --cov-report=xml:gitlab-ci-coverage.xml --cov-report=term --junitxml=gitlab-ci-xunit.xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
View it on GitLab: https://salsa.debian.org/debian/piuparts/-/commit/333ba11576e01055c1bfa31d5b3d2199bfba2547
--
View it on GitLab: https://salsa.debian.org/debian/piuparts/-/commit/333ba11576e01055c1bfa31d5b3d2199bfba2547
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20260504/a70cafc8/attachment-0001.htm>
More information about the Piuparts-devel
mailing list