Skip to content
Draft
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
12 changes: 2 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ updates:
commit-message:
prefix: "ci"
include: "scope"
# The application publisher stays on the exact revision Platform has reviewed and approved
# for tenants, which `Platform Admissibility` enforces. Every devantler-tech/.github release
# moves the publisher's tag together with the callers below, so while Dependabot proposed it,
# every group pull request failed that check until someone put the publisher back by hand
# (#275 through #282, issue #283). Move this pin by hand, in its own change, once Platform
# approves a newer revision.
ignore:
- dependency-name: "devantler-tech/.github/.github/workflows/publish-app.yaml"
# The workflow-caller contract requires the maintained release and template-sync callers
# to share one commit. Dependabot treats each reusable workflow as its own dependency, so
# UNGROUPED it opens one PR per caller (#156, #157 and #158 each touched exactly one file) —
# and every one of those lands with the other two still behind, failing that assertion in
# required CI. No merge order rescues it: the first caller updated always disagrees with the
# rest. Grouping advances the callers in one PR; the publisher is ignored above, so the group
# never has to wait for a Platform approval.
# rest. Grouping advances the callers in one PR. The publish-app action moves with them: it signs as
# this repository, so a new revision needs no Platform approval (ADR 0017).
groups:
devantler-tech-actions:
patterns:
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ permissions: {}
jobs:
publish:
name: Publish
# Skipped in the template repo itself (it ships no app); runs in every tenant
# created from this template. The template is matched by its repository ID,
# which survives the rename from platform-tenant-template to application-template.
# The upstream template has no application to publish; its ID survives renames.
if: github.repository_id != '1253884448'
runs-on: ubuntu-latest
timeout-minutes: 60
concurrency:
group: publish-verified-${{ github.repository }}
Comment thread
devantler marked this conversation as resolved.
Resolved
queue: max
cancel-in-progress: false
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
permissions:
contents: read # checkout
packages: write # push image + manifests OCI artifact
id-token: write # keyless cosign signing (via GitHub OIDC)
uses: devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 # v19.0.5
with:
# publish-app pins the freshly built image digest into the container with
# this name in deploy/deployment.yaml. Keep that container's name equal to
# the repository name (the platform's signed-publish convention).
app-name: ${{ github.event.repository.name }}
# The signature this publish mints carries the `uses:` ref above in its
# certificate. Platform has independently approved this exact maintained
# revision for manifests, admission and node pulls. Other maintained
# revisions, tags and branches fail closed; a full SHA alone does not
# grant approval. The guard below checks only that the ref is a commit
# SHA, so an unapproved SHA still publishes, but its artifact never
# verifies in-cluster and the tenant silently stops reconciling. Get the
# new revision approved in Platform before changing this pin.
#
# Enabling the guard adds the producer-side half: the publish refuses to
# sign at all, before the build, so a tag or branch ref surfaces here as a failed
# release instead of as an artifact the cluster quietly rejects.
enable-caller-pin: true
contents: read
packages: write
id-token: write
steps:
- name: 🔒 Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: 📦 Publish signed application
id: publish
uses: devantler-tech/.github/actions/publish-app@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
app-name: ${{ github.event.repository.name }}
app-manifest: ${{ hashFiles('deploy/base/deployment.yaml') != '' && 'base/deployment.yaml' || 'deployment.yaml' }}
80 changes: 79 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ jobs:
persist-credentials: false
- name: 📌 Validate reusable workflow caller pins
run: sh scripts/workflow-caller-pin-contract.test.sh
# template:begin
- name: Install released actionlint for the compatibility control
run: |
archive="${RUNNER_TEMP}/actionlint.tar.gz"
curl --fail --silent --show-error --location \
https://github.com/rhysd/actionlint/releases/download/v1.7.12/actionlint_1.7.12_linux_amd64.tar.gz \
--output "$archive"
echo "8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 $archive" | sha256sum --check --status
mkdir -p "${RUNNER_TEMP}/actionlint-bin"
tar -xzf "$archive" --directory "${RUNNER_TEMP}/actionlint-bin" actionlint
echo "${RUNNER_TEMP}/actionlint-bin" >>"$GITHUB_PATH"
shell: bash
- name: Test concurrency queue validation
run: bash scripts/validate-workflow-queues.test.sh
# template:end

# Validates the two tenant-owned artifacts that CD publishes: the image and deploy/.
delivery-inputs:
Expand Down Expand Up @@ -118,6 +133,65 @@ jobs:
sh "${RUNNER_TEMP}/publish-pin-approved.sh" "${RUNNER_TEMP}/base-cd.yaml" .github/workflows/cd.yaml
# tenancy:end

