From ca7ae352ae3928b48b1ea1e7f0fd18bf609e0ca7 Mon Sep 17 00:00:00 2001 From: navigator Date: Thu, 1 Oct 2026 04:36:42 +0000 Subject: [PATCH 1/2] ci: build and lint in an unprivileged trixie system container The build ran in a debian:trixie application container. Keel runs no application containers in CI, so the job now calls lxc-trixie.yml of Keel-Linux/.github: a trixie LXC container of the runner user on keel-lxc-1, without sudo, with the same commands inside. The job only runs for this repository's own branches, so a fork pull request gets no build or lint result. The check becomes build / trixie; it is not required. --- .github/workflows/package.yml | 102 ++++++++++++++-------------------- 1 file changed, 41 insertions(+), 61 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 45ced9b..f6fe5cc 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -1,21 +1,23 @@ # Build and lint this package on trixie (handbook decision 0041, first -# implementation, step 5). The check is "package / build". +# implementation, step 5). The check is "build / trixie". # -# build: gbp buildpackage in a debian:trixie container with -# trixie-backports enabled, source and binary, the orig tarball rebuilt -# from the pristine-tar branch. lintian then checks the .changes and any -# error or warning fails the job, as packages/build of Keel-Linux/common -# does. Nothing is signed or published; the files are kept as the -# artifact "debs". +# build: gbp buildpackage in a Debian trixie system container, an +# unprivileged LXC container with its own systemd on the self-hosted runner +# keel-lxc-1, through the reusable workflow lxc-trixie.yml of +# Keel-Linux/.github, with trixie-backports enabled; source and binary, the +# orig tarball rebuilt from the pristine-tar branch. lintian then checks the +# .changes and any error or warning fails the job, as packages/build of +# Keel-Linux/common does. Nothing is signed or published; the files are kept +# as the artifact "debs". Keel runs no application containers in CI. # # This package has no debian/tests of its own. Its rules are exercised by # the autopkgtest of Keel-Linux/libnginx-mod-http-coraza, whose CI builds # keel/trixie of this repository and asserts that CRS blocks SQL # injection, cross-site scripting and path traversal. # -# Keel-Linux/.github's reusable build-deb.yml does not fit: it runs on the -# self-hosted keel-lxc runner, not registered yet, and neither uses gbp nor -# lints. This workflow follows Keel-Linux/common's packages.yml instead. +# A pull request from a fork never reaches the self-hosted runner: the job +# runs only for this repository's own branches, so a fork pull request gets +# no build or lint result here. name: package on: @@ -27,56 +29,34 @@ on: permissions: contents: read -env: - DEBIAN_FRONTEND: noninteractive - jobs: build: - runs-on: ubuntu-latest - container: debian:trixie - timeout-minutes: 30 - steps: - - name: Enable trixie-backports and install the tools - run: | - echo 'deb http://deb.debian.org/debian trixie-backports main' \ - > /etc/apt/sources.list.d/trixie-backports.list - apt-get update -qq - apt-get install -y -qq --no-install-recommends \ - ca-certificates git git-buildpackage pristine-tar \ - devscripts equivs lintian - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Track the upstream and pristine-tar branches - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - # As gbp clone does: upstream's .gitattributes must not change - # what is exported, or the tree no longer matches the orig tarball. - gbp setup-gitattributes - for branch in upstream/latest pristine-tar; do - git branch -f "$branch" "origin/$branch" - done - - name: Install the build dependencies - run: | - cd "$RUNNER_TEMP" - mk-build-deps --install --remove \ - --tool 'apt-get -y -qq --no-install-recommends' \ - "$GITHUB_WORKSPACE/debian/control" - - name: Build - run: | - gbp buildpackage --git-ignore-branch \ - --git-export-dir="$RUNNER_TEMP/build-area" \ - --git-builder='dpkg-buildpackage -us -uc' - mkdir dist - cp "$RUNNER_TEMP"/build-area/*.deb "$RUNNER_TEMP"/build-area/*.dsc \ - "$RUNNER_TEMP"/build-area/*.tar.* "$RUNNER_TEMP"/build-area/*.buildinfo \ - "$RUNNER_TEMP"/build-area/*.changes dist/ - - name: Lint - run: | - lintian --fail-on error,warning --info --display-info \ - dist/*.changes - - uses: actions/upload-artifact@v4 - with: - name: debs - path: dist/ - if-no-files-found: error + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + uses: keel-linux/.github/.github/workflows/lxc-trixie.yml@ci/lxc-trixie + with: + backports: true + fetch-depth: 0 + timeout: 30 + artifact-dir: dist + artifact-name: debs + run: | + apt-get update -qq + apt-get install -y -qq --no-install-recommends \ + ca-certificates git git-buildpackage pristine-tar \ + devscripts equivs lintian + # As gbp clone does: upstream's .gitattributes must not change what + # is exported, or the tree no longer matches the orig tarball. + gbp setup-gitattributes + for branch in upstream/latest pristine-tar; do + git branch -f "$branch" "origin/$branch" + done + (cd /tmp && mk-build-deps --install --remove \ + --tool 'apt-get -y -qq --no-install-recommends' /src/debian/control) + gbp buildpackage --git-ignore-branch \ + --git-export-dir=/tmp/build-area \ + --git-builder='dpkg-buildpackage -us -uc' + lintian --fail-on error,warning --info --display-info \ + /tmp/build-area/*.changes + mkdir dist + cp /tmp/build-area/*.deb /tmp/build-area/*.dsc /tmp/build-area/*.tar.* \ + /tmp/build-area/*.buildinfo /tmp/build-area/*.changes dist/ From 9435776c16d9355f63f877e4581fef6914c8ea48 Mon Sep 17 00:00:00 2001 From: navigator Date: Thu, 1 Oct 2026 05:39:33 +0000 Subject: [PATCH 2/2] ci: call lxc-trixie.yml at main, with no fork guard of our own Keel-Linux/.github#17 is merged, so the jobs call lxc-trixie.yml at main instead of its pull request branch. The calling jobs lose their own if: guard: the reusable workflow's trixie job already refuses forks and pull_request_target, and a guard here would also skip its fork-not-run job, which is what makes a fork's pull request show red instead of a skipped check that reads as passed. --- .github/workflows/package.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index f6fe5cc..3e60788 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -31,8 +31,7 @@ permissions: jobs: build: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository - uses: keel-linux/.github/.github/workflows/lxc-trixie.yml@ci/lxc-trixie + uses: keel-linux/.github/.github/workflows/lxc-trixie.yml@main with: backports: true fetch-depth: 0