Skip to content

feat(pulp): add shared Pulp delivery actions - #1

Draft
kduret wants to merge 15 commits into
mainfrom
MON-215510-shared-pulp-actions
Draft

kduret wants to merge 15 commits into
mainfrom
MON-215510-shared-pulp-actions

Conversation

@kduret

@kduret kduret commented Nov 19, 2026 •

Copy link
Copy Markdown

Description

First step of moving the Pulp delivery actions out of the product repositories: they are copied in centreon, centreon-collect, centreon-modules, centreon-plugins and centreon-plugin-packs, so every delivery change has to be ported 5 times and the copies drift. This PR also sets up how the repository is versioned, released and consumed.

Pulp actions:

  • Imports the centreon/collect/modules version (identical in the 3 repositories) under pulp/: package-delivery, promote-to-stable, setup-cli, plus the shared scripts in pulp/lib.
  • Makes the actions callable from another repository: the nested uses: ./.github/actions/... steps (resolved in the caller's workspace) become $/ calls or scripts called through github.action_path, so all files come from the same release.
  • pulp-repository-properties and parse-distrib become internal scripts (pulp/lib/repository-properties.sh): no workflow calls them directly, and their ~30 outputs are not a public interface worth versioning.
  • Adds the connectors repository family from centreon-plugin-packs, so the plugin-packs callers can switch later.
  • The repository layout script gives the same outputs as the centreon copy on 2,520 input combinations, and the same connectors outputs as the plugin-packs copy.

Merged from centreon-plugins, whose copy had diverged from centreon's in both directions:

  • Queue-aware task wait and publication only when needed on promotion (centreon-plugins #6516).
  • Parallel verification requests and single read of each Packages index (centreon-plugins #6518), kept together with the served-build check of the centreon copy.
  • Promotion of families whose testing and stable suites share their name (plugins, connectors), limited to that case.

Merged from the maintained branches of centreon, centreon-collect and centreon-modules, which carry code develop lacks:

  • 24.x legacy mirror of dev-24.10.x, which deduces the release component without the admin-only listing.

  • 24.04 routing of dev-26.10.x to the legacy stable repositories.

  • Feature repositories that already exist need no creation token, which dev-25.10.x and dev-24.10.x callers do not pass.

  • New here: a deb promotion interrupted after its repository modify can be rerun (the release component listing refused to the CI identity no longer aborts the recovery).

  • New here: the deb verification finds the packages of a delivery in one listing filtered on its run id label, instead of one api lookup per package (per-package lookup kept as fallback and for promotions).

Versioning and releases:

  • A package is a top-level directory (pulp), versioned on its own with SemVer; it holds one or several actions built on the same code. Same model as grafana/shared-workflows, with release-please.
  • release-please keeps one release PR per package (version, pulp/CHANGELOG.md) from the squash-merged PR titles; merging it creates the immutable pulp/vX.Y.Z tag and GitHub release, then the floating pulp/vX tag is moved to it.
  • Callers use centreon/github-actions/pulp/package-delivery@pulp/v1: a release reaches every branch without touching the product repositories; a new major is opt-in.
  • move-major-tag workflow: points a major tag back at a previous release in seconds, since a release reaches every caller at once.
  • lint: PR title format, actions packaged / self-contained / SHA-pinned with existing executable scripts, shellcheck, bats (60 tests: Pulp layout, setup guards, task wait, deb verification, deb promotion, feature repositories, repository scripts), a run of pulp/package-delivery up to the repository layout on a real runner, zizmor (security) and jactionlint (validity; maintained fork of actionlint, which has had no release since March and also skips composite actions).
  • Why not a plain @v1: a ref applies to the whole repository, so it would give every package the same version.
  • Inside a package, an action calls another one with the $/ self-repository syntax (package-delivery and promote-to-stable call $/pulp/setup-cli) and shared scripts through github.action_path. $/ was verified to resolve to the action's own commit when the action is pinned; it needs runner 2.336.0+ (GitHub-hosted and internal runners are on 2.338.2).

Repository settings needed before the first release (admin only, listed in the README):

  • A GitHub App (contents, pull-requests, issues: write): its client id in the RELEASE_APP_CLIENT_ID repository variable, its private key in a release environment limited to main. The release workflow is skipped until the variable exists.
  • That app as the only bypass actor of the Release tags ruleset, which today blocks every tag creation.
  • Squash merge commit title set to "Pull request title".
  • Immutable releases enabled, lint as a required check.

Not in this PR:

  • Switching the product repositories to the shared actions and deleting their copies (one PR per repository, which also allows centreon/github-actions in their SHA pinning check).
  • Switching centreon-plugins and centreon-plugin-packs: their unstable delivery works with the shared version and their promotion case is merged, but no promotion has run for real yet, and the connectors family is untested.
  • The installers-*-pulp actions, used by centreon-collect only.
  • Tests of the deliver/promote scripts themselves: they need a Pulp api.

Tested with real unstable deliveries, from test branches pinning commits of this PR (stability forced to unstable, branches not merged):

  • centreon, dsm workflow (run 44533299218, commit f586e53): el9, el10 and trixie delivered to the internal 27.01 unstable repositories and verified.
  • centreon-plugins, centreon-plugins-sudoers workflow (run 44534490994, commit f586e53): 7 distributions delivered and verified.
  • centreon-plugins, full plugins workflow, 687 packages on each of the 7 distributions in parallel (run 44545438433, commit 7eb237c): all delivered and verified.
  • In all of them, the nested $/pulp/setup-cli call ran from the calling repository.
  • Not run for real: testing deliveries, feature deliveries and promotions to stable (covered by bats tests against stand-ins only). The deliveries above ran before the last promotion and routing commits, which do not touch the unstable delivery path.

Duration of a full plugins delivery, per distribution:

rpm deb
develop, nightly of 2026-11-16 12.5 to 13 min 31 to 36 min
develop, push of 2026-11-18 23 min 40 to 49 min
this PR, 2026-11-19 10.3 to 10.8 min 11.7 to 12.9 min

The deb verification went from about 17 min to 43 s. Part of the rest comes from the first production cleanup of the unstable repositories, done the same morning (18,470 to about 2,000 packages per repository), which shortens the repository update and publication whatever the scripts.

Fixes: MON-215510

Import package-delivery-pulp, promote-to-stable-pulp,
pulp-repository-properties, setup-pulp-cli and the pulp script helpers
from centreon/centreon-collect/centreon-modules (identical copies) under
pulp/, made self-contained so they can be called from another repository.

Refs: MON-215510
@kduret kduret added area/ci enhancement New feature or request gha labels Nov 19, 2026
Release the repository as vX.Y.Z tags from the conventional commit titles merged on main, through a release pull request and a dedicated app token. Lint the actions (self-contained, SHA-pinned), the scripts and the workflows on every pull request.

Refs: MON-215510
Replace release-please with a per-action release: every merge on main tags the changed actions <action>-vX.Y.Z (immutable release) and moves their <action>-vX tag, so callers get fixes by referencing the major tag. The lint check validates the PR title and previews the releases.

Refs: MON-215510
Version each top-level directory as a package: release-please keeps a release pull request per package, and merging it tags <package>/vX.Y.Z and moves <package>/vX. The Pulp repository layout becomes an internal script, with a default for the delivery type the promotion does not pass. Bats tests cover the layout, the setup guards and the repository scripts.

Refs: MON-215510
Let a maintainer point a major tag back at a previous release, run the delivery action up to the repository layout on a real runner, audit workflows and actions with zizmor, and delay Dependabot updates by 7 days.

Refs: MON-215510
actionlint has had no release since March and rejects the self-repository uses syntax; jactionlint, its maintained fork, also checks composite actions. Set the job timeouts it asks for and use the self-repository syntax in the wiring smoke test.

Refs: MON-215510
package-delivery and promote-to-stable duplicated the two steps of setup-cli; they now call it with uses: $/pulp/setup-cli, which resolves to the commit of the release in use. The actions check accepts that syntax inside a package only.

Refs: MON-215510
The deb verification asked the api once per package, 687 sequential lookups and about 15 minutes for a full plugins delivery. A delivery labels its uploads with its run id, so one filtered listing per repository now answers for all of them; the per-package lookup remains for what the listing misses and for promotions.

Refs: MON-215510
Port of centreon-plugins #6516: a task waiting behind another one is not failing, it gets its own budget and the tasks ahead of it are logged; a promotion only republishes when the latest version has no publication.

Refs: MON-215510
Port of centreon-plugins #6518, which the centreon copy lacked: content HEADs and per-package presence lookups run 8 at a time, each Packages index is read once into a map, and the rpm presence check follows. The served-build check of the centreon copy is kept on top of the parallel HEADs. Without it a full plugins delivery spent 8 to 9 minutes on sequential HEADs.

Refs: MON-215510
Validate a release tag before it reaches an api path, check that the scripts an action runs exist and are executable, serialize the release and the major tag move, run every step with pipefail, and skip the release until its app is configured. Document that refactor and revert changes are released, as release-please does. Add bats tests of the pulp task wait.

Refs: MON-215510
A deb promotion whose publication failed after the repository modify could not be rerun: the suite association already existed, so the release component could not be deduced, and the fallback listing of release components is refused (403) to the CI identity, which aborted the script before the recovery that republishes and re-checks the suite. An empty result aborted too, on a grep under pipefail. Both now reach the recovery. Add bats tests of that rerun.

Refs: MON-215510
The actions were imported from develop, but the maintained branches of centreon, centreon-collect and centreon-modules carry code develop lacks. Port it so every branch can switch: the 24.x legacy mirror of dev-24.10.x, which deduces the release component without the admin-only listing; the 24.04 routing of dev-26.10.x to the legacy stable repositories; and feature repositories that already exist no longer need the creation token, which dev-25.10.x and dev-24.10.x callers do not pass.

Refs: MON-215510
…ir name

Port of the centreon-plugins case: plugins and connectors name both suites after the distribution, so the release component is shared and already associated before the reference upload, and the before/after diff that deduces it is empty. Limited to equal suite names: elsewhere a single association may be the testing one.

Refs: MON-215510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci enhancement New feature or request gha

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant