mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 14:30:52 +00:00
feat(ci): diff-driven app whitelist for deploy tests
Narrow the test-deploy-{server,universal,workstation} matrix to roles
actually impacted by the branch's diff against origin/main, expanded
transitively over run_after + dependencies + shared services.
Why: full-matrix deploy CI on every PR is wasteful; explicit per-PR
whitelisting is error-prone. The resolver derives the affected set
automatically while remaining fail-safe.
Behaviour (in resolve_effective_whitelist.sh precedence order):
- whitelist input "__ALL__" -> empty whitelist (force full deploy)
- whitelist input non-empty -> verbatim
- whitelist input empty -> diff vs origin/main
- empty diff or any path outside roles/<role>/ -> __ALL__
- all paths under roles/<role>/ -> reverse closure
Fail-safe: any seed that is not modellable in CombinedResolver
(no application_id and not referenced by any role's run_after) and
any resolver runtime error MUST trigger a fall-back to __ALL__.
The closure never silently shrinks the deploy matrix.
test-deploy-local.yml is intentionally exempt (local/manual dispatch
keeps explicit whitelist semantics).
Documented in pipeline.md and workflows.md.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
196c5bac28
commit
91fadbdcc5
12 files changed
+533
-12
No files matched your search
@@ -1,5 +1,5 @@
|
||||
name: "⚡ CI: Manual"
|
||||
run-name: "Manual CI triggered: ${{ inputs.distros }}; ${{ inputs.whitelist != '' && inputs.whitelist || 'all apps' }}"
|
||||
run-name: "Manual CI triggered: ${{ inputs.distros }}; ${{ inputs.whitelist != '' && inputs.whitelist || 'diff-derived (origin/main)' }}"
|
||||
|
||||
concurrency:
|
||||
group: global-ci-${{ github.repository }}-${{ github.ref_name }}
|
||||
@@ -14,7 +14,7 @@ on:
|
||||
default: "debian"
|
||||
type: string
|
||||
whitelist:
|
||||
description: "Optional space-separated whitelist of app ids. Example: 'web-app-matomo web-app-chess'"
|
||||
description: "Empty: diff vs origin/main. '__ALL__': force full deploy. Else: explicit space-separated app ids."
|
||||
required: false
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
@@ -34,6 +34,8 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Resolve repository owner
|
||||
shell: bash
|
||||
@@ -54,12 +56,19 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up
|
||||
|
||||
|
||||
- name: Resolve effective whitelist (diff vs origin/main)
|
||||
id: resolve_wl
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_WHITELIST: ${{ inputs.whitelist }}
|
||||
run: ./scripts/github/resolve_effective_whitelist.sh
|
||||
|
||||
- name: Discover apps
|
||||
id: discover
|
||||
shell: bash
|
||||
env:
|
||||
WHITELIST: ${{ inputs.whitelist }}
|
||||
WHITELIST: ${{ steps.resolve_wl.outputs.whitelist }}
|
||||
run: ./scripts/github/output_apps.sh
|
||||
|
||||
server:
|
||||
|
||||
@@ -34,6 +34,8 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Resolve repository owner
|
||||
shell: bash
|
||||
@@ -51,11 +53,18 @@ jobs:
|
||||
set -euo pipefail
|
||||
make up
|
||||
|
||||
- name: Resolve effective whitelist (diff vs origin/main)
|
||||
id: resolve_wl
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_WHITELIST: ${{ inputs.whitelist }}
|
||||
run: ./scripts/github/resolve_effective_whitelist.sh
|
||||
|
||||
- name: Discover apps
|
||||
id: discover
|
||||
shell: bash
|
||||
env:
|
||||
WHITELIST: ${{ inputs.whitelist }}
|
||||
WHITELIST: ${{ steps.resolve_wl.outputs.whitelist }}
|
||||
run: ./scripts/github/output_apps.sh
|
||||
|
||||
universal:
|
||||
|
||||
@@ -34,6 +34,8 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Resolve repository owner
|
||||
shell: bash
|
||||
@@ -51,11 +53,18 @@ jobs:
|
||||
set -euo pipefail
|
||||
make up
|
||||
|
||||
- name: Resolve effective whitelist (diff vs origin/main)
|
||||
id: resolve_wl
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_WHITELIST: ${{ inputs.whitelist }}
|
||||
run: ./scripts/github/resolve_effective_whitelist.sh
|
||||
|
||||
- name: Discover apps
|
||||
id: discover
|
||||
shell: bash
|
||||
env:
|
||||
WHITELIST: ${{ inputs.whitelist }}
|
||||
WHITELIST: ${{ steps.resolve_wl.outputs.whitelist }}
|
||||
run: ./scripts/github/output_apps.sh
|
||||
|
||||
workstation:
|
||||
|
||||
Reference in new issue
Block a user