# template:begin
release-queue-proof:
name: Release queue proof (${{ matrix.slot }})
runs-on: ubuntu-latest
timeout-minutes: 3
permissions: {}
strategy:
fail-fast: false
matrix:
slot: [first, second, third]
concurrency:
group: release-queue-proof-${{ github.run_id }}-${{ github.run_attempt }}
queue: max
cancel-in-progress: false
steps:
- name: Hold the publication slot while the other jobs queue
env:
SLOT: ${{ matrix.slot }}
run: |
sleep 15
printf '%s\n' "$SLOT" >"${RUNNER_TEMP}/queue-proof.txt"
shell: bash
- name: Publish the disposable queue receipt
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-queue-proof-${{ matrix.slot }}
path: ${{ runner.temp }}/queue-proof.txt
if-no-files-found: error
retention-days: 1
overwrite: true # replace only this slot's disposable receipt on rerun
release-queue-receipts:
name: Release queue receipts
runs-on: ubuntu-latest
timeout-minutes: 3
needs: [release-queue-proof]
permissions:
actions: read # native workflow-run metadata only
if: ${{ always() }}
steps:
- name: Require all three native publication slots
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api --paginate --slurp \
"repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/jobs?filter=all&per_page=100" |
jq -e --argjson attempt "$GITHUB_RUN_ATTEMPT" \
'[.[] | .jobs[] | select(.name | startswith("Release queue proof (")) | select(.run_attempt <= $attempt)] |
group_by(.name) | map(max_by([.run_attempt, .id])) as $jobs |
($jobs | length) == 3 and
([$jobs[].name] | sort) == ["Release queue proof (first)", "Release queue proof (second)", "Release queue proof (third)"] and
all($jobs[]; .status == "completed" and .conclusion == "success")'
gh api --paginate --slurp \
"repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts?per_page=100" |
jq -e '[.[] | .artifacts[] | select(.name | startswith("release-queue-proof-"))] as $artifacts |
([$artifacts[].name] | sort) == ["release-queue-proof-first", "release-queue-proof-second", "release-queue-proof-third"] and
all($artifacts[]; .expired == false and .size_in_bytes > 0)'
shell: bash
# template:end

