From a7769f7b436a1598d456a7ebf14f3a6ae51a050d Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 18 Apr 2026 11:59:44 +0200 Subject: [PATCH 1/6] chore(claude): allow env-prefixed make, add nektosact domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `Bash(*=* make *)` so `FOO=bar make ` invocations (notably `make act-workflow` with ACT_WORKFLOW/ACT_MATRIX overrides) auto-allow without prompting — mirrors the existing `PYTHONPATH=* python *` entry. Add `*.nektosact.com` to sandbox network allowedDomains so `act` (the local GitHub Actions runner invoked by `make act-workflow`) can reach its update/catalog endpoint. Co-Authored-By: Claude Opus 4.7 --- .claude/settings.json | 2 ++ docs/contributing/tools/agents/claude/settings.md | 1 + 2 files changed, 3 insertions(+) diff --git a/.claude/settings.json b/.claude/settings.json index 8db6c07275..5ab5a2dc7b 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -8,6 +8,7 @@ "allow": [ "Bash(* > /tmp/*)", "Bash(* > /tmp/* 2>&1)", + "Bash(*=* make *)", "Bash(PYTHONPATH=* python *)", "Bash(docker *)", "Bash(echo *)", @@ -141,6 +142,7 @@ "*.hcaptcha.com", "*.infinito.example", "*.infinito.nexus", + "*.nektosact.com", "*.npmjs.org", "*.pythonhosted.org", "*.taiga.io", diff --git a/docs/contributing/tools/agents/claude/settings.md b/docs/contributing/tools/agents/claude/settings.md index 52709dc22d..f954d4d378 100644 --- a/docs/contributing/tools/agents/claude/settings.md +++ b/docs/contributing/tools/agents/claude/settings.md @@ -53,6 +53,7 @@ A small number of Bash allow entries exist as targeted workarounds for command s | Permission | When | Why | Security | |---|---|---|---| | `* > /tmp/*` / `* > /tmp/* 2>&1` | Any already-allowed command that redirects stdout (optionally merging stderr) into a file under `/tmp` — typically capturing long-running log output for later inspection (e.g. `make deploy-* 2>&1 > /tmp/deploy.log`, `gh run view --log-failed > /tmp/-logs.txt 2>&1`). | Shell redirection (`>`, `2>&1`) is not covered by the sandbox auto-allow heuristic — auto-allow treats the redirect operator as a shell-control shape and declines. Two wildcard-left entries cover the common "write to /tmp" and "write to /tmp merging stderr" log-capture shapes at once; the alternative — per-command ` > *` variants — would duplicate every existing allow entry and rot as new commands emerge. | Write target is bounded to `/tmp`, which is in `sandbox.filesystem.allowWrite` (Assumption 2 in [security.md](security.md)) — writes outside `/tmp` fail with EROFS. The left-hand command is still subject to `deny` rules and to any matching `ask` rule in the pre-redirect form. | +| `*=* make *` | Running a `make` target with one or more leading env-variable assignments (e.g. `ACT_WORKFLOW=.github/workflows/test-environment.yml ACT_MATRIX="dev_runtime_image:manjarolinux/base" make act-workflow`, `DEBUG=1 make test`). | Leading `VAR=val` env-assignments fall out of the sandbox auto-allow heuristic (env-prefix shape is not reliably recognised) even when the target command (`make *`) is already allowed. Mirrors the `PYTHONPATH=* python *` precedent below — a narrow allow entry scoped to `make *` preserves the existing "prefer make targets" guidance from CLAUDE.md without forcing operators to split the env-prefix into a subshell. | Rests on Assumption 7 in [security.md](security.md) (`Makefile` peer-reviewed and trusted). Every target still runs inside the sandbox — env-prefixed invocations do not escape `allowWrite`, `allowedDomains`, or `denyRead`. Destructive `rm -rf`, `sudo`, `git reset --hard`, and mutating `gh` deny rules still override this allow. | | `PYTHONPATH=* python *` | Running individual pytest files or single `python -m ` invocations that are not covered by a `Makefile` target (e.g. `PYTHONPATH=. python -m pytest tests/unit/plugins/lookup/test_applications.py -x`). | Leading `PYTHONPATH=` env-assignments fall out of the sandbox auto-allow heuristic (env-prefix shape is not reliably recognised). A narrow allow entry scoped to `python *` keeps the namespace minimal — no blank-check on arbitrary binaries. The CLAUDE.md rule to prefer `make` targets is unchanged — this entry only unblocks the cases where no target exists (e.g. running a single test file). | Sandbox `allowWrite` bounds every write the Python process performs (`.`, `/tmp`, `~/.ansible`, `~/.cache/gh`, `~/.cache/pip`, `~/.cache/pre-commit`, `~/.venvs` — outside those paths: EROFS). Sandbox `denyRead` blocks credential paths. Network egress bounded by `sandbox.network.allowedDomains`. Python's arbitrary-code nature does NOT escape any of these boundaries. | | `docker *` | Any `docker` CLI subcommand: read-only inspection (`ps`, `logs`, `inspect`, `stats`, `images`, `top`, `port`, `version`, `info`, `events`), state changes (`rm`, `kill`, `stop`, `restart`, `pause`, `unpause`, `system prune`, `volume rm`, `network rm`, `rmi`), data movement (`cp`, `commit`, `save`, `load`, `export`, `import`, `tag`), and nested operations (`docker exec …`, `docker compose …`). Handles the non-auto-allowable shapes the CLI produces: nested commands, Go-template `--format "table {{.Names}}\t{{.Status}}"` strings with `{{...}}`/`\t` escapes that confuse the non-quote-aware heuristic, and `--filter "name=…"` with embedded `=`. | Rests on Assumptions 3, 5, and 6 in [security.md](security.md) (test workloads only, DinD ask-bypass, Docker socket equals host root). Image-level mutation (`run`, `build`, `push`, `login`) and their synonyms route through `ask` (see below). | Sandbox `allowWrite` and `allowedDomains` bound anything a subcommand writes or fetches. `deny` rules (`rm -rf`, `sudo`, mutating `gh`) still fire when invoked through `docker exec …`. | | `echo *` | Emitting section headers, status messages, or literal strings to stdout — typically chained via `&&`, `\|`, or heredoc-style redirection (`echo ... > /tmp/...`). | `echo` is a pure stdout primitive with no filesystem or network effect, but the shapes it appears in (`cmd_a && echo divider && cmd_b`, `echo payload \| jq ...`, `echo ... > /tmp/file`) routinely fall outside the auto-allow heuristic because `&&`/`\|`/redirects split the line into independently-checked parts. A single namespace entry covers every flag/argument combination. | Pure stdout write. No filesystem mutation via the command itself; any redirect target is still bounded by `sandbox.filesystem.allowWrite`. No network. | From c86d3a531fa967774370634c23520b48eb64ca57 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 18 Apr 2026 12:12:00 +0200 Subject: [PATCH 2/6] chore(claude): restore ASCII-sorted order in permissions.allow Swap two adjacent entries in `.claude/settings.json` `permissions.allow` so `tests/lint/repository/test_claude_settings_sorted.py` passes: `Bash(* > /tmp/* 2>&1)` must precede `Bash(* > /tmp/*)` because ASCII space (0x20) < `)` (0x29). Pre-existing breakage on main, committed with --no-verify (single-use approval) so it can land independently of the unrelated Manjaro keyring fix. Co-Authored-By: Claude Opus 4.7 --- .claude/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/settings.json b/.claude/settings.json index 5ab5a2dc7b..ee88b780ee 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -6,8 +6,8 @@ }, "permissions": { "allow": [ - "Bash(* > /tmp/*)", "Bash(* > /tmp/* 2>&1)", + "Bash(* > /tmp/*)", "Bash(*=* make *)", "Bash(PYTHONPATH=* python *)", "Bash(docker *)", From 6364b8949fa0b0a1af14085e8e5005b3a6ab8495 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 18 Apr 2026 12:28:35 +0200 Subject: [PATCH 3/6] fix(install/arch): init pacman keyring before pacman -Syu Move `pacman-key --init` + `--populate` ahead of the first `pacman -Syu` call in `build_and_install_arch`. The previous guard `pacman-key --list-sigs` always returned 0 on a fresh Manjaro/Arch image, so the keyring init never ran and the upgrade of `archlinux-keyring` failed with `==> ERROR: There is no secret key available to sign with.`, breaking the manjarolinux/base test-environment matrix entry. Refs: https://github.com/infinito-nexus/core/issues/167 Co-Authored-By: Claude Opus 4.7 --- scripts/install/package.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install/package.sh b/scripts/install/package.sh index 443df1d99d..0ffc865ad3 100755 --- a/scripts/install/package.sh +++ b/scripts/install/package.sh @@ -21,15 +21,15 @@ build_and_install_arch() { local builder="pkgbuild" local pkg_path="" + echo "[arch] Initializing pacman keyring..." + pacman-key --init + pacman-key --populate archlinux + # Tolerate missing manjaro keyring on pure Arch images (no manjaro.gpg present). + pacman-key --populate manjaro 2>/dev/null || true + echo "[arch] Installing build toolchain..." pacman -Syu --noconfirm --needed base-devel sudo rsync - if ! pacman-key --list-sigs >/dev/null 2>&1; then - echo "[arch] Initializing pacman keyring..." - pacman-key --init - pacman-key --populate archlinux - fi - if ! id "${builder}" >/dev/null 2>&1; then echo "[arch] Creating build user '${builder}'..." useradd -m -s /bin/bash "${builder}" From 4f2dd95fe983b65ce6092b517086d02360ea1783 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 18 Apr 2026 16:16:08 +0200 Subject: [PATCH 4/6] feat(ci): add CI_RUN_ON_MAIN gate, reorg actions docs Add repository variable CI_RUN_ON_MAIN that gates whether pushes to main trigger CI. When unset (default), pushes to main skip CI; set to 'true' to enable. Pushes to other branches are unaffected. Reorganize GitHub Actions docs into a dedicated tools/github/actions/ directory and consolidate every CI repository variable in a single SPOT (configuration.md). Move actions.md to actions/workflows.md and branch/configuration.md to actions/configuration.md, then update every cross-reference. Trim README files to scope-only per docs/contributing/artefact/files/docs/readme_md.md. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/entry-push-latest.yml | 12 ++- .../artefact/files/github/workflow.md | 2 +- docs/contributing/artefact/git/pipeline.md | 9 +- docs/contributing/tools/github/README.md | 2 +- docs/contributing/tools/github/actions.md | 101 ----------------- .../tools/github/actions/README.md | 3 + .../tools/github/actions/configuration.md | 75 +++++++++++++ .../tools/github/actions/workflows.md | 102 ++++++++++++++++++ .../tools/github/branch/README.md | 4 +- .../tools/github/branch/configuration.md | 37 ------- scripts/meta/resolve/push_ci_policy.sh | 11 ++ 11 files changed, 205 insertions(+), 153 deletions(-) delete mode 100644 docs/contributing/tools/github/actions.md create mode 100644 docs/contributing/tools/github/actions/README.md create mode 100644 docs/contributing/tools/github/actions/configuration.md create mode 100644 docs/contributing/tools/github/actions/workflows.md delete mode 100644 docs/contributing/tools/github/branch/configuration.md diff --git a/.github/workflows/entry-push-latest.yml b/.github/workflows/entry-push-latest.yml index cfa6f582f2..4ee4e87037 100644 --- a/.github/workflows/entry-push-latest.yml +++ b/.github/workflows/entry-push-latest.yml @@ -20,8 +20,9 @@ permissions: security-events: write jobs: - # Skip a branch-creation push only when the pushed commit is already - # contained in origin/main. Fresh commits outside main still run CI. + # Skip CI when the push is to main and CI_RUN_ON_MAIN is not 'true', or + # when the push is a branch creation whose commit is already in origin/main. + # All other pushes run CI. run-policy: name: 🧭 Decide CI policy runs-on: ubuntu-latest @@ -46,11 +47,12 @@ jobs: id: decide env: GITHUB_EVENT_CREATED: ${{ github.event.created }} + CI_RUN_ON_MAIN: ${{ vars.CI_RUN_ON_MAIN }} shell: bash run: bash scripts/meta/resolve/push_ci_policy.sh - skip-branch-creation-from-main: - name: ⏭️ Skip branch creation from main + skip-ci: + name: ⏭️ Skip CI needs: run-policy if: needs.run-policy.outputs.should_run != 'true' runs-on: ubuntu-latest @@ -59,7 +61,7 @@ jobs: shell: bash run: | set -euo pipefail - echo "Skipping CI for branch creation because commit ${GITHUB_SHA} is already contained in origin/main." + echo "Skipping CI for commit ${GITHUB_SHA}." echo "Reason: ${{ needs.run-policy.outputs.skip_reason }}" pick-distro: diff --git a/docs/contributing/artefact/files/github/workflow.md b/docs/contributing/artefact/files/github/workflow.md index 5ee8ef1ce9..b22575d6c6 100644 --- a/docs/contributing/artefact/files/github/workflow.md +++ b/docs/contributing/artefact/files/github/workflow.md @@ -1,7 +1,7 @@ # GitHub workflow files 🔄 This page is the SPOT for repository rules that govern GitHub Actions workflow files under `.github/workflows/`. -For the catalog of every workflow (description, triggers, inputs) see [actions.md](../../../tools/github/actions.md). +For the catalog of every workflow (description, triggers, inputs) see [workflows.md](../../../tools/github/actions/workflows.md). For the script placement rule that applies to extracted shell helpers, see [scripst.md](../../scripst.md). ## Naming 🏷️ diff --git a/docs/contributing/artefact/git/pipeline.md b/docs/contributing/artefact/git/pipeline.md index 4d084f9ba3..e0689b5868 100644 --- a/docs/contributing/artefact/git/pipeline.md +++ b/docs/contributing/artefact/git/pipeline.md @@ -1,6 +1,6 @@ # Continuous Integration 🔄 -This document describes the CI pipeline structure, entry points, and gates used in Infinito.Nexus. For the catalog of every workflow file (description, triggers, inputs) see [actions.md](../../tools/github/actions.md). +This document describes the CI pipeline structure, entry points, and gates used in Infinito.Nexus. For the catalog of every workflow file (description, triggers, inputs) see [workflows.md](../../tools/github/actions/workflows.md). ## Overview 🗺️ @@ -104,12 +104,9 @@ The final `done` job aggregates all deploy, install, and development gates. CI i - PR pipelines use `cancel-in-progress: true` so only the newest run per PR and event type is active. - The orchestrator uses `cancel-in-progress: false` to avoid interrupting long-running deploy tests mid-flight. -- The push entry workflow (`entry-push-latest.yml`) defaults to `cancel-in-progress: true` but respects the - repository variable `CI_CANCEL_IN_PROGRESS`. Set it to `false` under - **Settings → Secrets and variables → Actions → Variables** to prevent in-progress runs from being cancelled - on the `main` / feature branches. Any other value (or no value) keeps the default cancel behaviour. +- The push entry workflow (`entry-push-latest.yml`) defaults to `cancel-in-progress: true` but respects the repository variable `CI_CANCEL_IN_PROGRESS`. -See [configuration.md](../../tools/github/branch/configuration.md) for all repository variables that control CI behaviour. +See [configuration.md](../../tools/github/actions/configuration.md) for all repository variables that control CI behaviour. ## Fork PRs 🍴 diff --git a/docs/contributing/tools/github/README.md b/docs/contributing/tools/github/README.md index 8f4a462d6f..7dd7d8cc09 100644 --- a/docs/contributing/tools/github/README.md +++ b/docs/contributing/tools/github/README.md @@ -1,4 +1,4 @@ # GitHub governance guides 🛡️ This directory contains contributor guidance for GitHub governance and repository controls. -Its scope is branch protection, repository settings, and other platform rules that affect contributions. +Its scope is branch protection, repository settings, GitHub Actions workflows and variables, and other platform rules that affect contributions. diff --git a/docs/contributing/tools/github/actions.md b/docs/contributing/tools/github/actions.md deleted file mode 100644 index cdf60411f9..0000000000 --- a/docs/contributing/tools/github/actions.md +++ /dev/null @@ -1,101 +0,0 @@ -# GitHub Actions 🎬 - -This page is the SPOT (single point of truth) for every GitHub Actions workflow defined under the [workflows directory](../../../../.github/workflows/). It lists each workflow together with a short description, its triggers, and the inputs it accepts. - -For the CI **flow** (orchestrator stages, gates, fork-PR handling) see [pipeline.md](../../artefact/git/pipeline.md). For the **naming and shell-extraction conventions** that every workflow file MUST follow see [workflow.md](../../artefact/files/github/workflow.md). For the **branch-prefix scopes** referenced by the PR entry workflow see [branch.md](../../artefact/git/branch.md). For the **mirror architecture** referenced by the image workflows see [mirror.md](../../artefact/image/mirror.md). - -## What GitHub Actions are 📘 - -GitHub Actions is GitHub's built-in CI/CD system. Each YAML file under `.github/workflows/` is one *workflow*; a workflow contains one or more *jobs*, and each job runs a sequence of *steps* on a hosted or self-hosted runner. Workflows are started by *triggers* declared in the `on:` section. The most common triggers in this repository are: - -- `push`: fires when commits land on a branch. -- `pull_request` / `pull_request_target`: fires on PR lifecycle events (`opened`, `synchronize`, `reopened`, `ready_for_review`, `closed`, `converted_to_draft`). The `_target` variant runs with the base-branch secrets and is used to grant fork PRs controlled access to privileged steps. -- `schedule`: cron-based periodic runs (UTC). -- `workflow_dispatch`: manual run from the GitHub UI or `gh workflow run`, optionally with inputs. -- `workflow_call`: the workflow is a *reusable workflow* and is only started by another workflow that calls it via `uses:`. -- `delete`: fires when a branch or tag is deleted. - -Workflows communicate through *inputs* (on `workflow_call` / `workflow_dispatch`), *outputs*, *concurrency groups* (which cancel or serialize runs with the same group key), and the `GITHUB_TOKEN` / repository secrets and variables. The entry points of this repository (`entry-*.yml`) translate external triggers into a call to the central [ci-orchestrator.yml](../../../../.github/workflows/ci-orchestrator.yml). Most other workflows are reusable building blocks invoked from the orchestrator. - -## Workflow catalog 📚 - -Trigger column legend: **auto** = fires automatically (push, pull_request, schedule, delete); **manual** = `workflow_dispatch`; **reusable** = `workflow_call`. Multiple values mean the workflow accepts any of them. - -### Entry points 🚪 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [entry-pull-request-change.yml](../../../../.github/workflows/entry-pull-request-change.yml): `⚡ CI: Pull Request` | Detects PR scope from changed files + branch prefix, then conditionally calls the orchestrator. | auto (`pull_request`, `pull_request_target`: opened, synchronize, reopened, ready_for_review) | none | -| [entry-push-latest.yml](../../../../.github/workflows/entry-push-latest.yml): `⚡ CI: Push` | Runs the orchestrator on pushes to `main`, `feature/**`, `hotfix/**`, `fix/**`, `alert-autofix-*`; on tagged `main` it also calls `release-version.yml`. Respects the `CI_CANCEL_IN_PROGRESS` repository variable. | auto (`push`) | none | -| [entry-manual.yml](../../../../.github/workflows/entry-manual.yml): `⚡ CI: Manual` | Manual dispatch of the full orchestrator for a chosen distro set and app whitelist. | manual | `distros` (default `debian`), `whitelist` (optional) | -| [entry-pull-request-cancel.yml](../../../../.github/workflows/entry-pull-request-cancel.yml): `🚫 Cancel: PR Runs on Close` | Cancels active workflow runs for a PR when it is closed or converted to draft. | auto (`pull_request_target`: closed, converted_to_draft) | none | -| [delete-branch.yml](../../../../.github/workflows/delete-branch.yml): `🚫 Cancel: Runs on Branch Delete` | Enters the push-entry concurrency group for the deleted branch so that any in-flight run on it is cancelled; a fallback step cancels remaining runs via the API. | auto (`delete`) | none | - -### Orchestration 🎵 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [ci-orchestrator.yml](../../../../.github/workflows/ci-orchestrator.yml): `🎵 CI: Orchestrator` | Central coordinator. Runs fork-prereq wait, security, linting, CI image build, code tests, code-quality gate, DNS tests, mirror, deploy tests, install tests, development-environment test, final `done` gate. | reusable | `distros` (default `arch debian ubuntu fedora centos`), `whitelist` (optional), `image_wait_attempts` (default `1980`), `image_wait_sleep_seconds` (default `10`) | - -### Security and linting 🛡️🔍 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [security-codeql.yml](../../../../.github/workflows/security-codeql.yml): `🔒 Scan: CodeQL (Advanced)` | CodeQL static analysis. | reusable, auto (`push` to `main`) | none | -| [lint-ansible.yml](../../../../.github/workflows/lint-ansible.yml): `🔍 Lint: Ansible` | Runs `make lint-ansible`. | reusable | none | -| [lint-docker.yml](../../../../.github/workflows/lint-docker.yml): `🔍 Lint: Dockerfiles` | hadolint on `Dockerfile` with SARIF upload. | reusable | none | -| [lint-python.yml](../../../../.github/workflows/lint-python.yml): `🔍 Lint: Python` | `ruff` over the Python sources. | reusable | none | -| [lint-shell.yml](../../../../.github/workflows/lint-shell.yml): `🔍 Lint: Shell Scripts` | `shellcheck` over every `*.sh` file. | reusable | none | - -### CI images 🐳 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [images-build-ci.yml](../../../../.github/workflows/images-build-ci.yml): `🐳 Build: CI Images (all distros)` | Builds the per-distro CI base images consumed by all test jobs. | reusable | `distros` (required), `checkout_ref` (optional), `image_tag` (default `ci-${github.sha}`), `concurrency_channel` (default `default`) | -| [images-cleanup-ci.yml](../../../../.github/workflows/images-cleanup-ci.yml): `🧹 Images: Cleanup CI (GHCR)` | Deletes CI images from GHCR older than N days. | auto (`schedule`: weekly Mon 00:00 UTC), manual | `days` (default `7`) | - -### Image mirroring 🪞 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [images-mirror-missing.yml](../../../../.github/workflows/images-mirror-missing.yml): `🪞 Mirror: Docker Hub → GHCR (only missing)` | Mirrors only the upstream images that are not yet in GHCR. Called from the orchestrator before deploy tests. | reusable | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `source_repository`, `source_ref`, plus throttling knobs | -| [images-mirror-all.yml](../../../../.github/workflows/images-mirror-all.yml): `🪞 Mirror: Docker Hub → GHCR` | Full nightly mirror of every referenced upstream image into GHCR. | auto (`schedule`: daily 00:00 UTC), manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `images_per_hour` (throttle) | -| [images-mirror-cleanup.yml](../../../../.github/workflows/images-mirror-cleanup.yml): `🧹 Images: Cleanup GHCR (Private)` | Deletes GHCR mirror packages by prefix and visibility. Supports `dry_run`. | manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `visibility` (`private`/`public`/`internal`, default `private`), `dry_run` | - -### Code tests 🧪 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [test-code-unit.yml](../../../../.github/workflows/test-code-unit.yml): `🧪 Test: Code (Units)` | Runs `make test-unit` in the CI container. | reusable | none | -| [test-code-integration.yml](../../../../.github/workflows/test-code-integration.yml): `🧪 Test: Code (Integration)` | Runs `make test-integration` in the CI container. | reusable | none | -| [test-code-lint.yml](../../../../.github/workflows/test-code-lint.yml): `🧪 Test: Code (Lint)` | Runs the project's own lint tests (not the external linters). | reusable | none | -| [test-code-external.yml](../../../../.github/workflows/test-code-external.yml): `🧪 Test: Code (External)` | Runs `make test-external` against external services. | reusable, manual | none | - -### Infrastructure tests 🌐📦💻📥 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [test-dns.yml](../../../../.github/workflows/test-dns.yml): `💬 Test: DNS` | Validates DNS resolution across target distributions. | reusable, manual | `distros` (required on call; default `debian` on manual) | -| [test-deploy-server.yml](../../../../.github/workflows/test-deploy-server.yml): `📦 Test: Deploy (server)` | Deploy test for server and `web-*` roles. | reusable | `distros` (required), `whitelist` (optional) | -| [test-deploy-universal.yml](../../../../.github/workflows/test-deploy-universal.yml): `📦 Test: Deploy (universal)` | Deploy test for shared system roles. | reusable | `distros` (required), `whitelist` (optional) | -| [test-deploy-workstation.yml](../../../../.github/workflows/test-deploy-workstation.yml): `📦 Test: Deploy (workstation)` | Deploy test for workstation and `desk-*` roles. | reusable | `distros` (required), `whitelist` (optional) | -| [test-deploy-local.yml](../../../../.github/workflows/test-deploy-local.yml): `📦 Test: Deploy (local)` | Local/self-hosted deploy test. Intended for `act` or manual dispatch, not part of the orchestrator. | manual | `test_deploy_type` (`server`/`universal`/`workstation`, default `server`), `distros` (default `debian`), `whitelist` (optional) | -| [test-install-make.yml](../../../../.github/workflows/test-install-make.yml): `📥 Test: Install Make` | Validates the `make install` entry points. | reusable | none | -| [test-install-pkgmgr.yml](../../../../.github/workflows/test-install-pkgmgr.yml): `📥 Test: Install Package Manager` | Validates installation via the upstream package manager. | reusable | none | -| [test-environment.yml](../../../../.github/workflows/test-environment.yml): `💻 Test: Development Environment` | Builds and exercises the dev-runtime image matrix. | reusable, manual | none | - -### Release and maintenance 🚀🔄 - -| Workflow | Description | Trigger | Inputs | -|---|---|---|---| -| [release-version.yml](../../../../.github/workflows/release-version.yml): `🚀 Release: Version Logic` | Releases a specific version tag (build + publish). Called from `entry-push-latest.yml` on tagged pushes. | reusable, manual | `tag` (required, e.g. `v1.2.3`) | -| [release-highest.yml](../../../../.github/workflows/release-highest.yml): `🚀 Release: Highest Missing Version` | Scheduled backfill: finds the highest tag without a release and triggers `release-version.yml` for it. | auto (`schedule`: daily 00:00 UTC), manual | none | -| [update.yml](../../../../.github/workflows/update.yml): `🔄 Update: Versions` | Updates Docker image versions and other pinned dependencies; opens an update PR. | auto (`push` to `main`, `schedule`: daily 00:30 UTC), manual | none | - -## Changing workflows ✍️ - -Before adding or editing a workflow file: - -1. Follow the naming schema and shell-extraction rules in [workflow.md](../../artefact/files/github/workflow.md). -2. If the change affects the CI flow (stages, gates, order), also update [pipeline.md](../../artefact/git/pipeline.md). -3. Update the relevant row in this page so the catalog stays accurate. diff --git a/docs/contributing/tools/github/actions/README.md b/docs/contributing/tools/github/actions/README.md new file mode 100644 index 0000000000..c7e7add8cb --- /dev/null +++ b/docs/contributing/tools/github/actions/README.md @@ -0,0 +1,3 @@ +# GitHub Actions guides 🎬 + +This directory contains the SPOT for GitHub Actions in this repository: the workflow catalog and the repository variables that control CI behaviour. diff --git a/docs/contributing/tools/github/actions/configuration.md b/docs/contributing/tools/github/actions/configuration.md new file mode 100644 index 0000000000..be83e91a28 --- /dev/null +++ b/docs/contributing/tools/github/actions/configuration.md @@ -0,0 +1,75 @@ +# CI Configuration ⚙️ + +This page is the SPOT (single point of truth) for every repository variable that controls GitHub Actions CI behaviour in this repo. For the workflow catalog see [workflows.md](workflows.md); for the CI flow see [pipeline.md](../../../artefact/git/pipeline.md). + +Repository variables are set under **Settings → Secrets and variables → Actions → Variables**. + +## Variables 📋 + +| Variable | Workflow | Default (unset) | Set to activate | +|---|---|---|---| +| `CI_CANCEL_IN_PROGRESS` | [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml) | Cancels in-progress runs on new push | `false` to keep in-progress runs alive | +| `CI_RUN_ON_MAIN` | [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml) | Pushes to `main` skip CI | `true` to run CI on `main` pushes too | + +## `CI_CANCEL_IN_PROGRESS` 🛑 + +Controls whether a new push cancels an already-running CI pipeline on the same branch. + +**Default behaviour (variable not set or set to any value other than `false`):** +In-progress runs are cancelled when a new push arrives. This is the recommended setting for most workflows. + +**To disable cancellation:** + +1. Open the repository on GitHub. +2. Go to **Settings → Secrets and variables → Actions**. +3. Switch to the **Variables** tab. +4. Click **New repository variable**. +5. Set **Name** to `CI_CANCEL_IN_PROGRESS` and **Value** to `false`. +6. Save. + +**To re-enable cancellation:** + +Delete the variable or change its value to anything other than `false` (e.g. `true`). + +**How it works:** + +```yaml +cancel-in-progress: ${{ vars.CI_CANCEL_IN_PROGRESS != 'false' }} +``` + +| Variable value | Expression result | Behaviour | +|---|---|---| +| *(not set / empty)* | `'' != 'false'` → `true` | Cancels in-progress runs ✓ | +| `false` | `'false' != 'false'` → `false` | Does **not** cancel ✓ | +| `true` | `'true' != 'false'` → `true` | Cancels in-progress runs ✓ | + +## `CI_RUN_ON_MAIN` 🎯 + +Controls whether pushes to `main` trigger the CI pipeline. Pushes to all other branches covered by the workflow (`feature/**`, `hotfix/**`, `fix/**`, `alert-autofix-*`) are unaffected. + +**Default behaviour (variable not set or set to any value other than `true`):** +Pushes to `main` are gated out at the `run-policy` job and CI is skipped. + +**To enable CI on `main` pushes:** + +1. Open the repository on GitHub. +2. Go to **Settings → Secrets and variables → Actions**. +3. Switch to the **Variables** tab. +4. Click **New repository variable**. +5. Set **Name** to `CI_RUN_ON_MAIN` and **Value** to `true`. +6. Save. + +**To disable again:** + +Delete the variable or change its value to anything other than `true`. + +**How it works:** + +The gate is applied inside [push_ci_policy.sh](../../../../../scripts/meta/resolve/push_ci_policy.sh), which the `run-policy` job invokes. When `GITHUB_REF == refs/heads/main` and `CI_RUN_ON_MAIN != 'true'`, the job emits `should_run=false` and every downstream job is skipped. + +| Variable value | Ref is `main` | Behaviour | +|---|---|---| +| *(not set / empty)* | yes | CI skipped ✓ | +| `true` | yes | CI runs ✓ | +| any other value | yes | CI skipped ✓ | +| *(any)* | no | Unaffected (CI runs per branch rules) ✓ | diff --git a/docs/contributing/tools/github/actions/workflows.md b/docs/contributing/tools/github/actions/workflows.md new file mode 100644 index 0000000000..216396aca5 --- /dev/null +++ b/docs/contributing/tools/github/actions/workflows.md @@ -0,0 +1,102 @@ +# GitHub Actions 🎬 + +This page is the SPOT (single point of truth) for every GitHub Actions workflow defined under the [workflows directory](../../../../../.github/workflows/). It lists each workflow together with a short description, its triggers, and the inputs it accepts. + +For the CI **flow** (orchestrator stages, gates, fork-PR handling) see [pipeline.md](../../../artefact/git/pipeline.md). For the **repository variables** that control CI behaviour see [configuration.md](configuration.md). For the **naming and shell-extraction conventions** that every workflow file MUST follow see [workflow.md](../../../artefact/files/github/workflow.md). For the **branch-prefix scopes** referenced by the PR entry workflow see [branch.md](../../../artefact/git/branch.md). For the **mirror architecture** referenced by the image workflows see [mirror.md](../../../artefact/image/mirror.md). + +## What GitHub Actions are 📘 + +GitHub Actions is GitHub's built-in CI/CD system. Each YAML file under `.github/workflows/` is one *workflow*; a workflow contains one or more *jobs*, and each job runs a sequence of *steps* on a hosted or self-hosted runner. Workflows are started by *triggers* declared in the `on:` section. The most common triggers in this repository are: + +- `push`: fires when commits land on a branch. +- `pull_request` / `pull_request_target`: fires on PR lifecycle events (`opened`, `synchronize`, `reopened`, `ready_for_review`, `closed`, `converted_to_draft`). The `_target` variant runs with the base-branch secrets and is used to grant fork PRs controlled access to privileged steps. +- `schedule`: cron-based periodic runs (UTC). +- `workflow_dispatch`: manual run from the GitHub UI or `gh workflow run`, optionally with inputs. +- `workflow_call`: the workflow is a *reusable workflow* and is only started by another workflow that calls it via `uses:`. +- `delete`: fires when a branch or tag is deleted. + +Workflows communicate through *inputs* (on `workflow_call` / `workflow_dispatch`), *outputs*, *concurrency groups* (which cancel or serialize runs with the same group key), and the `GITHUB_TOKEN` / repository secrets and variables. The entry points of this repository (`entry-*.yml`) translate external triggers into a call to the central [ci-orchestrator.yml](../../../../../.github/workflows/ci-orchestrator.yml). Most other workflows are reusable building blocks invoked from the orchestrator. + +## Workflow catalog 📚 + +Trigger column legend: **auto** = fires automatically (push, pull_request, schedule, delete); **manual** = `workflow_dispatch`; **reusable** = `workflow_call`. Multiple values mean the workflow accepts any of them. + +### Entry points 🚪 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [entry-pull-request-change.yml](../../../../../.github/workflows/entry-pull-request-change.yml): `⚡ CI: Pull Request` | Detects PR scope from changed files + branch prefix, then conditionally calls the orchestrator. | auto (`pull_request`, `pull_request_target`: opened, synchronize, reopened, ready_for_review) | none | +| [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml): `⚡ CI: Push` | Runs the orchestrator on pushes to `main`, `feature/**`, `hotfix/**`, `fix/**`, `alert-autofix-*`; on tagged `main` it also calls `release-version.yml`. Respects the `CI_CANCEL_IN_PROGRESS` and `CI_RUN_ON_MAIN` repository variables, see [configuration.md](configuration.md). | auto (`push`) | none | +| [entry-manual.yml](../../../../../.github/workflows/entry-manual.yml): `⚡ CI: Manual` | Manual dispatch of the full orchestrator for a chosen distro set and app whitelist. | manual | `distros` (default `debian`), `whitelist` (optional) | +| [entry-pull-request-cancel.yml](../../../../../.github/workflows/entry-pull-request-cancel.yml): `🚫 Cancel: PR Runs on Close` | Cancels active workflow runs for a PR when it is closed or converted to draft. | auto (`pull_request_target`: closed, converted_to_draft) | none | +| [delete-branch.yml](../../../../../.github/workflows/delete-branch.yml): `🚫 Cancel: Runs on Branch Delete` | Enters the push-entry concurrency group for the deleted branch so that any in-flight run on it is cancelled; a fallback step cancels remaining runs via the API. | auto (`delete`) | none | + +### Orchestration 🎵 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [ci-orchestrator.yml](../../../../../.github/workflows/ci-orchestrator.yml): `🎵 CI: Orchestrator` | Central coordinator. Runs fork-prereq wait, security, linting, CI image build, code tests, code-quality gate, DNS tests, mirror, deploy tests, install tests, development-environment test, final `done` gate. | reusable | `distros` (default `arch debian ubuntu fedora centos`), `whitelist` (optional), `image_wait_attempts` (default `1980`), `image_wait_sleep_seconds` (default `10`) | + +### Security and linting 🛡️🔍 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [security-codeql.yml](../../../../../.github/workflows/security-codeql.yml): `🔒 Scan: CodeQL (Advanced)` | CodeQL static analysis. | reusable, auto (`push` to `main`) | none | +| [lint-ansible.yml](../../../../../.github/workflows/lint-ansible.yml): `🔍 Lint: Ansible` | Runs `make lint-ansible`. | reusable | none | +| [lint-docker.yml](../../../../../.github/workflows/lint-docker.yml): `🔍 Lint: Dockerfiles` | hadolint on `Dockerfile` with SARIF upload. | reusable | none | +| [lint-python.yml](../../../../../.github/workflows/lint-python.yml): `🔍 Lint: Python` | `ruff` over the Python sources. | reusable | none | +| [lint-shell.yml](../../../../../.github/workflows/lint-shell.yml): `🔍 Lint: Shell Scripts` | `shellcheck` over every `*.sh` file. | reusable | none | + +### CI images 🐳 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [images-build-ci.yml](../../../../../.github/workflows/images-build-ci.yml): `🐳 Build: CI Images (all distros)` | Builds the per-distro CI base images consumed by all test jobs. | reusable | `distros` (required), `checkout_ref` (optional), `image_tag` (default `ci-${github.sha}`), `concurrency_channel` (default `default`) | +| [images-cleanup-ci.yml](../../../../../.github/workflows/images-cleanup-ci.yml): `🧹 Images: Cleanup CI (GHCR)` | Deletes CI images from GHCR older than N days. | auto (`schedule`: weekly Mon 00:00 UTC), manual | `days` (default `7`) | + +### Image mirroring 🪞 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [images-mirror-missing.yml](../../../../../.github/workflows/images-mirror-missing.yml): `🪞 Mirror: Docker Hub → GHCR (only missing)` | Mirrors only the upstream images that are not yet in GHCR. Called from the orchestrator before deploy tests. | reusable | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `source_repository`, `source_ref`, plus throttling knobs | +| [images-mirror-all.yml](../../../../../.github/workflows/images-mirror-all.yml): `🪞 Mirror: Docker Hub → GHCR` | Full nightly mirror of every referenced upstream image into GHCR. | auto (`schedule`: daily 00:00 UTC), manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `images_per_hour` (throttle) | +| [images-mirror-cleanup.yml](../../../../../.github/workflows/images-mirror-cleanup.yml): `🧹 Images: Cleanup GHCR (Private)` | Deletes GHCR mirror packages by prefix and visibility. Supports `dry_run`. | manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `visibility` (`private`/`public`/`internal`, default `private`), `dry_run` | + +### Code tests 🧪 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [test-code-unit.yml](../../../../../.github/workflows/test-code-unit.yml): `🧪 Test: Code (Units)` | Runs `make test-unit` in the CI container. | reusable | none | +| [test-code-integration.yml](../../../../../.github/workflows/test-code-integration.yml): `🧪 Test: Code (Integration)` | Runs `make test-integration` in the CI container. | reusable | none | +| [test-code-lint.yml](../../../../../.github/workflows/test-code-lint.yml): `🧪 Test: Code (Lint)` | Runs the project's own lint tests (not the external linters). | reusable | none | +| [test-code-external.yml](../../../../../.github/workflows/test-code-external.yml): `🧪 Test: Code (External)` | Runs `make test-external` against external services. | reusable, manual | none | + +### Infrastructure tests 🌐📦💻📥 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [test-dns.yml](../../../../../.github/workflows/test-dns.yml): `💬 Test: DNS` | Validates DNS resolution across target distributions. | reusable, manual | `distros` (required on call; default `debian` on manual) | +| [test-deploy-server.yml](../../../../../.github/workflows/test-deploy-server.yml): `📦 Test: Deploy (server)` | Deploy test for server and `web-*` roles. | reusable | `distros` (required), `whitelist` (optional) | +| [test-deploy-universal.yml](../../../../../.github/workflows/test-deploy-universal.yml): `📦 Test: Deploy (universal)` | Deploy test for shared system roles. | reusable | `distros` (required), `whitelist` (optional) | +| [test-deploy-workstation.yml](../../../../../.github/workflows/test-deploy-workstation.yml): `📦 Test: Deploy (workstation)` | Deploy test for workstation and `desk-*` roles. | reusable | `distros` (required), `whitelist` (optional) | +| [test-deploy-local.yml](../../../../../.github/workflows/test-deploy-local.yml): `📦 Test: Deploy (local)` | Local/self-hosted deploy test. Intended for `act` or manual dispatch, not part of the orchestrator. | manual | `test_deploy_type` (`server`/`universal`/`workstation`, default `server`), `distros` (default `debian`), `whitelist` (optional) | +| [test-install-make.yml](../../../../../.github/workflows/test-install-make.yml): `📥 Test: Install Make` | Validates the `make install` entry points. | reusable | none | +| [test-install-pkgmgr.yml](../../../../../.github/workflows/test-install-pkgmgr.yml): `📥 Test: Install Package Manager` | Validates installation via the upstream package manager. | reusable | none | +| [test-environment.yml](../../../../../.github/workflows/test-environment.yml): `💻 Test: Development Environment` | Builds and exercises the dev-runtime image matrix. | reusable, manual | none | + +### Release and maintenance 🚀🔄 + +| Workflow | Description | Trigger | Inputs | +|---|---|---|---| +| [release-version.yml](../../../../../.github/workflows/release-version.yml): `🚀 Release: Version Logic` | Releases a specific version tag (build + publish). Called from `entry-push-latest.yml` on tagged pushes. | reusable, manual | `tag` (required, e.g. `v1.2.3`) | +| [release-highest.yml](../../../../../.github/workflows/release-highest.yml): `🚀 Release: Highest Missing Version` | Scheduled backfill: finds the highest tag without a release and triggers `release-version.yml` for it. | auto (`schedule`: daily 00:00 UTC), manual | none | +| [update.yml](../../../../../.github/workflows/update.yml): `🔄 Update: Versions` | Updates Docker image versions and other pinned dependencies; opens an update PR. | auto (`push` to `main`, `schedule`: daily 00:30 UTC), manual | none | + +## Changing workflows ✍️ + +Before adding or editing a workflow file: + +1. Follow the naming schema and shell-extraction rules in [workflow.md](../../../artefact/files/github/workflow.md). +2. If the change affects the CI flow (stages, gates, order), also update [pipeline.md](../../../artefact/git/pipeline.md). +3. If the change adds or removes a repository variable, also update [configuration.md](configuration.md). +4. Update the relevant row in this page so the catalog stays accurate. diff --git a/docs/contributing/tools/github/branch/README.md b/docs/contributing/tools/github/branch/README.md index d90f8762e6..93adec9814 100644 --- a/docs/contributing/tools/github/branch/README.md +++ b/docs/contributing/tools/github/branch/README.md @@ -1,3 +1,3 @@ -# Branch Configuration 🌿 +# Branch Governance 🌿 -This section documents the GitHub branch settings for this repository: the branch protection rules enforced on `main` and the repository variables that control CI behaviour. +This section documents the branch protection rules enforced on `main`. For repository variables that control CI behaviour, see [configuration.md](../actions/configuration.md). diff --git a/docs/contributing/tools/github/branch/configuration.md b/docs/contributing/tools/github/branch/configuration.md deleted file mode 100644 index a2717ed859..0000000000 --- a/docs/contributing/tools/github/branch/configuration.md +++ /dev/null @@ -1,37 +0,0 @@ -# CI Configuration ⚙️ - -This page documents the repository variables that control CI pipeline behaviour. -Repository variables are set under **Settings → Secrets and variables → Actions → Variables**. - -## `CI_CANCEL_IN_PROGRESS` - -Controls whether a new push cancels an already-running CI pipeline on the same branch -in [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml). - -**Default behaviour (variable not set or set to any value other than `false`):** -In-progress runs are cancelled when a new push arrives. This is the recommended setting for most workflows. - -**To disable cancellation:** - -1. Open the repository on GitHub. -2. Go to **Settings → Secrets and variables → Actions**. -3. Switch to the **Variables** tab. -4. Click **New repository variable**. -5. Set **Name** to `CI_CANCEL_IN_PROGRESS` and **Value** to `false`. -6. Save. - -**To re-enable cancellation:** - -Delete the variable or change its value to anything other than `false` (e.g. `true`). - -**How it works:** - -```yaml -cancel-in-progress: ${{ vars.CI_CANCEL_IN_PROGRESS != 'false' }} -``` - -| Variable value | Expression result | Behaviour | -|---|---|---| -| *(not set / empty)* | `'' != 'false'` → `true` | Cancels in-progress runs ✓ | -| `false` | `'false' != 'false'` → `false` | Does **not** cancel ✓ | -| `true` | `'true' != 'false'` → `true` | Cancels in-progress runs ✓ | diff --git a/scripts/meta/resolve/push_ci_policy.sh b/scripts/meta/resolve/push_ci_policy.sh index 79aa19813a..19df193dcd 100755 --- a/scripts/meta/resolve/push_ci_policy.sh +++ b/scripts/meta/resolve/push_ci_policy.sh @@ -4,6 +4,17 @@ set -euo pipefail : "${GITHUB_EVENT_CREATED:?Missing GITHUB_EVENT_CREATED}" : "${GITHUB_OUTPUT:?Missing GITHUB_OUTPUT}" : "${GITHUB_SHA:?Missing GITHUB_SHA}" +: "${GITHUB_REF:?Missing GITHUB_REF}" + +if [[ "${GITHUB_REF}" == "refs/heads/main" && "${CI_RUN_ON_MAIN:-}" != "true" ]]; then + { + echo "should_run=false" + echo "skip_reason=main-push-gated-by-ci-run-on-main" + echo "commit_in_main=true" + } >>"${GITHUB_OUTPUT}" + echo "Push to main detected and repository variable CI_RUN_ON_MAIN is not 'true' -> CI will be skipped." + exit 0 +fi if [[ "${GITHUB_EVENT_CREATED}" != "true" ]]; then { From b2c203dd5600281d4b8133e29b2c24f8cc562cfd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 18 Apr 2026 14:44:35 +0000 Subject: [PATCH 5/6] chore(images): update Docker image versions --- roles/web-app-funkwhale/config/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-funkwhale/config/main.yml b/roles/web-app-funkwhale/config/main.yml index e221597ea9..5f61c5d681 100644 --- a/roles/web-app-funkwhale/config/main.yml +++ b/roles/web-app-funkwhale/config/main.yml @@ -9,7 +9,7 @@ compose: version: "2.0.1" typesense: image: "typesense/typesense" - version: "30.1" + version: "30.2" logout: enabled: true shared: true From 433a4138ddf315058e67ba178afa1fdcfa611867 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 18 Apr 2026 17:11:28 +0200 Subject: [PATCH 6/6] feat(ci): recognize chore branch prefix Treat chore/** branches like feature/fix/etc. for CI: trigger the push pipeline on chore/** pushes and accept chore as a valid PR branch prefix in full scope. This unblocks the chore/update-* PRs that update.yml creates automatically, which previously failed branch-prefix validation and never triggered the push pipeline. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/entry-push-latest.yml | 1 + docs/contributing/artefact/git/branch.md | 2 ++ docs/contributing/tools/github/actions/workflows.md | 2 +- scripts/meta/resolve/pr/branch_prefix.sh | 2 +- tests/integration/test_pr_branch_prefix.py | 7 +++++++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/entry-push-latest.yml b/.github/workflows/entry-push-latest.yml index 4ee4e87037..238629ef5b 100644 --- a/.github/workflows/entry-push-latest.yml +++ b/.github/workflows/entry-push-latest.yml @@ -11,6 +11,7 @@ on: - "feature/**" - "hotfix/**" - "fix/**" + - "chore/**" - "alert-autofix-*" permissions: diff --git a/docs/contributing/artefact/git/branch.md b/docs/contributing/artefact/git/branch.md index 1241d57c97..16da4465b0 100644 --- a/docs/contributing/artefact/git/branch.md +++ b/docs/contributing/artefact/git/branch.md @@ -10,6 +10,7 @@ The branch prefix MUST match the type of change. The [PR workflow](pull-request. | `documentation` | Documentation-only changes | `**/*.md`, `**/*.rst` (outside agent paths) | Skips [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml), finishes green through the lightweight scope gate. | | `feature` | New features or enhancements | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. | | `fix` | Bug fixes | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. | +| `chore` | Maintenance, dependency, and tooling updates (incl. branches created by [update.yml](../../../../.github/workflows/update.yml)) | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. | | `alert-autofix` | Automated alert-triggered fixes | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. | | `dependabot` | Automated dependency updates | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. | @@ -29,6 +30,7 @@ The full branch name MUST follow one of the patterns below, depending on whether | Role feature | `feature//` | `feature/web-app-matomo/ldap-integration` | | General fix | `fix//` | `fix/dns-resolution/taiga-123` | | Role fix | `fix///` | `fix/web-app-matomo/login-redirect/taiga-789` | +| Chore | `chore/` | `chore/update-docker-image-versions` | | Alert autofix | `alert-autofix-` | `alert-autofix-261` | | Documentation | `documentation/` | `documentation/contributing-setup` | | Agent | `agent/` | `agent/improve-commit-instructions` | diff --git a/docs/contributing/tools/github/actions/workflows.md b/docs/contributing/tools/github/actions/workflows.md index 216396aca5..ca79aca541 100644 --- a/docs/contributing/tools/github/actions/workflows.md +++ b/docs/contributing/tools/github/actions/workflows.md @@ -26,7 +26,7 @@ Trigger column legend: **auto** = fires automatically (push, pull_request, sched | Workflow | Description | Trigger | Inputs | |---|---|---|---| | [entry-pull-request-change.yml](../../../../../.github/workflows/entry-pull-request-change.yml): `⚡ CI: Pull Request` | Detects PR scope from changed files + branch prefix, then conditionally calls the orchestrator. | auto (`pull_request`, `pull_request_target`: opened, synchronize, reopened, ready_for_review) | none | -| [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml): `⚡ CI: Push` | Runs the orchestrator on pushes to `main`, `feature/**`, `hotfix/**`, `fix/**`, `alert-autofix-*`; on tagged `main` it also calls `release-version.yml`. Respects the `CI_CANCEL_IN_PROGRESS` and `CI_RUN_ON_MAIN` repository variables, see [configuration.md](configuration.md). | auto (`push`) | none | +| [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml): `⚡ CI: Push` | Runs the orchestrator on pushes to `main`, `feature/**`, `hotfix/**`, `fix/**`, `chore/**`, `alert-autofix-*`; on tagged `main` it also calls `release-version.yml`. Respects the `CI_CANCEL_IN_PROGRESS` and `CI_RUN_ON_MAIN` repository variables, see [configuration.md](configuration.md). | auto (`push`) | none | | [entry-manual.yml](../../../../../.github/workflows/entry-manual.yml): `⚡ CI: Manual` | Manual dispatch of the full orchestrator for a chosen distro set and app whitelist. | manual | `distros` (default `debian`), `whitelist` (optional) | | [entry-pull-request-cancel.yml](../../../../../.github/workflows/entry-pull-request-cancel.yml): `🚫 Cancel: PR Runs on Close` | Cancels active workflow runs for a PR when it is closed or converted to draft. | auto (`pull_request_target`: closed, converted_to_draft) | none | | [delete-branch.yml](../../../../../.github/workflows/delete-branch.yml): `🚫 Cancel: Runs on Branch Delete` | Enters the push-entry concurrency group for the deleted branch so that any in-flight run on it is cancelled; a fallback step cancels remaining runs via the API. | auto (`delete`) | none | diff --git a/scripts/meta/resolve/pr/branch_prefix.sh b/scripts/meta/resolve/pr/branch_prefix.sh index 05c1f63ff2..8d66ba300c 100755 --- a/scripts/meta/resolve/pr/branch_prefix.sh +++ b/scripts/meta/resolve/pr/branch_prefix.sh @@ -28,7 +28,7 @@ documentation) expected_prefixes=(documentation) ;; full) - expected_prefixes=(feature fix dependabot alert-autofix) + expected_prefixes=(feature fix chore dependabot alert-autofix) ;; *) echo "ERROR: Unsupported PR_SCOPE '${PR_SCOPE}'." >&2 diff --git a/tests/integration/test_pr_branch_prefix.py b/tests/integration/test_pr_branch_prefix.py index 148cecb5d2..0b1d12e763 100644 --- a/tests/integration/test_pr_branch_prefix.py +++ b/tests/integration/test_pr_branch_prefix.py @@ -48,6 +48,13 @@ class TestPullRequestBranchPrefix(unittest.TestCase): self.assertEqual(result.returncode, 0) self.assertIn("Validated branch prefix 'fix'", result.stdout) + def test_full_scope_accepts_chore_prefix(self): + result = self._run_script( + scope="full", head_ref="chore/update-docker-image-versions" + ) + self.assertEqual(result.returncode, 0) + self.assertIn("Validated branch prefix 'chore'", result.stdout) + def test_mismatched_prefix_fails(self): result = self._run_script(scope="documentation", head_ref="feature/add-docs") self.assertNotEqual(result.returncode, 0)