ci-required-checks:
name: CI - Required Checks
runs-on: ubuntu-latest
Expand All @@ -127,14 +201,18 @@ jobs:
- workflow-caller-pins # tenancy
- delivery-inputs # tenancy
- publish-pin-approved # tenancy
# template:begin
- release-queue-proof
- release-queue-receipts
# template:end
permissions:
actions: read # native workflow-run metadata only
if: ${{ always() }}
steps:
# Every result in `needs` is consumed, so a job listed there can never be left out.
- name: 📊 Require all CI checks to pass
id: ci-checks
uses: devantler-tech/.github/actions/aggregate-job-checks@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/actions/aggregate-job-checks@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
check-workflow-startup: "true"
job-results: ${{ join(needs.*.result, ' ') }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Validate concurrency queues before the compatibility rule
run: bash scripts/validate-workflow-queues.sh
# Read-only: a finding a linter could fix still fails the job, so fix it locally.
- name: 🧹 MegaLinter
uses: oxsecurity/megalinter/flavors/cupcake@f2fe8c1cba37091848df3e524066c8c23ef353ed # v10.2.0
env:
VALIDATE_ALL_CODEBASE: true
APPLY_FIXES: none
# actionlint in MegaLinter does not know the newer `code-quality` permission yet.
ACTION_ACTIONLINT_ARGUMENTS: -ignore code-quality
# The preceding gate validates queue values and non-cancellation. Released
# actionlint lacks that field; every unrelated diagnostic remains active.
ACTION_ACTIONLINT_ARGUMENTS: -ignore code-quality -ignore unexpected.key..queue..for..concurrency..section
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# Skipped in the template repo itself; runs in every application created from it.
# The template is matched by its repository ID, which survives renames.
if: github.repository_id != '1253884448'
uses: devantler-tech/.github/.github/workflows/create-release.yaml@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/.github/workflows/create-release.yaml@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
disable-issue-side-effects: true
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
triage:
# Keep portfolio automation disabled in external template copies.
if: ${{ github.repository_owner == 'devantler-tech' }}
uses: devantler-tech/.github/.github/workflows/triage-stale-issues.yaml@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/.github/workflows/triage-stale-issues.yaml@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
permissions:
issues: write
actions: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
permissions:
contents: write
pull-requests: write
uses: devantler-tech/.github/.github/workflows/template-sync.yaml@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/.github/workflows/template-sync.yaml@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
source-repo-path: devantler-tech/platform-tenant-template
use-app-token: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate-scaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ jobs:
# published digest, which needs registry access and a real signed image. The
# scaffold's placeholder tag is neither, so applying them here could only ever
# produce a false failure. Tenant images earn their signature at publish time —
# `cd.yaml` calls the shared `publish-app.yaml`, whose keyless signing identity
# is what `verify-app-images` accepts — so provenance is enforced in CD and at
# `cd.yaml` runs the `actions/publish-app` action, whose keyless signing identity
# (this repository's own `cd.yaml` on a release tag) is what `verify-app-images` accepts — so provenance is enforced in CD and at
# admission, just not in this offline gate.
admissibility:
name: Platform Admissibility
Expand Down Expand Up @@ -1111,7 +1111,7 @@ jobs:
egress-policy: audit
- name: 📣 Open or update the drift issue
if: needs.validate-scaffold.result != 'success' || needs.admissibility.result != 'success' || needs.pod-security-admission.result != 'success'
uses: devantler-tech/.github/actions/upsert-issue@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/actions/upsert-issue@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
title: "Scheduled scaffold validation is failing on main"
body: |
Expand All @@ -1125,7 +1125,7 @@ jobs:
Read the failing step's message first: a check that could not evaluate its input names that as its cause, separately from a policy verdict. This issue is updated by every failing scheduled run and closed by the next passing one.
- name: ✅ Close the drift issue
if: needs.validate-scaffold.result == 'success' && needs.admissibility.result == 'success' && needs.pod-security-admission.result == 'success'
uses: devantler-tech/.github/actions/upsert-issue@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/actions/upsert-issue@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
title: "Scheduled scaffold validation is failing on main"
open: "false"
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/validate-stacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,19 @@ jobs:

# The shared lint job every non-Go application runs, on the fresh scaffold. The
# runner temp directory is mounted at /github/runner_temp in the linter container.
- name: Validate scaffold concurrency queues
if: matrix.stack != 'go'
working-directory: ${{ env.APP }}
run: bash scripts/validate-workflow-queues.sh
- name: 🧹 Lint the scaffold
if: matrix.stack != 'go'
uses: oxsecurity/megalinter/flavors/cupcake@f2fe8c1cba37091848df3e524066c8c23ef353ed # v10.2.0
env:
DEFAULT_WORKSPACE: /github/runner_temp/demo-app
VALIDATE_ALL_CODEBASE: true
APPLY_FIXES: none
ACTION_ACTIONLINT_ARGUMENTS: -ignore code-quality
# The preceding gate validates the field missing from released actionlint.
ACTION_ACTIONLINT_ARGUMENTS: -ignore code-quality -ignore unexpected.key..queue..for..concurrency..section

- name: ⚙️ Set up Go
if: matrix.stack == 'go'
Expand All @@ -82,7 +87,7 @@ jobs:

- name: 🧪 Build and test .NET
if: matrix.stack == 'dotnet'
uses: devantler-tech/.github/actions/run-dotnet-tests@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/actions/run-dotnet-tests@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
working-directory: ${{ env.APP }}
github-token: ""
Expand Down Expand Up @@ -138,7 +143,7 @@ jobs:
steps:
- name: 📊 Require every stack to pass
id: checks
uses: devantler-tech/.github/actions/aggregate-job-checks@3cab796adef97dcde0c55724866a0b19397aba39 # v21.6.2
uses: devantler-tech/.github/actions/aggregate-job-checks@d70d50665465117f01104313e53057374a96a1a3 # v21.7.2
with:
check-workflow-startup: "true"
job-results: ${{ join(needs.*.result, ' ') }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ Default PR CI always builds the tenant image and renders `deploy/` before merge,
secrets or write authority. Keep the `delivery-inputs` job and its entry in
`ci-required-checks` when you change the stack job. This catches the same image and manifest
failures in the pull request that introduced them instead of during release or reconciliation.
Keep the `publish-pin-approved` job and its entry too: it holds back a dependency update that
moves the publishing workflow to a revision the platform has not yet approved for your tenant,
so the release it would cut does not fail to deploy. An application scaffolded without
Keep the `publish-pin-approved` job and its entry too: it refuses a `cd.yaml` that leaves the
minimal tag-only, credential-free frame your releases are signed in, and it still holds back a
move back to a shared publisher revision the platform has not approved for your tenant. An application scaffolded without
`--tenancy` has neither job.

After authorized App setup and platform registration, eligible Conventional Commits can produce
Expand Down
Loading
Loading