From 619f4fba31227c6fa9db5f238c86d57659784530 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 14 Nov 2026 10:14:06 +0100 Subject: [PATCH 01/35] ci: promote tested images and prepare chart releases --- .commitlintrc.json | 9 + .github/dependabot.yml | 22 ++- .github/release-drafter.yml | 74 -------- .github/workflows/__shared-ci.yml | 171 +++++++++++------- .github/workflows/main-ci.yml | 11 +- .github/workflows/prepare-release.yml | 18 ++ .github/workflows/pull-request-ci.yml | 25 +-- .github/workflows/release.yml | 189 ++++++++++++-------- .github/workflows/semantic-pull-request.yml | 13 ++ .github/workflows/stale.yml | 10 +- .golangci.yml | 94 +++------- 11 files changed, 324 insertions(+), 312 deletions(-) create mode 100644 .commitlintrc.json delete mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/prepare-release.yml create mode 100644 .github/workflows/semantic-pull-request.yml diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 0000000..582921f --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,9 @@ +{ + "extends": ["@commitlint/config-conventional"], + "rules": { + "subject-case": [1, "never", ["sentence-case", "start-case", "pascal-case", "upper-case"]], + "header-max-length": [1, "always", 100], + "body-max-line-length": [1, "always", 100], + "footer-max-line-length": [1, "always", 100] + } +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 993cdfc..853287f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,39 +1,47 @@ # .github/dependabot.yml version: 2 updates: - - package-ecosystem: "github-actions" + cooldown: + default-days: 7 + commit-message: + prefix: build + include: scope directory: "/" open-pull-requests-limit: 20 groups: github-actions-dependencies: patterns: - - '*' + - "*" schedule: interval: "weekly" day: friday - time: '04:00' + time: "04:00" - package-ecosystem: "docker" + cooldown: + default-days: 7 directory: "/" open-pull-requests-limit: 20 groups: docker-dependencies: patterns: - - '*' + - "*" schedule: interval: "weekly" day: friday - time: '04:10' + time: "04:10" - package-ecosystem: "gomod" + cooldown: + default-days: 7 directory: "/" open-pull-requests-limit: 20 groups: go-dependencies: patterns: - - '*' + - "*" schedule: interval: "weekly" day: friday - time: '04:20' + time: "04:20" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 8334d0d..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,74 +0,0 @@ -template: | - # What's Changed - $CHANGES - **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION -name-template: "Version $RESOLVED_VERSION" -tag-template: "$RESOLVED_VERSION" - -categories: - - title: '๐Ÿš€ Features' - labels: - - 'feature' - - 'feat' - - title: '๐Ÿ› Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '๐Ÿงฐ Maintenance' - label: 'chore' - - title: '๐Ÿ“š Documentation' - label: 'docs' - - title: '๐Ÿงช Tests' - label: 'test' - - title: '๐Ÿท๏ธ Version Tags' - label: 'version' - - title: '๐Ÿ”– Release Tags' - label: 'release' - - title: '๐Ÿงฉ Dependencies' - label: 'dependencies' - - title: '๐Ÿ”’ Security' - label: 'security' - - title: '๐Ÿšจ Breaking Changes' - label: 'breaking' - - title: '๐Ÿงน Code Cleanup' - label: 'cleanup' - - title: '๐Ÿ”ง Config' - label: 'config' - - title: '๐Ÿ“ฆ Packages' - label: 'package' - - title: '๐Ÿ”ฅ Removals' - label: 'removal' - - title: '๐Ÿšง Work In Progress' - label: 'wip' - - title: '๐Ÿ”€ Merges' - label: 'merge' - - title: '๐ŸŽจ Style' - label: 'style' - - title: '๐Ÿ”Š Logging' - label: 'logging' - - title: '๐Ÿ”‡ Silence' - label: 'silence' - - title: '๐Ÿค– CI/CD' - label: 'ci' - -version-resolver: - major: - labels: - - "release-major" - minor: - labels: - - "release-minor" - patch: - labels: - - "release-patch" - default: patch - -autolabeler: - - label: "release-major" - title: - - "/^BREAKING CHANGE:/" - - label: "release-minor" - title: - - "/^feat:/" - - "/^feat\\(.+\\):/" diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 3208f06..74772d5 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -3,44 +3,51 @@ name: Internal - Common Continuous Integration tasks on: workflow_call: inputs: - tag: - description: "Tag Version (semver - x.x.x)" - type: string - required: false + candidate-images: + description: Build temporary candidate images for release validation + type: boolean + default: false outputs: - built-images: - value: ${{ jobs.docker-build-images.outputs.built-images }} + job-results: + description: Build and validation results for promotion + value: ${{ toJSON(jobs) }} -jobs: +permissions: + contents: read +jobs: golangci-lint: name: "Go: Lint" - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install Go - uses: actions/setup-go@v5.0.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: - go-version: '1.21' + go-version: "1.21" - name: Run linters - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 with: - version: v1.54 + version: v2.15.0 go-test: name: "Go: Test" strategy: matrix: - go-version: ['1.21'] - platform: [self-hosted] + go-version: ["1.21"] + platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install Go if: success() - uses: actions/setup-go@v5.0.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version: ${{ matrix.go-version }} - name: Run tests @@ -48,77 +55,94 @@ jobs: go-coverage: name: "Go: Coverage" - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Install Go if: success() - uses: actions/setup-go@v5.0.0 + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: - go-version: '1.21' + go-version: "1.21" - name: Calc coverage run: | go test ./... -v -covermode=count -coverprofile=coverage.out - name: Convert coverage.out to coverage.lcov - uses: jandelgado/gcov2lcov-action@v1.0.9 + uses: jandelgado/gcov2lcov-action@e4612787670fc5b5f49026b8c29c5569921de1db # v1.2.0 with: version: v1.0.6 - name: Coveralls - uses: coverallsapp/github-action@v2.2.3 + uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 with: github-token: ${{ secrets.github_token }} file: coverage.lcov allow-empty: true chart-testing: - name: "Helm: Chart Testing" - runs-on: self-hosted + name: Test chart with the built image + needs: docker-build-images + runs-on: ubuntu-latest + permissions: + contents: read + packages: read steps: - - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - fetch-depth: 0 - - # Install tools with asdf - - name: Install tools with asdf - uses: asdf-vm/actions/install@v3 + persist-credentials: false - - uses: actions/setup-python@v5 + - id: prepare-chart + uses: hoverkraft-tech/ci-github-container/actions/helm/prepare-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 with: - python-version: '3.9' - check-latest: true + path: helm/chart - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.6.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) - if [[ -n "$changed" ]]; then - echo "changed=true" >> "$GITHUB_OUTPUT" - fi + - uses: hoverkraft-tech/ci-github-container/actions/helm/lint-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + with: + archive: ${{ steps.prepare-chart.outputs.archive }} + checksum: ${{ steps.prepare-chart.outputs.checksum }} + config: ct.yaml - - name: Run chart-testing (lint) - if: steps.list-changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} + - id: image + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + BUILT_IMAGES: ${{ needs.docker-build-images.outputs.built-images }} + with: + script: | + const { images, digest } = JSON.parse(process.env.BUILT_IMAGES).app; + const reference = images[0].split('@')[0]; + const separator = reference.lastIndexOf(':'); + if (separator <= reference.lastIndexOf('/') || !/^sha256:[a-f0-9]{64}$/.test(digest)) { + throw new Error('Expected a tagged image with an immutable digest'); + } + core.setOutput('repository', reference.slice(0, separator)); + core.setOutput('tag', `${reference.slice(separator + 1)}@${digest}`); - - name: Create kind cluster - if: steps.list-changed.outputs.changed == 'true' - uses: helm/kind-action@v1.9.0 + - uses: hoverkraft-tech/ci-github-container/actions/helm/test-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + with: + archive: ${{ steps.prepare-chart.outputs.archive }} + checksum: ${{ steps.prepare-chart.outputs.checksum }} + config: ct.yaml + helm-set: | + image.repository=${{ steps.image.outputs.repository }} + image.tag=${{ steps.image.outputs.tag }} + imagePullSecrets[0].name=regcred - - name: Run chart-testing (install) - if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} + - name: Clean prepared chart archive + if: always() && steps.prepare-chart.outputs.archive != '' + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + CHART_ARCHIVE: ${{ steps.prepare-chart.outputs.archive }} + with: + script: await io.rmRF(process.env.CHART_ARCHIVE); docker-build-images: name: "Docker: Build Images" - needs: [golangci-lint, go-test, go-coverage, chart-testing] - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@0.15.1 + needs: [golangci-lint, go-test, go-coverage] + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 permissions: - actions: write + attestations: write + actions: read contents: read id-token: write issues: read @@ -127,15 +151,40 @@ jobs: secrets: oci-registry-password: ${{ secrets.GITHUB_TOKEN }} with: - runs-on: '["self-hosted"]' - oci-registry: "ghcr.io" + candidate: ${{ inputs.candidate-images }} images: | [{ "name": "app", - "tag": "${{ inputs.tag }}", "dockerfile": "./Dockerfile", "platforms": [ "linux/amd64", "linux/arm64" ] }] + test-image: + name: Test container authentication + needs: docker-build-images + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + outputs: + validated-images: ${{ needs.docker-build-images.outputs.built-images }} + steps: + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Check allowed and rejected requests against the built digest + env: + IMAGE: ${{ fromJSON(needs.docker-build-images.outputs.built-images).app.images[0] }} + run: | + container=$(docker run -d --rm -p 127.0.0.1::8080 -e HEADER=X-Test-Token -e VALUE=ci-test-value "$IMAGE") + trap 'docker rm -f "$container" >/dev/null' EXIT + port=$(docker port "$container" 8080/tcp | cut -d: -f2) + url="http://127.0.0.1:$port" + curl --fail --retry 15 --retry-connrefused --retry-delay 1 "$url/health" + test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: ci-test-value' "$url/check")" = 200 + test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: wrong-value' "$url/check")" = 403 diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index b9af944..bbfe4d4 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -8,16 +8,19 @@ on: permissions: contents: read -jobs: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: ci: name: Continuous Integration - uses: ./.github/workflows/__shared-ci.yml + uses: $/.github/workflows/__shared-ci.yml permissions: - actions: write + attestations: write + actions: read contents: read id-token: write issues: read packages: write pull-requests: read - secrets: inherit diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..dc6b429 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,18 @@ +name: Prepare release + +on: + pull_request: + types: [opened, reopened, synchronize, edited] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + release: + uses: hoverkraft-tech/ci-github-publish/.github/workflows/prepare-release.yml@80fa7011b27f49f2e04a19f932d36047d17a28f2 # 3.0.7 + permissions: + contents: read + pull-requests: write diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml index bf5ee4a..4f49db2 100644 --- a/.github/workflows/pull-request-ci.yml +++ b/.github/workflows/pull-request-ci.yml @@ -5,29 +5,22 @@ on: branches: - main -jobs: +permissions: + contents: read - pull-request-labeler: - name: Pull request labeler - runs-on: self-hosted - permissions: - contents: write - pull-requests: write - steps: - - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - disable-releaser: true +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: ci: name: Continuous Integration - uses: ./.github/workflows/__shared-ci.yml + uses: $/.github/workflows/__shared-ci.yml permissions: - actions: write + attestations: write + actions: read contents: read id-token: write issues: read packages: write pull-requests: read - secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9717db2..c9c2c3b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,104 +1,137 @@ -name: ๐Ÿš€ Release +# Prepare committed chart versions, validate the dispatched tag, then publish. +name: Release on: + # checkov:skip=CKV_GHA_7:Force overrides only the no-change plan, never validation or publication checks. workflow_dispatch: + inputs: + force: + description: Release even without changes + type: boolean + default: false + schedule: + - cron: "25 8 * * 1" + +permissions: {} + +concurrency: + group: release-${{ github.repository }} + cancel-in-progress: false jobs: - check-branches: - name: Check branches - runs-on: self-hosted - steps: - - name: Check branch - run: | - if [[ "${{ github.ref_name }}" != "${{ github.event.repository.default_branch }}" ]]; then - echo "This action can only be run on the ${{ github.event.repository.default_branch }} branch" - exit 1 - fi + prepare: + uses: hoverkraft-tech/ci-github-container/.github/workflows/prepare-chart-release.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + permissions: + actions: write + contents: write + pull-requests: read + with: + path: helm/chart + update-app-version: true + force: ${{ github.event_name == 'workflow_dispatch' && inputs.force }} + github-app-client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }} + secrets: + github-app-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} - ci: - needs: check-branches - name: Continuous Integration - uses: ./.github/workflows/__shared-ci.yml + validate: + needs: prepare + if: needs.prepare.outputs.status == 'ready' + uses: $/.github/workflows/__shared-ci.yml permissions: + actions: read + attestations: write contents: read id-token: write issues: read packages: write pull-requests: read + with: + candidate-images: true - update_release_draft: - name: Draft a new release - # we want to publish a new tag only if ci succeeds - needs: ci + promote: + needs: validate + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-promote-images.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 permissions: - contents: write - pull-requests: write - runs-on: self-hosted - steps: - - id: update_release_draft - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - publish: true - disable-autolabeler: true + actions: read + attestations: read + contents: read + deployments: write + packages: write + pull-requests: read + with: + job-results: ${{ needs.validate.outputs.job-results }} + secrets: + oci-registry-password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/login-action@v3 + mirror: + name: Mirror validated image to Docker Hub + needs: [prepare, promote] + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + steps: + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: - registry: "ghcr.io" - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - uses: docker/login-action@v3 + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: - registry: "docker.io" - username: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + username: ${{ vars.DOCKERHUB_REGISTRY_USERNAME }} password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 + - name: Copy the validated multi-platform manifest + env: + IMAGE: ${{ fromJSON(needs.promote.outputs.built-images).app.images[0] }} + RELEASE_TAG: ${{ needs.prepare.outputs.tag }} + run: docker buildx imagetools create --tag "docker.io/webofmars/http-header-authenticator:$RELEASE_TAG" "$IMAGE" - - name: Push built images to Docker.io - run: | - APP_IMAGE="${{ fromJson(needs.ci.outputs.built-images).app.images[0] }}" - docker pull "$APP_IMAGE" - APP_TAG="${{ steps.update_release_draft.outputs.tag_name }}" - APP_REGISTRY_PATH="docker.io/webofmars" - APP_DOCKERIO_IMAGE="${APP_REGISTRY_PATH}/http-header-authenticator:$APP_TAG" - docker tag "$APP_IMAGE" "$APP_DOCKERIO_IMAGE" - docker push "$APP_DOCKERIO_IMAGE" - - helm-push: - name: "Helm: push chart to harbor registry" - needs: ci + release-chart: + needs: [prepare, mirror] runs-on: self-hosted + permissions: + contents: read + packages: write + id-token: write steps: - # Get a local copy of the code - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - # install tools with asdf - - name: ๐Ÿ“ฆ Install tools with asdf - uses: asdf-vm/actions/install@v3 + - name: Prepare release chart archive + id: prepare-chart + uses: hoverkraft-tech/ci-github-container/actions/helm/prepare-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + with: + path: helm/chart + + - name: Publish prepared chart archive + uses: hoverkraft-tech/ci-github-container/actions/helm/release-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + with: + archive: ${{ steps.prepare-chart.outputs.archive }} + checksum: ${{ steps.prepare-chart.outputs.checksum }} + oci-registry: harbor.hoverkraft.cloud + oci-repository: public/charts + oci-registry-username: ${{ secrets.HARBOR_REGISTRY_USER }} + oci-registry-password: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} - # login to harbor repo - - name: ๐Ÿ”’ Login to harbor repo - run: | - echo "+ login to harbor OCI registry" - helm registry login ${HARBOR_REGISTRY} -u "${HARBOR_REGISTRY_USER}" -p "${HARBOR_REGISTRY_PASSWORD}" + - name: Clean prepared chart archive + if: always() && steps.prepare-chart.outputs.archive != '' + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - HARBOR_REGISTRY_USER: ${{ secrets.HARBOR_REGISTRY_USER }} - HARBOR_REGISTRY_PASSWORD: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} - HARBOR_REGISTRY: harbor.hoverkraft.cloud + CHART_ARCHIVE: ${{ steps.prepare-chart.outputs.archive }} + with: + script: await io.rmRF(process.env.CHART_ARCHIVE); - # Push the chart - - name: โš“ Push Helm Chart to Harbor registry - uses: hoverkraft-tech/helm-push@v5.0.0 + release: + needs: [prepare, release-chart] + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - uses: hoverkraft-tech/ci-github-publish/actions/release/create@80fa7011b27f49f2e04a19f932d36047d17a28f2 # 3.0.7 with: - useOCIRegistry: true - username: ${{ secrets.HARBOR_REGISTRY_USER }} - # NOTE: access-token is the password for OCI registry - # cf https://github.com/bsord/helm-push/blob/5ec3320fb5720a0a5aa210d871999f2b836f2d97/entrypoint.sh#L37 - access-token: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} - registry-url: oci://harbor.hoverkraft.cloud/public/charts - chart-folder: helm/chart - force: true - update-dependencies: true - version: ${{ github.event.inputs.tagVersion }} - appVersion: ${{ github.event.inputs.tagVersion }} + tag: ${{ needs.prepare.outputs.tag }} + target-ref: ${{ github.sha }} + changelog-summary: ${{ format('{{"llmAuth":{0},"llmProvider":"openai"}}', toJSON(secrets.OPENAI_API_KEY)) }} diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml new file mode 100644 index 0000000..c0d287c --- /dev/null +++ b/.github/workflows/semantic-pull-request.yml @@ -0,0 +1,13 @@ +name: Pull Request - Semantic Lint + +on: + pull_request: + types: [opened, reopened, edited, synchronize] + +permissions: {} + +jobs: + title: + uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 + permissions: + contents: read diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 1ccd41c..8eaf366 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -4,12 +4,18 @@ on: schedule: - cron: "30 1 * * *" +permissions: + contents: read + jobs: stale: - runs-on: self-hosted + permissions: + issues: write + pull-requests: write + runs-on: ubuntu-latest steps: - - uses: actions/stale@v9.0.0 + - uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: "This issue is stale" diff --git a/.golangci.yml b/.golangci.yml index 26c0ac6..4a71933 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,76 +1,30 @@ -# This file contains all available configuration options -# with their default values. - -# options for analysis running +version: "2" run: - # default concurrency is a available CPU number - # concurrency: 4 - - # timeout for analysis, e.g. 30s, 5m, default is 1m timeout: 5m - - # exit code when at least one issue was found, default is 1 issues-exit-code: 1 - - # include test files or not, default is true tests: true - - # list of build tags, all linters use it. Default is empty list. - # build-tags: - # - mytag - - # which dirs to skip: issues from them won't be reported; - # can use regexp here: generated.*, regexp is applied on full path; - # default value is empty list, but default dirs are skipped independently - # from this option's value (see skip-dirs-use-default). - # "/" will be replaced by current OS file path separator to properly work - # on Windows. - # skip-dirs: - # - src/external_libs - # - autogenerated_by_my_lib - - # default is true. Enables skipping of directories: - # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ - skip-dirs-use-default: true - - # which files to skip: they will be analyzed, but issues from them - # won't be reported. Default value is empty list, but there is - # no need to include all autogenerated files, we confidently recognize - # autogenerated files. If it's not please let us know. - # "/" will be replaced by current OS file path separator to properly work - # on Windows. - # skip-files: - # - ".*\\.my\\.go$" - # - lib/bad.go - - # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": - # If invoked with -mod=readonly, the go command is disallowed from the implicit - # automatic updating of go.mod described above. Instead, it fails when any changes - # to go.mod are needed. This setting is most useful to check that go.mod does - # not need updates, such as in a continuous integration and testing system. - # If invoked with -mod=vendor, the go command assumes that the vendor - # directory holds the correct copies of dependencies and ignores - # the dependency descriptions in go.mod. - # modules-download-mode: readonly|release|vendor - - # Allow multiple parallel golangci-lint instances running. - # If false (default) - golangci-lint acquires file lock on start. - # allow-parallel-runners: false - - -# output configuration options output: - # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: code-climate - - # print lines of code with issue, default is true - print-issued-lines: true - - # print linter name in the end of issue text, default is true - print-linter-name: true - - # make issues output unique by line, default is true - uniq-by-line: true - + formats: + code-climate: + path: stdout +linters: + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ issues: - exclude: [] + uniq-by-line: true +formatters: + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ From 503daac1357d221850643053787315056f0d5c39 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 24 Nov 2026 11:29:59 +0100 Subject: [PATCH 02/35] ci: adopt shared Go actions and fix audited dependencies --- .github/workflows/__shared-ci.yml | 74 ++++-------- .gitignore | 3 + Dockerfile | 6 +- Makefile | 6 +- README.md | 2 + docs/development.md | 20 ++++ go.mod | 48 ++++---- go.sum | 109 ++++++++++-------- .../http-header-authenticator/main.go | 43 ++++--- .../http-header-authenticator/main_test.go | 39 +++++++ 10 files changed, 199 insertions(+), 151 deletions(-) create mode 100644 docs/development.md create mode 100644 src/github.com/hoverkraft-tech/http-header-authenticator/main_test.go diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 74772d5..f510430 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -16,69 +16,35 @@ permissions: contents: read jobs: - golangci-lint: - name: "Go: Lint" + go: + name: Go checks and coverage runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - name: Install Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: "1.21" - - name: Run linters - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - with: - version: v2.15.0 - - go-test: - name: "Go: Test" - strategy: - matrix: - go-version: ["1.21"] - platform: [ubuntu-latest] - runs-on: ${{ matrix.platform }} - steps: - - name: Checkout code - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Install Go - if: success() - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: ${{ matrix.go-version }} - - name: Run tests - run: go test ./... -v -covermode=count - go-coverage: - name: "Go: Coverage" - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Install Go - if: success() - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: "1.21" - - name: Calc coverage - run: | - go test ./... -v -covermode=count -coverprofile=coverage.out - - name: Convert coverage.out to coverage.lcov - uses: jandelgado/gcov2lcov-action@e4612787670fc5b5f49026b8c29c5569921de1db # v1.2.0 - with: - version: v1.0.6 + # Track main while validating the new shared Go actions in consumers. + - name: Setup Go + uses: hoverkraft-tech/ci-github-go/actions/setup-go@main + + - name: Lint + uses: hoverkraft-tech/ci-github-go/actions/lint@main + + - name: Test with race detection and coverage + id: tests + uses: hoverkraft-tech/ci-github-go/actions/test@main + - name: Coveralls + if: ${{ !cancelled() && steps.tests.outcome != 'skipped' }} uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 with: - github-token: ${{ secrets.github_token }} - file: coverage.lcov - allow-empty: true + file: coverage.out + format: golang + + - name: Audit dependencies + uses: hoverkraft-tech/ci-github-go/actions/audit@main chart-testing: name: Test chart with the built image @@ -138,7 +104,7 @@ jobs: docker-build-images: name: "Docker: Build Images" - needs: [golangci-lint, go-test, go-coverage] + needs: go uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 permissions: attestations: write diff --git a/.gitignore b/.gitignore index a197e1e..9548c1f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .env .cache coverage.out + +junit.xml +golangci-lint.sarif diff --git a/Dockerfile b/Dockerfile index 9355c34..57434be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ # build stage -FROM golang:alpine AS builder +FROM golang:1.27-alpine AS builder RUN apk add --no-cache git WORKDIR /go/src/app COPY go.* . COPY src/ . RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - go get -d -v ./... + go mod download && go mod verify RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - go build -o /go/bin/http-header-authenticator -v ./... + go build -mod=readonly -trimpath -o /go/bin/http-header-authenticator -v ./... # final stage FROM alpine:3.18 diff --git a/Makefile b/Makefile index ee1ccfd..f85e455 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ ci: go-tests go-cover golang-ci go-tests: src/* go.mod go.sum - go test -v ./... + go test -race -count=1 -timeout=5m ./... go-cover: src/* go.mod go.sum - go test -coverprofile=coverage.out ./... + go test -race -count=1 -timeout=5m -covermode=atomic -coverprofile=coverage.out ./... golang-ci: src/* go.mod go.sum docker run --rm -t \ -v ${PWD}:/app \ -v ${PWD}/.cache/golang-ci:/root/.cache \ - -w /app golangci/golangci-lint:v1.54.2 golangci-lint run + -w /app golangci/golangci-lint:v2.15.0 golangci-lint run diff --git a/README.md b/README.md index 47a2b01..21d4bae 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,5 @@ docker-compose up -d --build ```shell go build -o ./bin/http-header-authenticator ./src/github.com/hoverkraft-tech/http-header-authenticator ``` + +See the [development guide](docs/development.md) for local checks. diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 0000000..85a9dbd --- /dev/null +++ b/docs/development.md @@ -0,0 +1,20 @@ +# Development + +Use the Go toolchain selected by `go.mod` and golangci-lint v2.15.0. + +```sh +go mod download +go mod verify +go mod tidy -diff +golangci-lint run +go test -race -count=1 -timeout=5m -covermode=atomic -coverprofile=coverage.out ./... +go run golang.org/x/vuln/cmd/govulncheck@v1.10.0 ./... +``` + +CI uses the setup, lint, test and audit actions from `ci-github-go` at `main` +while they are being validated in consumer repositories. The test action +produces JUnit and coverage reports. The same coverage profile is sent to +Coveralls without rerunning tests or converting formats. + +Image builds wait for these checks. The existing container authentication and +Helm checks validate the built image before it can be promoted for release. diff --git a/go.mod b/go.mod index a90c0ff..451498b 100644 --- a/go.mod +++ b/go.mod @@ -1,42 +1,48 @@ module github.com/hoverkraft-tech/http-header-authenticator -go 1.21 +go 1.26.0 + +toolchain go1.27.4 require ( - github.com/gin-contrib/logger v0.2.6 github.com/gin-contrib/requestid v0.0.6 - github.com/gin-gonic/gin v1.9.1 + github.com/gin-gonic/gin v1.12.0 github.com/rs/zerolog v1.31.0 github.com/spf13/cobra v1.7.0 ) require ( - github.com/bytedance/sonic v1.9.2 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect + github.com/bytedance/gopkg v0.1.3 // indirect + github.com/bytedance/sonic v1.15.0 // indirect + github.com/bytedance/sonic/loader v0.5.0 // indirect + github.com/cloudwego/base64x v0.1.6 // indirect + github.com/gabriel-vasile/mimetype v1.4.12 // indirect + github.com/gin-contrib/sse v1.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/go-playground/validator/v10 v10.30.1 // indirect + github.com/goccy/go-json v0.10.5 // indirect + github.com/goccy/go-yaml v1.19.2 // indirect github.com/google/uuid v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/klauspost/cpuid/v2 v2.3.0 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/quic-go/qpack v0.6.0 // indirect + github.com/quic-go/quic-go v0.59.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect - golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.11.0 // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/text v0.11.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect + github.com/ugorji/go/codec v1.3.1 // indirect + go.mongodb.org/mongo-driver/v2 v2.5.0 // indirect + golang.org/x/arch v0.22.0 // indirect + golang.org/x/crypto v0.59.0 // indirect + golang.org/x/net v0.63.0 // indirect + golang.org/x/sys v0.50.0 // indirect + golang.org/x/text v0.44.0 // indirect + google.golang.org/protobuf v1.36.10 // indirect ) diff --git a/go.sum b/go.sum index 042f944..275678c 100644 --- a/go.sum +++ b/go.sum @@ -1,28 +1,30 @@ -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.9.2 h1:GDaNjuWSGu09guE9Oql0MSTNhNCLlWwO8y/xM5BzcbM= -github.com/bytedance/sonic v1.9.2/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M= +github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM= +github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE= +github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k= +github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE= +github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= +github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M= +github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/gin-contrib/logger v0.2.6 h1:u+tvbiQhGEyuJgZSHNja3WD800ILduVyk5xKop160dw= -github.com/gin-contrib/logger v0.2.6/go.mod h1:ZDkY/xiMqbZdz83enCHjMqxJUFRzB8bq0kjyMmjr3qU= +github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw= +github.com/gabriel-vasile/mimetype v1.4.12/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= github.com/gin-contrib/requestid v0.0.6 h1:mGcxTnHQ45F6QU5HQRgQUDsAfHprD3P7g2uZ4cSZo9o= github.com/gin-contrib/requestid v0.0.6/go.mod h1:9i4vKATX/CdggbkY252dPVasgVucy/ggBeELXuQztm4= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w= +github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/gin-gonic/gin v1.12.0 h1:b3YAbrZtnf8N//yjKeU2+MQsh2mY5htkZidOM7O0wG8= +github.com/gin-gonic/gin v1.12.0/go.mod h1:VxccKfsSllpKshkBWgVgRniFFAzFb9csfngsqANjnLc= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -30,15 +32,18 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.30.1 h1:f3zDSN/zOma+w6+1Wswgd9fLkdwy06ntQJp0BBvFG0w= +github.com/go-playground/validator/v10 v10.30.1/go.mod h1:oSuBIQzuJxL//3MelwSLD5hc2Tu889bF0Idm9Dg26cM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= +github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -46,40 +51,41 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= +github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8= +github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII= +github.com/quic-go/quic-go v0.59.1 h1:0Gmua0HW1Tv7ANR7hUYwRyD0MG5OJfgvYSZasGZzBic= +github.com/quic-go/quic-go v0.59.1/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= @@ -92,54 +98,56 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY= +github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4= +go.mongodb.org/mongo-driver/v2 v2.5.0 h1:yXUhImUjjAInNcpTcAlPHiT7bIXhshCTL3jVBkF3xaE= +go.mongodb.org/mongo-driver/v2 v2.5.0/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI= +golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c= +golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0= +golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -147,4 +155,3 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/src/github.com/hoverkraft-tech/http-header-authenticator/main.go b/src/github.com/hoverkraft-tech/http-header-authenticator/main.go index 19b06f9..c25a271 100644 --- a/src/github.com/hoverkraft-tech/http-header-authenticator/main.go +++ b/src/github.com/hoverkraft-tech/http-header-authenticator/main.go @@ -31,25 +31,7 @@ func main() { l := zerolog.New(os.Stdout).With().Timestamp().Logger() l.Info().Msg(fmt.Sprintf("Expected header is '%s' and expected value is '%s'", headerName, expectedValue)) - r := gin.New() - r.Use(gin.Recovery()) - r.Use(requestid.New()) - r.Use(CustomLoggerMiddleware(l)) - - // Health check endpoint - r.GET("/health", func(c *gin.Context) { - c.String(http.StatusOK, "OK") - }) - - // Check the presence of the header in all requests - r.NoRoute(func(c *gin.Context) { - value := c.GetHeader(headerName) - if value == expectedValue { - c.JSON(http.StatusOK, "HTTP header is present with the expected value.") - } else { - c.JSON(http.StatusForbidden, "HTTP header is not present with the expected value.") - } - }) + r := newRouter(headerName, expectedValue, l) fmt.Printf("Server is starting on port 8080...\n") if err := r.Run(":8080"); err != nil { @@ -83,3 +65,26 @@ func CustomLoggerMiddleware(logger zerolog.Logger) gin.HandlerFunc { } } } + +func newRouter(headerName, expectedValue string, logger zerolog.Logger) *gin.Engine { + r := gin.New() + r.Use(gin.Recovery()) + r.Use(requestid.New()) + r.Use(CustomLoggerMiddleware(logger)) + + // Health check endpoint + r.GET("/health", func(c *gin.Context) { + c.String(http.StatusOK, "OK") + }) + + // Check the presence of the header in all requests + r.NoRoute(func(c *gin.Context) { + value := c.GetHeader(headerName) + if value == expectedValue { + c.JSON(http.StatusOK, "HTTP header is present with the expected value.") + } else { + c.JSON(http.StatusForbidden, "HTTP header is not present with the expected value.") + } + }) + return r +} diff --git a/src/github.com/hoverkraft-tech/http-header-authenticator/main_test.go b/src/github.com/hoverkraft-tech/http-header-authenticator/main_test.go new file mode 100644 index 0000000..8a59ac7 --- /dev/null +++ b/src/github.com/hoverkraft-tech/http-header-authenticator/main_test.go @@ -0,0 +1,39 @@ +package main + +import ( + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/rs/zerolog" +) + +func TestAuthentication(t *testing.T) { + gin.SetMode(gin.TestMode) + router := newRouter("X-Test-Token", "expected", zerolog.New(io.Discard)) + for _, test := range []struct { + name string + path string + value string + want int + }{ + {"matching header", "/check", "expected", http.StatusOK}, + {"wrong header", "/check", "wrong", http.StatusForbidden}, + {"missing header", "/check", "", http.StatusForbidden}, + {"health without authentication", "/health", "", http.StatusOK}, + } { + t.Run(test.name, func(t *testing.T) { + request := httptest.NewRequest(http.MethodGet, test.path, nil) + if test.value != "" { + request.Header.Set("X-Test-Token", test.value) + } + response := httptest.NewRecorder() + router.ServeHTTP(response, request) + if response.Code != test.want { + t.Fatalf("status = %d, want %d; body: %s", response.Code, test.want, response.Body.String()) + } + }) + } +} From 80a6c05f79001dc9f48749f81b36f70fc23dd779 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 24 Nov 2026 12:14:44 +0100 Subject: [PATCH 03/35] ci: adopt Hoverkraft CI and DevX conventions --- .commitlintrc.json | 6 +- .devcontainer/devcontainer-lock.json | 24 +++++++ .devcontainer/devcontainer.json | 33 +++++++++ .dockerignore | 3 + .editorconfig | 18 +++++ .github/ISSUE_TEMPLATE/bug_report.md | 6 +- .github/ISSUE_TEMPLATE/feature_request.md | 3 +- .github/dependabot.yml | 74 +++++++++++-------- .github/linters/.checkov.yaml | 4 ++ .github/linters/.yaml-lint.yml | 14 ++++ .github/linters/Dockerfile | 28 ++++++++ .github/linters/trivy-data/registries.yaml | 6 ++ .github/linters/trivy-exceptions.yaml | 8 +++ .github/linters/trivy.yaml | 17 +++++ .github/linters/zizmor.yaml | 6 ++ .github/pull_request_template.md | 9 +++ .github/workflows/__shared-ci.yml | 72 +++++++++++++++++-- .github/workflows/main-ci.yml | 10 ++- .github/workflows/prepare-release.yml | 1 + .github/workflows/pull-request-ci.yml | 8 ++- .github/workflows/release.yml | 7 +- .github/workflows/semantic-pull-request.yml | 3 +- .github/workflows/stale.yml | 1 + .gitignore | 7 ++ .golangci.yml | 1 + .prettierignore | 2 + AGENTS.md | 8 +++ CONTRIBUTING.md | 5 ++ Dockerfile | 22 +++--- Makefile | 50 ++++++++++--- README.md | 35 +++++---- biome.json | 15 ++++ ct.yaml | 1 + docker-compose.debug.yml | 13 +++- docker-compose.yml | 14 ++-- docs/README.md | 4 ++ docs/development.md | 20 ------ docs/development/README.md | 70 ++++++++++++++++++ entrypoint.sh | 18 ++--- helm/chart-schema.yaml | 1 + helm/chart/Chart.yaml | 1 + helm/chart/ci/default-values.yaml | 4 ++ helm/chart/templates/deployment.yaml | 6 ++ helm/chart/templates/hpa.yaml | 3 + helm/chart/templates/ingress.yaml | 4 +- helm/chart/templates/networkpolicy.yaml | 21 ++++++ helm/chart/templates/secrets.yaml | 5 +- helm/chart/templates/service.yaml | 3 + helm/chart/templates/serviceaccount.yaml | 4 +- helm/chart/values.yaml | 79 +++++++-------------- helm/lintconf.yaml | 7 +- skaffold.yaml | 1 + 52 files changed, 609 insertions(+), 176 deletions(-) create mode 100644 .devcontainer/devcontainer-lock.json create mode 100644 .devcontainer/devcontainer.json create mode 100644 .editorconfig create mode 100644 .github/linters/.checkov.yaml create mode 100644 .github/linters/.yaml-lint.yml create mode 100644 .github/linters/Dockerfile create mode 100644 .github/linters/trivy-data/registries.yaml create mode 100644 .github/linters/trivy-exceptions.yaml create mode 100644 .github/linters/trivy.yaml create mode 100644 .github/linters/zizmor.yaml create mode 100644 .github/pull_request_template.md create mode 100644 .prettierignore create mode 100644 AGENTS.md create mode 100644 CONTRIBUTING.md create mode 100644 biome.json create mode 100644 docs/README.md delete mode 100644 docs/development.md create mode 100644 docs/development/README.md mode change 100644 => 100755 entrypoint.sh create mode 100644 helm/chart/ci/default-values.yaml create mode 100644 helm/chart/templates/networkpolicy.yaml diff --git a/.commitlintrc.json b/.commitlintrc.json index 582921f..7e3f1cf 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -1,7 +1,11 @@ { "extends": ["@commitlint/config-conventional"], "rules": { - "subject-case": [1, "never", ["sentence-case", "start-case", "pascal-case", "upper-case"]], + "subject-case": [ + 1, + "never", + ["sentence-case", "start-case", "pascal-case", "upper-case"] + ], "header-max-length": [1, "always", 100], "body-max-line-length": [1, "always", 100], "footer-max-line-length": [1, "always", 100] diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 0000000..facd626 --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,24 @@ +{ + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "version": "2.7.2", + "resolved": "ghcr.io/devcontainers/features/common-utils@sha256:08e5a6ad4b672301c2010944217aeea4f428a87f4349d9bbf8bc97211238674b", + "integrity": "sha256:08e5a6ad4b672301c2010944217aeea4f428a87f4349d9bbf8bc97211238674b" + }, + "ghcr.io/devcontainers/features/docker-in-docker:4": { + "version": "4.1.3", + "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:fae40f3c8be5a7c3b0db344c1d30341bc2c91ba38d1d5b14cd2ad72e6d65d084", + "integrity": "sha256:fae40f3c8be5a7c3b0db344c1d30341bc2c91ba38d1d5b14cd2ad72e6d65d084" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "1.1.3", + "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2", + "integrity": "sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.4.1", + "resolved": "ghcr.io/devcontainers/features/go@sha256:2f2ed290df9a5f1841340b14cb8a287cf0574a816967dd84dcfe42fdd97b897e", + "integrity": "sha256:2f2ed290df9a5f1841340b14cb8a287cf0574a816967dd84dcfe42fdd97b897e" + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..b5a2bcd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,33 @@ +{ + "name": "hoverkraft-tech/http-header-authenticator", + "image": "mcr.microsoft.com/devcontainers/base:debian@sha256:41ff7ce12ec45f2704f27a6e091831186ad922ec8112e6339425bfefdf5a70f9", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "configureZshAsDefaultShell": true + }, + "ghcr.io/devcontainers/features/docker-in-docker:4": { + "moby": false + }, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.27.4", + "golangciLintVersion": "2.15.0" + } + }, + "remoteUser": "vscode", + "init": true, + "postCreateCommand": "make setup", + "waitFor": "postCreateCommand", + "customizations": { + "vscode": { + "extensions": [ + "eamodio.gitlens", + "github.vscode-github-actions", + "ms-vscode.makefile-tools", + "redhat.vscode-yaml", + "golang.Go" + ], + "settings": {} + } + } +} diff --git a/.dockerignore b/.dockerignore index c5ca512..8c6d8bb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -36,3 +36,6 @@ helm coverage.out Makefile skaffold.yaml +/.devcontainer +/super-linter-output +/super-linter.log diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..db7df72 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.py] +indent_size = 4 + +[*.go] +indent_style = tab + +[Makefile] +indent_style = tab diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1515c59..103452c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,9 +1,10 @@ --- name: Bug report about: Create a report to help us improve - --- +# Bug report + **Describe the bug** A clear and concise description of what the bug is. @@ -17,7 +18,8 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Kubernetes (please complete the following information):** - - Kubernetes version [`kubectl version --short`] + +- Kubernetes version [`kubectl version --short`] **HRE pod logs** `kubectl logs hre-xxxxxxx` diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 066b2d9..2a9953c 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,9 +1,10 @@ --- name: Feature request about: Suggest an idea for this project - --- +# Feature request + **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 853287f..9d0e73a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,47 +1,63 @@ -# .github/dependabot.yml +--- version: 2 updates: - - package-ecosystem: "github-actions" - cooldown: - default-days: 7 + - package-ecosystem: github-actions + directory: / commit-message: prefix: build include: scope - directory: "/" - open-pull-requests-limit: 20 - groups: - github-actions-dependencies: - patterns: - - "*" + cooldown: + default-days: 7 + open-pull-requests-limit: 10 schedule: - interval: "weekly" + interval: weekly day: friday time: "04:00" - - - package-ecosystem: "docker" + groups: + github-actions-dependencies: + patterns: ["*"] + - package-ecosystem: gomod + directory: / + commit-message: + prefix: build + include: scope cooldown: default-days: 7 - directory: "/" - open-pull-requests-limit: 20 - groups: - docker-dependencies: - patterns: - - "*" + open-pull-requests-limit: 10 schedule: - interval: "weekly" + interval: weekly day: friday time: "04:10" - - - package-ecosystem: "gomod" + groups: + gomod-dependencies: + patterns: ["*"] + - package-ecosystem: docker + directories: ["/", "/.github/linters"] + commit-message: + prefix: build + include: scope cooldown: default-days: 7 - directory: "/" - open-pull-requests-limit: 20 - groups: - go-dependencies: - patterns: - - "*" + open-pull-requests-limit: 10 schedule: - interval: "weekly" + interval: weekly day: friday time: "04:20" + groups: + docker-dependencies: + patterns: ["*"] + - package-ecosystem: devcontainers + directory: / + commit-message: + prefix: build + include: scope + cooldown: + default-days: 7 + open-pull-requests-limit: 10 + schedule: + interval: weekly + day: friday + time: "04:30" + groups: + devcontainers-dependencies: + patterns: ["*"] diff --git a/.github/linters/.checkov.yaml b/.github/linters/.checkov.yaml new file mode 100644 index 0000000..d262c25 --- /dev/null +++ b/.github/linters/.checkov.yaml @@ -0,0 +1,4 @@ +--- +quiet: true +var-file: + - helm/chart/ci/default-values.yaml diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml new file mode 100644 index 0000000..07b34f1 --- /dev/null +++ b/.github/linters/.yaml-lint.yml @@ -0,0 +1,14 @@ +--- +extends: default +rules: + line-length: + max: 160 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + truthy: + check-keys: false + comments: + min-spaces-from-content: 1 +# Helm templates are validated after rendering by the chart and security checks. +ignore: | + **/helm/chart/templates/** diff --git a/.github/linters/Dockerfile b/.github/linters/Dockerfile new file mode 100644 index 0000000..75f24f9 --- /dev/null +++ b/.github/linters/Dockerfile @@ -0,0 +1,28 @@ +FROM ghcr.io/hoverkraft-tech/docker-base-images/super-linter:2.0.2@sha256:12dedee667b43856a9cc792628fecc4723fc0868bf8090d268981407a7402b2c + +ARG UID=1000 +ARG GID=1000 +USER ${UID}:${GID} +HEALTHCHECK --interval=5m --timeout=10s --start-period=30s --retries=3 CMD ["/bin/sh", "-c", "test -d /github/home"] + +# Application lint uses the project-owned Go or Python tools through make lint-code. +ENV VALIDATE_JAVASCRIPT_TOOLCHAIN="" \ + VALIDATE_PYTHON_TOOLCHAIN="" \ + LOG_LEVEL=INFO \ + IGNORE_GITIGNORED_FILES=true \ + VALIDATE_BASH=true \ + VALIDATE_BASH_EXEC=true \ + VALIDATE_BIOME_FORMAT=true \ + VALIDATE_BIOME_LINT=true \ + VALIDATE_CHECKOV=true \ + VALIDATE_DOCKERFILE_HADOLINT=true \ + VALIDATE_GITHUB_ACTIONS=true \ + VALIDATE_GITHUB_ACTIONS_ZIZMOR=true \ + VALIDATE_GIT_COMMITLINT=true \ + VALIDATE_MARKDOWN=true \ + VALIDATE_MARKDOWN_PRETTIER=true \ + VALIDATE_NATURAL_LANGUAGE=true \ + VALIDATE_SHELL_SHFMT=true \ + VALIDATE_TRIVY=true \ + VALIDATE_YAML=true \ + VALIDATE_YAML_PRETTIER=true diff --git a/.github/linters/trivy-data/registries.yaml b/.github/linters/trivy-data/registries.yaml new file mode 100644 index 0000000..b12c6de --- /dev/null +++ b/.github/linters/trivy-data/registries.yaml @@ -0,0 +1,6 @@ +--- +# Project images are published to Docker Hub and GitHub Container Registry. +ksv0125: + trusted_registries: + - docker.io + - ghcr.io diff --git a/.github/linters/trivy-exceptions.yaml b/.github/linters/trivy-exceptions.yaml new file mode 100644 index 0000000..9235159 --- /dev/null +++ b/.github/linters/trivy-exceptions.yaml @@ -0,0 +1,8 @@ +--- +misconfigurations: + - id: KSV-0110 + paths: + - helm/chart/templates/deployment.yaml + statement: + The chart honors .Release.Namespace. Install with --namespace as documented; + Trivy renders with Helm defaults. diff --git a/.github/linters/trivy.yaml b/.github/linters/trivy.yaml new file mode 100644 index 0000000..f6013cb --- /dev/null +++ b/.github/linters/trivy.yaml @@ -0,0 +1,17 @@ +--- +exit-code: 1 +exit-on-eol: 2 +scan: + disable-telemetry: true + scanners: + - vuln + - misconfig + - secret +ignorefile: .github/linters/trivy-exceptions.yaml +misconfiguration: + helm: + values: + - helm/chart/ci/default-values.yaml +rego: + data: + - .github/linters/trivy-data diff --git a/.github/linters/zizmor.yaml b/.github/linters/zizmor.yaml new file mode 100644 index 0000000..9b83340 --- /dev/null +++ b/.github/linters/zizmor.yaml @@ -0,0 +1,6 @@ +--- +rules: + unpinned-uses: + config: + policies: + hoverkraft-tech/ci-github-go/*: ref-pin diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..1641c3f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ +# Pull request + +## Change + +Describe the problem and resulting behavior. + +## Validation + +List the checks run and any behavior that still needs verification. diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index f510430..18429d8 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -1,3 +1,4 @@ +--- name: Internal - Common Continuous Integration tasks on: @@ -16,7 +17,43 @@ permissions: contents: read jobs: - go: + lint: + name: Repository quality + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@33462c06bcbbd9144d7f661929e61953604b444d # 4.3.2 + permissions: + actions: read + contents: read + issues: write + packages: read + pull-requests: write + security-events: write + statuses: write + with: + comment: false + lint-all: true + javascript-linter-toolchain: "" + python-linter-toolchain: "" + linter-env: | + IGNORE_GITIGNORED_FILES=true + LOG_LEVEL=INFO + VALIDATE_BASH=true + VALIDATE_BASH_EXEC=true + VALIDATE_BIOME_FORMAT=true + VALIDATE_BIOME_LINT=true + VALIDATE_CHECKOV=true + VALIDATE_DOCKERFILE_HADOLINT=true + VALIDATE_GITHUB_ACTIONS=true + VALIDATE_GITHUB_ACTIONS_ZIZMOR=true + VALIDATE_GIT_COMMITLINT=${{ github.event_name == 'push' || github.event_name == 'pull_request' }} + VALIDATE_MARKDOWN=true + VALIDATE_MARKDOWN_PRETTIER=true + VALIDATE_NATURAL_LANGUAGE=true + VALIDATE_SHELL_SHFMT=true + VALIDATE_TRIVY=true + VALIDATE_YAML=true + VALIDATE_YAML_PRETTIER=true + + test: name: Go checks and coverage runs-on: ubuntu-latest steps: @@ -27,14 +64,14 @@ jobs: # Track main while validating the new shared Go actions in consumers. - name: Setup Go - uses: hoverkraft-tech/ci-github-go/actions/setup-go@main + uses: hoverkraft-tech/ci-github-go/actions/setup-go@main # ratchet:exclude - track shared language CI during adoption - name: Lint - uses: hoverkraft-tech/ci-github-go/actions/lint@main + uses: hoverkraft-tech/ci-github-go/actions/lint@main # ratchet:exclude - track shared language CI during adoption - name: Test with race detection and coverage id: tests - uses: hoverkraft-tech/ci-github-go/actions/test@main + uses: hoverkraft-tech/ci-github-go/actions/test@main # ratchet:exclude - track shared language CI during adoption - name: Coveralls if: ${{ !cancelled() && steps.tests.outcome != 'skipped' }} @@ -44,7 +81,7 @@ jobs: format: golang - name: Audit dependencies - uses: hoverkraft-tech/ci-github-go/actions/audit@main + uses: hoverkraft-tech/ci-github-go/actions/audit@main # ratchet:exclude - track shared language CI during adoption chart-testing: name: Test chart with the built image @@ -90,6 +127,7 @@ jobs: checksum: ${{ steps.prepare-chart.outputs.checksum }} config: ct.yaml helm-set: | + securityHeader.value=ci-test-value image.repository=${{ steps.image.outputs.repository }} image.tag=${{ steps.image.outputs.tag }} imagePullSecrets[0].name=regcred @@ -104,7 +142,7 @@ jobs: docker-build-images: name: "Docker: Build Images" - needs: go + needs: [lint, test] uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 permissions: attestations: write @@ -147,10 +185,30 @@ jobs: env: IMAGE: ${{ fromJSON(needs.docker-build-images.outputs.built-images).app.images[0] }} run: | - container=$(docker run -d --rm -p 127.0.0.1::8080 -e HEADER=X-Test-Token -e VALUE=ci-test-value "$IMAGE") + container=$(docker run -d --rm --read-only --cap-drop ALL --security-opt no-new-privileges \ + --health-interval 1s -p 127.0.0.1::8080 -e HEADER=X-Test-Token -e VALUE=ci-test-value "$IMAGE") trap 'docker rm -f "$container" >/dev/null' EXIT port=$(docker port "$container" 8080/tcp | cut -d: -f2) url="http://127.0.0.1:$port" curl --fail --retry 15 --retry-connrefused --retry-delay 1 "$url/health" test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: ci-test-value' "$url/check")" = 200 test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: wrong-value' "$url/check")" = 403 + test "$(curl -s -o /dev/null -w '%{http_code}' "$url/check")" = 403 + test "$(docker exec "$container" id -u)" = 10001 + for _ in {1..15}; do + if test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy; then + break + fi + sleep 1 + done + test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy + + reports: + if: ${{ !cancelled() }} + needs: [lint, test] + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@33462c06bcbbd9144d7f661929e61953604b444d # 4.3.2 + permissions: + contents: read + pull-requests: write + with: + job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index bbfe4d4..4005520 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -1,6 +1,10 @@ +--- name: Main - Continuous Integration on: + workflow_dispatch: + schedule: + - cron: "25 8 * * 1" push: branches: - main @@ -21,6 +25,8 @@ jobs: actions: read contents: read id-token: write - issues: read + issues: write packages: write - pull-requests: read + pull-requests: write + security-events: write + statuses: write diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index dc6b429..e161cf3 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -1,3 +1,4 @@ +--- name: Prepare release on: diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml index 4f49db2..262f950 100644 --- a/.github/workflows/pull-request-ci.yml +++ b/.github/workflows/pull-request-ci.yml @@ -1,6 +1,8 @@ +--- name: Pull request - Continuous Integration on: + merge_group: pull_request: branches: - main @@ -21,6 +23,8 @@ jobs: actions: read contents: read id-token: write - issues: read + issues: write packages: write - pull-requests: read + pull-requests: write + security-events: write + statuses: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9c2c3b..8532657 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,4 @@ +--- # Prepare committed chart versions, validate the dispatched tag, then publish. name: Release @@ -42,9 +43,11 @@ jobs: attestations: write contents: read id-token: write - issues: read + issues: write packages: write - pull-requests: read + pull-requests: write + security-events: write + statuses: write with: candidate-images: true diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index c0d287c..37df3bf 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -1,3 +1,4 @@ +--- name: Pull Request - Semantic Lint on: @@ -8,6 +9,6 @@ permissions: {} jobs: title: - uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@33462c06bcbbd9144d7f661929e61953604b444d # 4.3.2 permissions: contents: read diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8eaf366..d48558f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,3 +1,4 @@ +--- name: Mark stale issues and pull requests on: diff --git a/.gitignore b/.gitignore index 9548c1f..6baf34e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,10 @@ coverage.out junit.xml golangci-lint.sarif + +# Local developer tools and CI reports +/.cache/ +/bin/ +/super-linter-output/ +/super-linter.log +/.devcontainer/.env diff --git a/.golangci.yml b/.golangci.yml index 4a71933..120de21 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,4 @@ +--- version: "2" run: timeout: 5m diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..5241466 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +# Helm Go templates are validated by the chart checks. +/helm/chart/templates/** diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..32897a5 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,8 @@ +# Agent instructions + +Follow the [Hoverkraft organization guidance](https://github.com/hoverkraft-tech/.github/blob/main/AGENTS.md). + +Read the [development guide](docs/development/README.md) before changing code or CI. +Use the commands in `Makefile`; `make ci` validates without rewriting tracked files. +Keep the application checks and the shared repository linter passing. Fix findings +instead of adding broad exclusions. Preserve the existing deployment and release contracts. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..76dbff5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributing + +Start with the [development guide](docs/development/README.md) for the devcontainer, +local commands and CI checks. Use Conventional Commits for commits and PR titles. +Run `make ci` before requesting review and describe the behavior changed and checks run. diff --git a/Dockerfile b/Dockerfile index 57434be..2f62da9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,20 @@ -# build stage -FROM golang:1.27-alpine AS builder -RUN apk add --no-cache git +FROM golang:1.27-alpine@sha256:70bd7ddea8b6cbe5d6943cde279d6b67feb10cc924fb9100d1d8757c1575b280 AS builder WORKDIR /go/src/app COPY go.* . -COPY src/ . RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ go mod download && go mod verify +COPY src/ . RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - go build -mod=readonly -trimpath -o /go/bin/http-header-authenticator -v ./... + CGO_ENABLED=0 go build -mod=readonly -trimpath -o /go/bin/http-header-authenticator ./... -# final stage -FROM alpine:3.18 -RUN apk --no-cache add ca-certificates +FROM alpine:3.24@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf +RUN addgroup -g 10001 app && adduser -D -u 10001 -G app app +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /go/bin/http-header-authenticator /usr/local/bin/http-header-authenticator -COPY entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] -LABEL "name"="http-header-authenticator" "version"="0.1.0" +COPY --chmod=755 entrypoint.sh /entrypoint.sh +USER 10001:10001 EXPOSE 8080 ENV GIN_MODE=release +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD ["wget", "-q", "--spider", "http://127.0.0.1:8080/health"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/Makefile b/Makefile index f85e455..c422fe7 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,43 @@ -ci: go-tests go-cover golang-ci +.DEFAULT_GOAL := help +.PHONY: help setup lint lint-code lint-repository lint-fix test audit build ci -go-tests: src/* go.mod go.sum - go test -race -count=1 -timeout=5m ./... +LINTER_IMAGE := http-header-authenticator-linter:local -go-cover: src/* go.mod go.sum - go test -race -count=1 -timeout=5m -covermode=atomic -coverprofile=coverage.out ./... +help: ## Show development commands + @awk 'BEGIN {FS = ":.*## "} /^[a-zA-Z_-]+:.*## / {printf "%-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST) -golang-ci: src/* go.mod go.sum - docker run --rm -t \ - -v ${PWD}:/app \ - -v ${PWD}/.cache/golang-ci:/root/.cache \ - -w /app golangci/golangci-lint:v2.15.0 golangci-lint run +setup: ## Download and verify Go dependencies + go mod download + go mod verify + +lint-code: ## Check formatting, module tidiness and Go diagnostics + @test -z "$$(gofmt -l $$(git ls-files '*.go'))" || { gofmt -l $$(git ls-files '*.go'); exit 1; } + go mod tidy -diff + golangci-lint run --timeout=5m + +test: ## Run race tests with atomic coverage + go test -mod=readonly -race -count=1 -timeout=5m -covermode=atomic -coverprofile=coverage.out ./... + +audit: ## Audit Go dependencies and the standard library + go run golang.org/x/vuln/cmd/govulncheck@v1.10.0 ./... + +build: ## Build the application without publishing + go build -mod=readonly -trimpath -o bin/http-header-authenticator ./src/github.com/hoverkraft-tech/http-header-authenticator + +lint-fix: ## Apply Go and repository formatting fixes + go fmt ./... + golangci-lint run --fix --timeout=5m + $(call run_linter,-e FIX_YAML_PRETTIER=true -e FIX_MARKDOWN=true -e FIX_MARKDOWN_PRETTIER=true -e FIX_BIOME_FORMAT=true -e FIX_SHELL_SHFMT=true) + +lint: lint-code lint-repository ## Run application and repository checks + +lint-repository: ## Run Hoverkraft's shared repository linter + $(call run_linter,) + +ci: setup ## Run local validation without rewriting tracked files + $(MAKE) lint test audit build + +define run_linter + docker build --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag $(LINTER_IMAGE) .github/linters + docker run --rm -v "$(CURDIR):$(CURDIR)" -w "$(CURDIR)" -e DEFAULT_WORKSPACE="$(CURDIR)" $(1) $(LINTER_IMAGE) +endef diff --git a/README.md b/README.md index 21d4bae..f34cdf7 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,51 @@ # http-header-authenticator -Go micro-service used to authenticate http requests based on provided fix http headers +Go service that authenticates HTTP requests against a configured header and value. -## usage +## Usage ```sh http-header-authenticator check -H 'X-acme-auth' -V 'SomeSecurePassword' ``` ```sh -curl -H 'X-acme-auth: SomeSecurePassword' localhost:8080 # -> 200 -curl localhost:8080 # -> 404 +curl -H 'X-acme-auth: SomeSecurePassword' localhost:8080/check # -> 200 +curl localhost:8080/check # -> 403 ``` -Can be used with nginx-ingress controller to authenticate requests comming from CDN servers -See https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#global-auth-url for inspiration +Use it as an external authentication service for an ingress controller, for example +to authenticate requests coming from a CDN. `/health` reports service readiness. -## installation +## Installation -### using helm +### Helm ```sh helm upgrade http-header-authenticator oci://harbor.hoverkraft.cloud/public/charts/http-header-authenticator \ - --install --create-namespace --namespace http-header-authenticator + --install --create-namespace --namespace http-header-authenticator \ + --set-string securityHeader.name=X-Auth-Token \ + --set-string securityHeader.value="$AUTH_TOKEN" ``` -### docker +Set `AUTH_TOKEN` to your authentication secret before installing. The chart runs as +a non-root user with a read-only filesystem and resource budgets. Its NetworkPolicy +allows incoming HTTP traffic and denies outbound connections. Adjust these values +for your cluster and workload. + +### Docker - [Docker Hub](https://hub.docker.com/repository/docker/webofmars/http-header-authenticator) ```shell -docker-compose up -d --build +AUTH_TOKEN='replace-with-a-strong-secret' docker compose up -d --build ``` -### from sources +### From source ```shell go build -o ./bin/http-header-authenticator ./src/github.com/hoverkraft-tech/http-header-authenticator ``` -See the [development guide](docs/development.md) for local checks. +See the [development guide](docs/development/README.md) for local checks. + +See [Contributing](CONTRIBUTING.md) to develop or propose changes. diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..f225acd --- /dev/null +++ b/biome.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "formatter": { + "indentStyle": "space", + "indentWidth": 2 + }, + "linter": { + "enabled": true + } +} diff --git a/ct.yaml b/ct.yaml index 4d04ac8..7780537 100644 --- a/ct.yaml +++ b/ct.yaml @@ -1,3 +1,4 @@ +--- chart-dirs: - helm charts: diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml index 3c8f6b5..6d7833f 100644 --- a/docker-compose.debug.yml +++ b/docker-compose.debug.yml @@ -1,5 +1,4 @@ -version: '3.4' - +--- services: http-header-authenticator: image: http-header-authenticator @@ -7,4 +6,12 @@ services: context: . dockerfile: ./Dockerfile ports: - - 8080:8080 + - 127.0.0.1:8080:8080 + read_only: true + cap_drop: + - ALL + security_opt: + - no-new-privileges:true + environment: + HEADER: X-test-secret + VALUE: ${AUTH_TOKEN:?Set AUTH_TOKEN to a strong secret} diff --git a/docker-compose.yml b/docker-compose.yml index 86aaa2a..62be3e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,4 @@ -version: '3.4' - +--- services: http-header-authenticator: image: http-header-authenticator @@ -7,7 +6,12 @@ services: context: . dockerfile: ./Dockerfile environment: - HEADER: 'X-test-secret' - VALUE: 'changeme' + HEADER: X-test-secret + VALUE: ${AUTH_TOKEN:?Set AUTH_TOKEN to a strong secret} ports: - - 8080:8080 + - 127.0.0.1:8080:8080 + read_only: true + cap_drop: + - ALL + security_opt: + - no-new-privileges:true diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..565dd63 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,4 @@ +# Documentation + +- [Development](development/README.md): devcontainer, local checks and CI. +- [Project usage](../README.md): application purpose, prerequisites and everyday commands. diff --git a/docs/development.md b/docs/development.md deleted file mode 100644 index 85a9dbd..0000000 --- a/docs/development.md +++ /dev/null @@ -1,20 +0,0 @@ -# Development - -Use the Go toolchain selected by `go.mod` and golangci-lint v2.15.0. - -```sh -go mod download -go mod verify -go mod tidy -diff -golangci-lint run -go test -race -count=1 -timeout=5m -covermode=atomic -coverprofile=coverage.out ./... -go run golang.org/x/vuln/cmd/govulncheck@v1.10.0 ./... -``` - -CI uses the setup, lint, test and audit actions from `ci-github-go` at `main` -while they are being validated in consumer repositories. The test action -produces JUnit and coverage reports. The same coverage profile is sent to -Coveralls without rerunning tests or converting formats. - -Image builds wait for these checks. The existing container authentication and -Helm checks validate the built image before it can be promoted for release. diff --git a/docs/development/README.md b/docs/development/README.md new file mode 100644 index 0000000..5d1b3d8 --- /dev/null +++ b/docs/development/README.md @@ -0,0 +1,70 @@ +# Development + +## Environment + +Open this repository in Visual Studio Code and select "Reopen in Container". The devcontainer +installs Go tooling, Docker and the GitHub CLI, then runs `make setup`. +The committed feature lockfile makes the feature resolution reproducible. +Runtime and tool versions live in [devcontainer.json](../../.devcontainer/devcontainer.json). + +For a host setup, install Docker and the same language tools, then run `make setup`. +Use the supported Go toolchain and golangci-lint declared in the devcontainer. `go.mod` declares the minimum language version. + +## Commands + +| Command | Purpose | +| --------------- | ------------------------------------------------- | +| `make setup` | Install or verify dependencies | +| `make lint` | Check application code and repository files | +| `make lint-fix` | Apply supported formatting fixes | +| `make test` | Run tests and collect coverage | +| `make audit` | Check production dependencies for vulnerabilities | +| `make build` | Build locally without publishing | +| `make ci` | Run the complete local validation sequence | + +`make lint-repository` uses the same pinned Hoverkraft Super-Linter image and +validator selection as CI. It checks workflows, action pinning policy, configuration, +Markdown, spelling, shell scripts, Dockerfiles and infrastructure security. +Language lint runs through the project-owned tools in `make lint-code` and the shared +language CI, so dependency resolution and tool configuration stay consistent. + +## Continuous integration + +Pull requests, merge queues and main-branch pushes run the shared language checks +and repository linter. A weekly run detects newly disclosed dependency vulnerabilities. +Shared CI reports consolidate native reports after the producer jobs finish; producer +failures continue to block validation. The semantic PR workflow and repository linter +share [.commitlintrc.json](../../.commitlintrc.json). + +The `ci-github-go` references intentionally use `main` during adoption. +The pinning policy permits that repository only; other external actions use reviewed +SHAs with version comments. Replace those temporary branch references with reviewed +release pins after adoption. + +Dependabot groups weekly updates for actions, language dependencies, Docker images +and devcontainer features, with a seven-day cooldown and Conventional Commit titles. +Review the lockfile and run `make ci` when updating dependencies or features. + +## Image and chart checks + +Tests run once with race detection and atomic coverage. Coveralls receives that same +coverage profile. Image builds wait for code and repository checks; container +health/authentication and Helm installation checks validate the built digest before +release promotion. Chart publication and Docker Hub mirroring retain their existing +destinations and credentials. + +## Container and chart policy + +The image runs as UID/GID 10001 and has an HTTP health check. The chart disables +service account token mounting, drops capabilities, uses a read-only root filesystem, +sets resource budgets and denies outbound traffic. Adjust the budgets for your workload. + +Raw YAML formatters exclude Helm Go templates; the chart checks and security scanners +validate their rendered manifests. Scoped scanner annotations document Helm namespace +and image inputs, plus the existing environment-based authentication interface. +CI installs the built image by digest. Deploy into a dedicated namespace and pass a +strong authentication value explicitly. + +Chart validation uses the synthetic token in +[ci/default-values.yaml](../../helm/chart/ci/default-values.yaml). Production installs +must provide `securityHeader.value`; the chart has no default authentication token. diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 index ce7bdb6..eea3c8e --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,11 +1,13 @@ -#!/bin/ash - -# shellcheck shell=dash - +#!/bin/sh set -eu -set -o pipefail -[ -z "${HEADER}" ] && echo "HEADER is required" && exit 1 -[ -z "${VALUE}" ] && echo "VALUE is required" && exit 1 +if [ -z "${HEADER:-}" ]; then + echo "HEADER is required" >&2 + exit 1 +fi +if [ -z "${VALUE:-}" ]; then + echo "VALUE is required" >&2 + exit 1 +fi -/usr/local/bin/http-header-authenticator check -H "${HEADER}" -V "${VALUE}" +exec /usr/local/bin/http-header-authenticator check -H "${HEADER}" -V "${VALUE}" diff --git a/helm/chart-schema.yaml b/helm/chart-schema.yaml index 2a26d9b..c2bf60e 100644 --- a/helm/chart-schema.yaml +++ b/helm/chart-schema.yaml @@ -1,3 +1,4 @@ +--- name: str() home: str(required=False) version: str() diff --git a/helm/chart/Chart.yaml b/helm/chart/Chart.yaml index 12d495d..6bfb19d 100644 --- a/helm/chart/Chart.yaml +++ b/helm/chart/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 name: http-header-authenticator description: A Helm chart for http-header-authenticator diff --git a/helm/chart/ci/default-values.yaml b/helm/chart/ci/default-values.yaml new file mode 100644 index 0000000..bcdca02 --- /dev/null +++ b/helm/chart/ci/default-values.yaml @@ -0,0 +1,4 @@ +--- +# Synthetic value for chart linting and isolated CI installs only. +securityHeader: + value: ci-test-value diff --git a/helm/chart/templates/deployment.yaml b/helm/chart/templates/deployment.yaml index 3ab2f7d..4e5dd54 100644 --- a/helm/chart/templates/deployment.yaml +++ b/helm/chart/templates/deployment.yaml @@ -1,6 +1,11 @@ apiVersion: apps/v1 kind: Deployment metadata: + annotations: + checkov.io/skip1: "CKV_K8S_21=Install into a dedicated namespace with --namespace; honor the Helm release namespace." + checkov.io/skip2: "CKV_K8S_43=Release tags are chart inputs; CI installs and tests the built tag@sha256 digest." + checkov.io/skip3: "CKV_K8S_35=The application accepts HEADER and VALUE through its documented environment interface." + namespace: {{ .Release.Namespace }} name: {{ include "chart.fullname" . }} labels: {{- include "chart.labels" . | nindent 4 }} @@ -25,6 +30,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + automountServiceAccountToken: false serviceAccountName: {{ include "chart.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/helm/chart/templates/hpa.yaml b/helm/chart/templates/hpa.yaml index a91f61b..60bf55e 100644 --- a/helm/chart/templates/hpa.yaml +++ b/helm/chart/templates/hpa.yaml @@ -2,6 +2,9 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: + annotations: + checkov.io/skip1: "CKV_K8S_21=Install into a dedicated namespace with --namespace; honor the Helm release namespace." + namespace: {{ .Release.Namespace }} name: {{ include "chart.fullname" . }} labels: {{- include "chart.labels" . | nindent 4 }} diff --git a/helm/chart/templates/ingress.yaml b/helm/chart/templates/ingress.yaml index 63c1311..e3b60ff 100644 --- a/helm/chart/templates/ingress.yaml +++ b/helm/chart/templates/ingress.yaml @@ -15,11 +15,13 @@ apiVersion: extensions/v1beta1 {{- end }} kind: Ingress metadata: + namespace: {{ .Release.Namespace }} name: {{ $fullName }} labels: {{- include "chart.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} annotations: + checkov.io/skip1: "CKV_K8S_21=Install into a dedicated namespace with --namespace; honor the Helm release namespace." + {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: diff --git a/helm/chart/templates/networkpolicy.yaml b/helm/chart/templates/networkpolicy.yaml new file mode 100644 index 0000000..a4118be --- /dev/null +++ b/helm/chart/templates/networkpolicy.yaml @@ -0,0 +1,21 @@ +{{- if .Values.networkPolicy.enabled }} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "chart.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "chart.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + {{- include "chart.selectorLabels" . | nindent 6 }} + policyTypes: + - Ingress + - Egress + ingress: + - ports: + - protocol: TCP + port: http + egress: [] +{{- end }} diff --git a/helm/chart/templates/secrets.yaml b/helm/chart/templates/secrets.yaml index 68d9acd..07ed59a 100644 --- a/helm/chart/templates/secrets.yaml +++ b/helm/chart/templates/secrets.yaml @@ -1,9 +1,12 @@ apiVersion: v1 kind: Secret metadata: + annotations: + checkov.io/skip1: "CKV_K8S_21=Install into a dedicated namespace with --namespace; honor the Helm release namespace." + namespace: {{ .Release.Namespace }} name: {{ include "chart.fullname" . }} labels: {{- include "chart.labels" . | nindent 4 }} data: HEADER: {{ .Values.securityHeader.name | default "X-Auth-Token" | b64enc }} - VALUE: {{ .Values.securityHeader.value | default "1234567890" | b64enc }} + VALUE: {{ required "Set securityHeader.value to a strong authentication token" .Values.securityHeader.value | b64enc }} diff --git a/helm/chart/templates/service.yaml b/helm/chart/templates/service.yaml index dfc5b3a..b42054e 100644 --- a/helm/chart/templates/service.yaml +++ b/helm/chart/templates/service.yaml @@ -1,6 +1,9 @@ apiVersion: v1 kind: Service metadata: + annotations: + checkov.io/skip1: "CKV_K8S_21=Install into a dedicated namespace with --namespace; honor the Helm release namespace." + namespace: {{ .Release.Namespace }} name: {{ include "chart.fullname" . }} labels: {{- include "chart.labels" . | nindent 4 }} diff --git a/helm/chart/templates/serviceaccount.yaml b/helm/chart/templates/serviceaccount.yaml index 26a57fa..f2e90a8 100644 --- a/helm/chart/templates/serviceaccount.yaml +++ b/helm/chart/templates/serviceaccount.yaml @@ -2,11 +2,13 @@ apiVersion: v1 kind: ServiceAccount metadata: + namespace: {{ .Release.Namespace }} name: {{ include "chart.serviceAccountName" . }} labels: {{- include "chart.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} annotations: + checkov.io/skip1: "CKV_K8S_21=Install into a dedicated namespace with --namespace; honor the Helm release namespace." + {{- with .Values.serviceAccount.annotations }} {{- toYaml . | nindent 4 }} {{- end }} {{- end }} diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index 78e5171..98a80ee 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -1,86 +1,61 @@ -# Default values for chart. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - +--- +# Override resource budgets for your workload. Install into a dedicated namespace. securityHeader: name: X-Auth-Token - value: "1234567890" - + # Required: provide a strong authentication token when installing. + value: "" replicaCount: 1 - image: - repository: webofmars/http-header-authenticator - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. + repository: docker.io/webofmars/http-header-authenticator + pullPolicy: Always tag: "" - imagePullSecrets: [] nameOverride: "" fullnameOverride: "" - serviceAccount: - # Specifies whether a service account should be created create: true - # Annotations to add to the service account annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template name: "" - podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - +podSecurityContext: + runAsNonRoot: true + runAsUser: 10001 + runAsGroup: 10001 + seccompProfile: + type: RuntimeDefault +securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: + - ALL service: type: ClusterIP port: 8080 - ingress: enabled: false className: "" annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" hosts: - host: chart-example.local paths: - path: / pathType: ImplementationSpecific tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - +resources: + requests: + cpu: 10m + memory: 32Mi + limits: + cpu: 500m + memory: 128Mi autoscaling: enabled: false minReplicas: 1 maxReplicas: 100 targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - nodeSelector: {} - tolerations: [] - affinity: {} +networkPolicy: + enabled: true diff --git a/helm/lintconf.yaml b/helm/lintconf.yaml index 9fb5aca..c0bc53e 100644 --- a/helm/lintconf.yaml +++ b/helm/lintconf.yaml @@ -1,3 +1,4 @@ +--- rules: braces: min-spaces-inside: 0 @@ -20,7 +21,7 @@ rules: require-starting-space: true min-spaces-from-content: 2 document-end: disable - document-start: disable # No --- to start a file + document-start: disable # No --- to start a file empty-lines: max: 2 max-start: 0 @@ -29,10 +30,10 @@ rules: max-spaces-after: 1 indentation: spaces: consistent - indent-sequences: whatever # - list indentation will handle both indentation and without + indent-sequences: whatever # - list indentation will handle both indentation and without check-multi-line-strings: false key-duplicates: enable - line-length: disable # Lines can be any length + line-length: disable # Lines can be any length new-line-at-end-of-file: disable new-lines: type: unix diff --git a/skaffold.yaml b/skaffold.yaml index d29937e..fd70aaa 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -1,3 +1,4 @@ +--- apiVersion: skaffold/v4beta7 kind: Config build: From 7b6b11a02383b245865d7bd985cc276b44a22756 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 24 Nov 2026 12:25:06 +0100 Subject: [PATCH 04/35] ci: preserve existing CodeQL and validate deployment policies --- .github/workflows/__shared-ci.yml | 2 ++ docs/development/README.md | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 18429d8..bc2a367 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -30,6 +30,8 @@ jobs: statuses: write with: comment: false + # Keep the repository-managed CodeQL default setup for Go. + codeql-languages: "" lint-all: true javascript-linter-toolchain: "" python-linter-toolchain: "" diff --git a/docs/development/README.md b/docs/development/README.md index 5d1b3d8..365b3f7 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -68,3 +68,8 @@ strong authentication value explicitly. Chart validation uses the synthetic token in [ci/default-values.yaml](../../helm/chart/ci/default-values.yaml). Production installs must provide `securityHeader.value`; the chart has no default authentication token. + +The existing GitHub CodeQL default setup continues to scan Go. The shared +linter disables its additional CodeQL job because GitHub rejects advanced-setup +results while default setup is enabled. Actionlint, Zizmor and Checkov still check +workflow correctness and security. From b0b8dfe4bd7015d18ef857c8ad7459fe83882395 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 24 Nov 2026 13:21:51 +0100 Subject: [PATCH 05/35] ci: complete shared CI and DevX adoption --- .dockerignore | 1 - .github/linters/Dockerfile | 25 ++-------- .github/linters/trivy-exceptions.yaml | 8 ---- .github/linters/trivy.yaml | 1 - .github/linters/zizmor.yaml | 6 --- .github/renovate.json | 48 +++++++++++++++++++ .github/workflows/__renovate.yml | 39 +++++++++++++++ .github/workflows/__shared-ci.yml | 36 +++++--------- .github/workflows/main-ci.yml | 3 ++ .tool-versions | 1 - README.md | 16 ++++++- docs/development/README.md | 16 +++++-- helm/chart/templates/NOTES.txt | 4 +- helm/chart/templates/deployment.yaml | 1 + skaffold.yaml | 14 ------ .../http-header-authenticator/main.go | 2 +- 16 files changed, 139 insertions(+), 82 deletions(-) delete mode 100644 .github/linters/trivy-exceptions.yaml delete mode 100644 .github/linters/zizmor.yaml create mode 100644 .github/renovate.json create mode 100644 .github/workflows/__renovate.yml delete mode 100644 skaffold.yaml diff --git a/.dockerignore b/.dockerignore index 8c6d8bb..2491ea7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -35,7 +35,6 @@ helm .golangci.yml coverage.out Makefile -skaffold.yaml /.devcontainer /super-linter-output /super-linter.log diff --git a/.github/linters/Dockerfile b/.github/linters/Dockerfile index 75f24f9..4cb3f77 100644 --- a/.github/linters/Dockerfile +++ b/.github/linters/Dockerfile @@ -5,24 +5,9 @@ ARG GID=1000 USER ${UID}:${GID} HEALTHCHECK --interval=5m --timeout=10s --start-period=30s --retries=3 CMD ["/bin/sh", "-c", "test -d /github/home"] -# Application lint uses the project-owned Go or Python tools through make lint-code. -ENV VALIDATE_JAVASCRIPT_TOOLCHAIN="" \ - VALIDATE_PYTHON_TOOLCHAIN="" \ +# Lint every Go package with GO_MODULES; standalone-file mode cannot span packages. +# Use the Go compiler bundled with golangci-lint to keep export-data formats compatible. +ENV VALIDATE_GO=false \ + GOTOOLCHAIN=local \ LOG_LEVEL=INFO \ - IGNORE_GITIGNORED_FILES=true \ - VALIDATE_BASH=true \ - VALIDATE_BASH_EXEC=true \ - VALIDATE_BIOME_FORMAT=true \ - VALIDATE_BIOME_LINT=true \ - VALIDATE_CHECKOV=true \ - VALIDATE_DOCKERFILE_HADOLINT=true \ - VALIDATE_GITHUB_ACTIONS=true \ - VALIDATE_GITHUB_ACTIONS_ZIZMOR=true \ - VALIDATE_GIT_COMMITLINT=true \ - VALIDATE_MARKDOWN=true \ - VALIDATE_MARKDOWN_PRETTIER=true \ - VALIDATE_NATURAL_LANGUAGE=true \ - VALIDATE_SHELL_SHFMT=true \ - VALIDATE_TRIVY=true \ - VALIDATE_YAML=true \ - VALIDATE_YAML_PRETTIER=true + IGNORE_GITIGNORED_FILES=true diff --git a/.github/linters/trivy-exceptions.yaml b/.github/linters/trivy-exceptions.yaml deleted file mode 100644 index 9235159..0000000 --- a/.github/linters/trivy-exceptions.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -misconfigurations: - - id: KSV-0110 - paths: - - helm/chart/templates/deployment.yaml - statement: - The chart honors .Release.Namespace. Install with --namespace as documented; - Trivy renders with Helm defaults. diff --git a/.github/linters/trivy.yaml b/.github/linters/trivy.yaml index f6013cb..29e011e 100644 --- a/.github/linters/trivy.yaml +++ b/.github/linters/trivy.yaml @@ -7,7 +7,6 @@ scan: - vuln - misconfig - secret -ignorefile: .github/linters/trivy-exceptions.yaml misconfiguration: helm: values: diff --git a/.github/linters/zizmor.yaml b/.github/linters/zizmor.yaml deleted file mode 100644 index 9b83340..0000000 --- a/.github/linters/zizmor.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -rules: - unpinned-uses: - config: - policies: - hoverkraft-tech/ci-github-go/*: ref-pin diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..4df258c --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended"], + "enabledManagers": ["custom.regex", "gomod", "asdf"], + "semanticCommits": "enabled", + "semanticCommitType": "build", + "minimumReleaseAge": "7 days", + "customManagers": [ + { + "customType": "regex", + "managerFilePatterns": ["/^\\.devcontainer/devcontainer\\.json$/"], + "matchStrings": [ + "\"ghcr.io/devcontainers/features/go:1\":\\s*\\{\\s*\"version\":\\s*\"(?[0-9.]+)\"" + ], + "datasourceTemplate": "golang-version", + "depNameTemplate": "go" + }, + { + "customType": "regex", + "managerFilePatterns": ["/^\\.devcontainer/devcontainer\\.json$/"], + "matchStrings": [ + "\"golangciLintVersion\":\\s*\"(?[0-9.]+)\"" + ], + "datasourceTemplate": "github-releases", + "depNameTemplate": "golangci/golangci-lint" + }, + { + "customType": "regex", + "managerFilePatterns": ["/^Makefile$/"], + "matchStrings": [ + "golang.org/x/vuln/cmd/govulncheck@(?v[0-9.]+)" + ], + "datasourceTemplate": "go", + "depNameTemplate": "golang.org/x/vuln" + } + ], + "packageRules": [ + { + "matchManagers": ["gomod"], + "matchDepNames": ["!go"], + "enabled": false + }, + { + "matchDepNames": ["go"], + "groupName": "Go toolchain" + } + ] +} diff --git a/.github/workflows/__renovate.yml b/.github/workflows/__renovate.yml new file mode 100644 index 0000000..f4244a3 --- /dev/null +++ b/.github/workflows/__renovate.yml @@ -0,0 +1,39 @@ +--- +name: Internal - Renovate dependency updates +permissions: {} +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false +jobs: + renovate: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Generate GitHub App token + id: generate-token + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + with: + client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} + permission-checks: read + permission-contents: write + permission-issues: write + permission-pull-requests: write + permission-statuses: write + permission-workflows: write + - name: Run Renovate + uses: renovatebot/github-action@acdd6bda8b035c99ce59d5675816af2aa65a1774 # v46.3.14 + with: + token: ${{ steps.generate-token.outputs.token }} + env: + RENOVATE_PLATFORM: github + RENOVATE_REPOSITORIES: ${{ github.repository }} + RENOVATE_ONBOARDING: "false" + RENOVATE_REQUIRE_CONFIG: required + RENOVATE_USERNAME: ${{ steps.generate-token.outputs.app-slug }}[bot] + RENOVATE_PLATFORM_COMMIT: enabled + if: vars.CI_BOT_APP_CLIENT_ID != '' +"on": + workflow_dispatch: null + schedule: + - cron: 23 4 * * 5 diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index bc2a367..a327cd5 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -33,27 +33,12 @@ jobs: # Keep the repository-managed CodeQL default setup for Go. codeql-languages: "" lint-all: true - javascript-linter-toolchain: "" - python-linter-toolchain: "" + # GO_MODULES runs the full linter recursively; standalone-file mode cannot span packages. linter-env: | + VALIDATE_GO=false + GOTOOLCHAIN=local IGNORE_GITIGNORED_FILES=true LOG_LEVEL=INFO - VALIDATE_BASH=true - VALIDATE_BASH_EXEC=true - VALIDATE_BIOME_FORMAT=true - VALIDATE_BIOME_LINT=true - VALIDATE_CHECKOV=true - VALIDATE_DOCKERFILE_HADOLINT=true - VALIDATE_GITHUB_ACTIONS=true - VALIDATE_GITHUB_ACTIONS_ZIZMOR=true - VALIDATE_GIT_COMMITLINT=${{ github.event_name == 'push' || github.event_name == 'pull_request' }} - VALIDATE_MARKDOWN=true - VALIDATE_MARKDOWN_PRETTIER=true - VALIDATE_NATURAL_LANGUAGE=true - VALIDATE_SHELL_SHFMT=true - VALIDATE_TRIVY=true - VALIDATE_YAML=true - VALIDATE_YAML_PRETTIER=true test: name: Go checks and coverage @@ -66,14 +51,14 @@ jobs: # Track main while validating the new shared Go actions in consumers. - name: Setup Go - uses: hoverkraft-tech/ci-github-go/actions/setup-go@main # ratchet:exclude - track shared language CI during adoption + uses: hoverkraft-tech/ci-github-go/actions/setup-go@main # ratchet:exclude # zizmor: ignore[unpinned-uses] - name: Lint - uses: hoverkraft-tech/ci-github-go/actions/lint@main # ratchet:exclude - track shared language CI during adoption + uses: hoverkraft-tech/ci-github-go/actions/lint@main # ratchet:exclude # zizmor: ignore[unpinned-uses] - name: Test with race detection and coverage id: tests - uses: hoverkraft-tech/ci-github-go/actions/test@main # ratchet:exclude - track shared language CI during adoption + uses: hoverkraft-tech/ci-github-go/actions/test@main # ratchet:exclude # zizmor: ignore[unpinned-uses] - name: Coveralls if: ${{ !cancelled() && steps.tests.outcome != 'skipped' }} @@ -83,7 +68,7 @@ jobs: format: golang - name: Audit dependencies - uses: hoverkraft-tech/ci-github-go/actions/audit@main # ratchet:exclude - track shared language CI during adoption + uses: hoverkraft-tech/ci-github-go/actions/audit@main # ratchet:exclude # zizmor: ignore[unpinned-uses] chart-testing: name: Test chart with the built image @@ -134,6 +119,8 @@ jobs: image.tag=${{ steps.image.outputs.tag }} imagePullSecrets[0].name=regcred + # jscpd:ignore-start + # Both independent chart jobs must remove their own downloaded archive. - name: Clean prepared chart archive if: always() && steps.prepare-chart.outputs.archive != '' uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -141,6 +128,7 @@ jobs: CHART_ARCHIVE: ${{ steps.prepare-chart.outputs.archive }} with: script: await io.rmRF(process.env.CHART_ARCHIVE); + # jscpd:ignore-end docker-build-images: name: "Docker: Build Images" @@ -193,8 +181,8 @@ jobs: port=$(docker port "$container" 8080/tcp | cut -d: -f2) url="http://127.0.0.1:$port" curl --fail --retry 15 --retry-connrefused --retry-delay 1 "$url/health" - test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: ci-test-value' "$url/check")" = 200 - test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: wrong-value' "$url/check")" = 403 + test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: ci-test-value' "$url/check")" = 200 # gitleaks:allow - test token + test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: wrong-value' "$url/check")" = 403 # gitleaks:allow - invalid test token test "$(curl -s -o /dev/null -w '%{http_code}' "$url/check")" = 403 test "$(docker exec "$container" id -u)" = 10001 for _ in {1..15}; do diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 4005520..86718bd 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -9,6 +9,8 @@ on: branches: - main +# jscpd:ignore-start +# GitHub requires permissions and the shared-workflow call in each event entrypoint. permissions: contents: read @@ -30,3 +32,4 @@ jobs: pull-requests: write security-events: write statuses: write +# jscpd:ignore-end diff --git a/.tool-versions b/.tool-versions index 666cc48..f651ac6 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1 @@ -skaffold 2.8.0 helm 3.12.1 diff --git a/README.md b/README.md index f34cdf7..dc93236 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,17 @@ # http-header-authenticator +
+ Hoverkraft logo +
+ +--- + +[![Main - Continuous Integration](https://github.com/hoverkraft-tech/http-header-authenticator/actions/workflows/main-ci.yml/badge.svg)](https://github.com/hoverkraft-tech/http-header-authenticator/actions/workflows/main-ci.yml) +[![GitHub release](https://img.shields.io/github/v/release/hoverkraft-tech/http-header-authenticator)](https://github.com/hoverkraft-tech/http-header-authenticator/releases) +[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) + +## Overview + Go service that authenticates HTTP requests against a configured header and value. ## Usage @@ -48,4 +60,6 @@ go build -o ./bin/http-header-authenticator ./src/github.com/hoverkraft-tech/htt See the [development guide](docs/development/README.md) for local checks. -See [Contributing](CONTRIBUTING.md) to develop or propose changes. +## Contributing + +Contributions are welcome. Read [Contributing](CONTRIBUTING.md) before proposing a change. diff --git a/docs/development/README.md b/docs/development/README.md index 365b3f7..176685d 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -23,10 +23,15 @@ Use the supported Go toolchain and golangci-lint declared in the devcontainer. ` | `make ci` | Run the complete local validation sequence | `make lint-repository` uses the same pinned Hoverkraft Super-Linter image and -validator selection as CI. It checks workflows, action pinning policy, configuration, +tool configuration as CI, without a repository validator allowlist. It checks +workflows, action pinning policy, configuration, Markdown, spelling, shell scripts, Dockerfiles and infrastructure security. Language lint runs through the project-owned tools in `make lint-code` and the shared language CI, so dependency resolution and tool configuration stay consistent. +Super-Linter checks Go recursively through `GO_MODULES`; its standalone-file mode +cannot combine files from multiple packages and is disabled. `GOTOOLCHAIN=local` +keeps its bundled compiler compatible with its golangci-lint binary. The dedicated +Go CI still uses the project toolchain. ## Continuous integration @@ -37,12 +42,17 @@ failures continue to block validation. The semantic PR workflow and repository l share [.commitlintrc.json](../../.commitlintrc.json). The `ci-github-go` references intentionally use `main` during adoption. -The pinning policy permits that repository only; other external actions use reviewed -SHAs with version comments. Replace those temporary branch references with reviewed +Those references carry temporary inline pinning exceptions; other external actions +use reviewed SHAs with version comments. Replace those temporary branch references with reviewed release pins after adoption. Dependabot groups weekly updates for actions, language dependencies, Docker images and devcontainer features, with a seven-day cooldown and Conventional Commit titles. +Renovate maintains runtime versions and embedded tool versions through the scheduled +[workflow](../../.github/workflows/__renovate.yml) and +[configuration](../../.github/renovate.json). It uses the organization CI bot's +`CI_BOT_APP_CLIENT_ID` variable and `CI_BOT_APP_PRIVATE_KEY` secret. Dependabot +continues to maintain package dependencies, actions, Docker images and features. Review the lockfile and run `make ci` when updating dependencies or features. ## Image and chart checks diff --git a/helm/chart/templates/NOTES.txt b/helm/chart/templates/NOTES.txt index 319f01b..11358fc 100644 --- a/helm/chart/templates/NOTES.txt +++ b/helm/chart/templates/NOTES.txt @@ -10,8 +10,8 @@ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "chart.fullname" . }}' + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + Watch its status with 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "chart.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} diff --git a/helm/chart/templates/deployment.yaml b/helm/chart/templates/deployment.yaml index 4e5dd54..4bf128c 100644 --- a/helm/chart/templates/deployment.yaml +++ b/helm/chart/templates/deployment.yaml @@ -1,3 +1,4 @@ +# trivy:ignore:KSV-0110 The installer selects .Release.Namespace with --namespace. apiVersion: apps/v1 kind: Deployment metadata: diff --git a/skaffold.yaml b/skaffold.yaml deleted file mode 100644 index fd70aaa..0000000 --- a/skaffold.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: skaffold/v4beta7 -kind: Config -build: - local: - tryImportMissing: true - useBuildkit: true - tagPolicy: - gitCommit: {} - artifacts: - - image: http-header-authenticator - docker: - dockerfile: Dockerfile -deploy: {} diff --git a/src/github.com/hoverkraft-tech/http-header-authenticator/main.go b/src/github.com/hoverkraft-tech/http-header-authenticator/main.go index c25a271..89ce00c 100644 --- a/src/github.com/hoverkraft-tech/http-header-authenticator/main.go +++ b/src/github.com/hoverkraft-tech/http-header-authenticator/main.go @@ -22,7 +22,7 @@ func main() { var checkCmd = &cobra.Command{ Use: "check", Short: "Check the presence of an HTTP header in a request", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { if headerName == "" || expectedValue == "" { fmt.Println("Header name and expected value are required.") return From 704de98e6e0ae598b96bd695c14c9d9ac19ee101 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Wed, 25 Nov 2026 18:55:04 +0100 Subject: [PATCH 06/35] build(deps): update ci-github-publish to 3.1.2 --- .github/workflows/prepare-release.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index e161cf3..07d024f 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -13,7 +13,7 @@ concurrency: jobs: release: - uses: hoverkraft-tech/ci-github-publish/.github/workflows/prepare-release.yml@80fa7011b27f49f2e04a19f932d36047d17a28f2 # 3.0.7 + uses: hoverkraft-tech/ci-github-publish/.github/workflows/prepare-release.yml@bf24f894f60a3def62a8750f3964d05acb052c11 # 3.1.2 permissions: contents: read pull-requests: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8532657..562b4f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -133,7 +133,7 @@ jobs: contents: write pull-requests: read steps: - - uses: hoverkraft-tech/ci-github-publish/actions/release/create@80fa7011b27f49f2e04a19f932d36047d17a28f2 # 3.0.7 + - uses: hoverkraft-tech/ci-github-publish/actions/release/create@bf24f894f60a3def62a8750f3964d05acb052c11 # 3.1.2 with: tag: ${{ needs.prepare.outputs.tag }} target-ref: ${{ github.sha }} From 71a4f507f3c1d5bc905db3b88d9462a998c8a97c Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Wed, 25 Nov 2026 21:00:39 +0100 Subject: [PATCH 07/35] build(deps): pin shared language CI releases --- .github/workflows/__shared-ci.yml | 14 ++++++-------- .github/workflows/semantic-pull-request.yml | 2 +- docs/development/README.md | 6 ++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index a327cd5..b607e65 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -19,7 +19,7 @@ permissions: jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@33462c06bcbbd9144d7f661929e61953604b444d # 4.3.2 + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 permissions: actions: read contents: read @@ -48,17 +48,15 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - # Track main while validating the new shared Go actions in consumers. - name: Setup Go - uses: hoverkraft-tech/ci-github-go/actions/setup-go@main # ratchet:exclude # zizmor: ignore[unpinned-uses] + uses: hoverkraft-tech/ci-github-go/actions/setup-go@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 - name: Lint - uses: hoverkraft-tech/ci-github-go/actions/lint@main # ratchet:exclude # zizmor: ignore[unpinned-uses] + uses: hoverkraft-tech/ci-github-go/actions/lint@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 - name: Test with race detection and coverage id: tests - uses: hoverkraft-tech/ci-github-go/actions/test@main # ratchet:exclude # zizmor: ignore[unpinned-uses] + uses: hoverkraft-tech/ci-github-go/actions/test@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 - name: Coveralls if: ${{ !cancelled() && steps.tests.outcome != 'skipped' }} @@ -68,7 +66,7 @@ jobs: format: golang - name: Audit dependencies - uses: hoverkraft-tech/ci-github-go/actions/audit@main # ratchet:exclude # zizmor: ignore[unpinned-uses] + uses: hoverkraft-tech/ci-github-go/actions/audit@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 chart-testing: name: Test chart with the built image @@ -196,7 +194,7 @@ jobs: reports: if: ${{ !cancelled() }} needs: [lint, test] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@33462c06bcbbd9144d7f661929e61953604b444d # 4.3.2 + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 permissions: contents: read pull-requests: write diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index 37df3bf..a58a750 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -9,6 +9,6 @@ permissions: {} jobs: title: - uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@33462c06bcbbd9144d7f661929e61953604b444d # 4.3.2 + uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 permissions: contents: read diff --git a/docs/development/README.md b/docs/development/README.md index 176685d..82d5f1e 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -41,10 +41,8 @@ Shared CI reports consolidate native reports after the producer jobs finish; pro failures continue to block validation. The semantic PR workflow and repository linter share [.commitlintrc.json](../../.commitlintrc.json). -The `ci-github-go` references intentionally use `main` during adoption. -Those references carry temporary inline pinning exceptions; other external actions -use reviewed SHAs with version comments. Replace those temporary branch references with reviewed -release pins after adoption. +External actions and reusable workflows use reviewed release SHAs with matching +version comments. Dependabot maintains these references. Dependabot groups weekly updates for actions, language dependencies, Docker images and devcontainer features, with a seven-day cooldown and Conventional Commit titles. From 5b28d47436d22c6d3be0a2710f14b1fc921e65bc Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Wed, 25 Nov 2026 22:16:47 +0100 Subject: [PATCH 08/35] ci: address shared workflow and dependency maintenance review --- .github/linters/.checkov.yaml | 2 + .github/renovate.json | 13 ++- .github/workflows/__shared-ci.yml | 124 +++++++++----------------- .github/workflows/main-ci.yml | 3 +- .github/workflows/pull-request-ci.yml | 3 +- .github/workflows/release.yml | 49 ++++------ .github/workflows/stale.yml | 16 +--- docs/development/README.md | 26 +++--- 8 files changed, 90 insertions(+), 146 deletions(-) diff --git a/.github/linters/.checkov.yaml b/.github/linters/.checkov.yaml index d262c25..a012a12 100644 --- a/.github/linters/.checkov.yaml +++ b/.github/linters/.checkov.yaml @@ -1,4 +1,6 @@ --- quiet: true +# Supply the required synthetic authentication value so Checkov can render and scan the chart. +# This is a Helm values input, not a scan exclusion. var-file: - helm/chart/ci/default-values.yaml diff --git a/.github/renovate.json b/.github/renovate.json index 4df258c..bd8e923 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -36,13 +36,22 @@ ], "packageRules": [ { + "description": "Dependabot owns Go module dependencies and minimum Go requirements.", "matchManagers": ["gomod"], - "matchDepNames": ["!go"], "enabled": false }, { - "matchDepNames": ["go"], + "description": "Only the explicit compiler toolchain is maintained by Renovate.", + "matchManagers": ["gomod"], + "matchDepTypes": ["toolchain"], + "enabled": true, "groupName": "Go toolchain" + }, + { + "description": "Maintain the Helm CLI in .tool-versions; chart dependencies belong to Dependabot.", + "matchManagers": ["asdf"], + "matchDepNames": ["!helm"], + "enabled": false } ] } diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index b607e65..e73f888 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -9,12 +9,14 @@ on: type: boolean default: false outputs: + chart-helm-set: + description: Installation overrides for the validated immutable image + value: ${{ jobs.test-image.outputs.helm-set }} job-results: description: Build and validation results for promotion value: ${{ toJSON(jobs) }} -permissions: - contents: read +permissions: {} jobs: lint: @@ -42,96 +44,31 @@ jobs: test: name: Go checks and coverage - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Setup Go - uses: hoverkraft-tech/ci-github-go/actions/setup-go@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 - - - name: Lint - uses: hoverkraft-tech/ci-github-go/actions/lint@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 - - - name: Test with race detection and coverage - id: tests - uses: hoverkraft-tech/ci-github-go/actions/test@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 - - - name: Coveralls - if: ${{ !cancelled() && steps.tests.outcome != 'skipped' }} - uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 - with: - file: coverage.out - format: golang - - - name: Audit dependencies - uses: hoverkraft-tech/ci-github-go/actions/audit@dcc9e10f1938e4496a40edc4e90eb0a6294a8bb2 # 0.0.1 + # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/13 + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@2db38ba3c9d23770c04b71866551231470cd2994 # PR #13 (unreleased) + permissions: + contents: read + id-token: write + with: + test: '{"coverage":"coveralls"}' chart-testing: - name: Test chart with the built image - needs: docker-build-images - runs-on: ubuntu-latest + name: Test chart with the validated image + needs: [docker-build-images, test-image] + uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-ci.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 permissions: contents: read packages: read - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - id: prepare-chart - uses: hoverkraft-tech/ci-github-container/actions/helm/prepare-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 - with: - path: helm/chart - - - uses: hoverkraft-tech/ci-github-container/actions/helm/lint-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 - with: - archive: ${{ steps.prepare-chart.outputs.archive }} - checksum: ${{ steps.prepare-chart.outputs.checksum }} - config: ct.yaml - - - id: image - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - BUILT_IMAGES: ${{ needs.docker-build-images.outputs.built-images }} - with: - script: | - const { images, digest } = JSON.parse(process.env.BUILT_IMAGES).app; - const reference = images[0].split('@')[0]; - const separator = reference.lastIndexOf(':'); - if (separator <= reference.lastIndexOf('/') || !/^sha256:[a-f0-9]{64}$/.test(digest)) { - throw new Error('Expected a tagged image with an immutable digest'); - } - core.setOutput('repository', reference.slice(0, separator)); - core.setOutput('tag', `${reference.slice(separator + 1)}@${digest}`); - - - uses: hoverkraft-tech/ci-github-container/actions/helm/test-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 - with: - archive: ${{ steps.prepare-chart.outputs.archive }} - checksum: ${{ steps.prepare-chart.outputs.checksum }} - config: ct.yaml - helm-set: | - securityHeader.value=ci-test-value - image.repository=${{ steps.image.outputs.repository }} - image.tag=${{ steps.image.outputs.tag }} - imagePullSecrets[0].name=regcred - - # jscpd:ignore-start - # Both independent chart jobs must remove their own downloaded archive. - - name: Clean prepared chart archive - if: always() && steps.prepare-chart.outputs.archive != '' - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - CHART_ARCHIVE: ${{ steps.prepare-chart.outputs.archive }} - with: - script: await io.rmRF(process.env.CHART_ARCHIVE); - # jscpd:ignore-end + with: + path: helm/chart + config: ct.yaml + images: ${{ needs.docker-build-images.outputs.built-images }} + helm-set: ${{ needs.test-image.outputs.helm-set }} docker-build-images: name: "Docker: Build Images" needs: [lint, test] - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 permissions: attestations: write actions: read @@ -162,6 +99,7 @@ jobs: packages: read outputs: validated-images: ${{ needs.docker-build-images.outputs.built-images }} + helm-set: ${{ steps.image.outputs.helm-set }} steps: - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: @@ -191,6 +129,26 @@ jobs: done test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy + - name: Map the validated digest into chart values + id: image + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + BUILT_IMAGES: ${{ needs.docker-build-images.outputs.built-images }} + with: + script: | + const { images, digest } = JSON.parse(process.env.BUILT_IMAGES).app; + const reference = images[0].split('@')[0]; + const separator = reference.lastIndexOf(':'); + if (separator <= reference.lastIndexOf('/') || !/^sha256:[a-f0-9]{64}$/.test(digest)) { + throw new Error('Expected a tagged image with an immutable digest'); + } + core.setOutput('helm-set', [ + 'securityHeader.value=ci-test-value', + `image.repository=${reference.slice(0, separator)}`, + `image.tag=${reference.slice(separator + 1)}@${digest}`, + 'imagePullSecrets[0].name=regcred', + ].join('\n')); + reports: if: ${{ !cancelled() }} needs: [lint, test] diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 86718bd..385f29e 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -11,8 +11,7 @@ on: # jscpd:ignore-start # GitHub requires permissions and the shared-workflow call in each event entrypoint. -permissions: - contents: read +permissions: {} concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml index 262f950..15c77b5 100644 --- a/.github/workflows/pull-request-ci.yml +++ b/.github/workflows/pull-request-ci.yml @@ -7,8 +7,7 @@ on: branches: - main -permissions: - contents: read +permissions: {} concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 562b4f7..7d78b88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ concurrency: jobs: prepare: - uses: hoverkraft-tech/ci-github-container/.github/workflows/prepare-chart-release.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + uses: hoverkraft-tech/ci-github-container/.github/workflows/prepare-chart-release.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 permissions: actions: write contents: write @@ -53,7 +53,7 @@ jobs: promote: needs: validate - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-promote-images.yml@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-promote-images.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 permissions: actions: read attestations: read @@ -91,40 +91,23 @@ jobs: run: docker buildx imagetools create --tag "docker.io/webofmars/http-header-authenticator:$RELEASE_TAG" "$IMAGE" release-chart: - needs: [prepare, mirror] - runs-on: self-hosted + needs: [prepare, validate, mirror] + # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-container/pull/999 + uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-release.yml@d21c49f884d2ca8406bcab4bce9c44b29ce4a8ed # PR #999 (unreleased) permissions: contents: read packages: write id-token: write - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Prepare release chart archive - id: prepare-chart - uses: hoverkraft-tech/ci-github-container/actions/helm/prepare-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 - with: - path: helm/chart - - - name: Publish prepared chart archive - uses: hoverkraft-tech/ci-github-container/actions/helm/release-chart@988ccc2b85dec5822e801d7bc0622cad7cc94870 # 4.1.0 - with: - archive: ${{ steps.prepare-chart.outputs.archive }} - checksum: ${{ steps.prepare-chart.outputs.checksum }} - oci-registry: harbor.hoverkraft.cloud - oci-repository: public/charts - oci-registry-username: ${{ secrets.HARBOR_REGISTRY_USER }} - oci-registry-password: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} - - - name: Clean prepared chart archive - if: always() && steps.prepare-chart.outputs.archive != '' - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - CHART_ARCHIVE: ${{ steps.prepare-chart.outputs.archive }} - with: - script: await io.rmRF(process.env.CHART_ARCHIVE); + with: + path: helm/chart + config: ct.yaml + helm-set: ${{ needs.validate.outputs.chart-helm-set }} + runs-on: '["self-hosted"]' + oci-registry: harbor.hoverkraft.cloud + oci-repository: public/charts + secrets: + oci-registry-username: ${{ secrets.HARBOR_REGISTRY_USER }} + oci-registry-password: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} release: needs: [prepare, release-chart] @@ -137,4 +120,4 @@ jobs: with: tag: ${{ needs.prepare.outputs.tag }} target-ref: ${{ github.sha }} - changelog-summary: ${{ format('{{"llmAuth":{0},"llmProvider":"openai"}}', toJSON(secrets.OPENAI_API_KEY)) }} + changelog-summary: ${{ secrets.CHANGELOG_SUMMARY }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d48558f..b982da1 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -5,23 +5,11 @@ on: schedule: - cron: "30 1 * * *" -permissions: - contents: read +permissions: {} jobs: stale: permissions: issues: write pull-requests: write - runs-on: ubuntu-latest - - steps: - - uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: "This issue is stale" - stale-pr-message: "This PR is stale" - stale-issue-label: "no-issue-activity" - exempt-issue-labels: "awaiting-approval,work-in-progress" - stale-pr-label: "no-pr-activity" - exempt-pr-labels: "awaiting-approval,work-in-progress" + uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 diff --git a/docs/development/README.md b/docs/development/README.md index 82d5f1e..e2c893f 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -42,21 +42,27 @@ failures continue to block validation. The semantic PR workflow and repository l share [.commitlintrc.json](../../.commitlintrc.json). External actions and reusable workflows use reviewed release SHAs with matching -version comments. Dependabot maintains these references. - -Dependabot groups weekly updates for actions, language dependencies, Docker images -and devcontainer features, with a seven-day cooldown and Conventional Commit titles. -Renovate maintains runtime versions and embedded tool versions through the scheduled -[workflow](../../.github/workflows/__renovate.yml) and -[configuration](../../.github/renovate.json). It uses the organization CI bot's -`CI_BOT_APP_CLIENT_ID` variable and `CI_BOT_APP_PRIVATE_KEY` secret. Dependabot -continues to maintain package dependencies, actions, Docker images and features. +version comments. Dependabot maintains these references. The pending shared workflow +capabilities use immutable candidate commits with linked TODOs; replace those pins +with the first containing release after the supporting PRs merge. + +Dependabot is the primary updater for Go modules, GitHub Actions, Docker images +and devcontainer features, with weekly groups and a seven-day cooldown. +Renovate is limited to versions outside those supported manifests: Go and +golangci-lint feature options, and the govulncheck version embedded in the Makefile. +It also maintains the explicit Go `toolchain` directive and the Helm CLI in +`.tool-versions`. It cannot update module dependencies or raise the minimum Go version. +The scheduled [Renovate workflow](../../.github/workflows/__renovate.yml) uses +`CI_BOT_APP_CLIENT_ID` and `CI_BOT_APP_PRIVATE_KEY`; its +[configuration](../../.github/renovate.json) explicitly limits enabled managers. Review the lockfile and run `make ci` when updating dependencies or features. ## Image and chart checks Tests run once with race detection and atomic coverage. Coveralls receives that same -coverage profile. Image builds wait for code and repository checks; container +coverage profile through the shared Go workflow. Helm validation and publication +use the dedicated container workflows. The Harbor robot username and password +remain secrets passed only to chart publication. Image builds wait for code and repository checks; container health/authentication and Helm installation checks validate the built digest before release promotion. Chart publication and Docker Hub mirroring retain their existing destinations and credentials. From 94808392ea3fc683755a82a7ed7244092db6b831 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 26 Nov 2026 08:14:09 +0100 Subject: [PATCH 09/35] ci: reuse immutable image mirroring and container 4.2.1 --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/release.yml | 32 +++++++++++-------------------- docs/development/README.md | 5 +++-- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index e73f888..0fe6728 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -45,7 +45,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/13 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@2db38ba3c9d23770c04b71866551231470cd2994 # PR #13 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@9968f40606caff42d54df871ffe01dec80409107 # PR #13 (unreleased) permissions: contents: read id-token: write @@ -55,7 +55,7 @@ jobs: chart-testing: name: Test chart with the validated image needs: [docker-build-images, test-image] - uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-ci.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 + uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-ci.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 permissions: contents: read packages: read @@ -68,7 +68,7 @@ jobs: docker-build-images: name: "Docker: Build Images" needs: [lint, test] - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 permissions: attestations: write actions: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d78b88..2294c44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ concurrency: jobs: prepare: - uses: hoverkraft-tech/ci-github-container/.github/workflows/prepare-chart-release.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 + uses: hoverkraft-tech/ci-github-container/.github/workflows/prepare-chart-release.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 permissions: actions: write contents: write @@ -53,7 +53,7 @@ jobs: promote: needs: validate - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-promote-images.yml@b055d6ce0f3a5e223615ad494d88d92e17af11e5 # 4.2.0 + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-promote-images.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 permissions: actions: read attestations: read @@ -69,31 +69,21 @@ jobs: mirror: name: Mirror validated image to Docker Hub needs: [prepare, promote] - runs-on: ubuntu-latest + # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-container/pull/1001 + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-mirror-image.yml@e8bd81eb506404d63f0304b02ff254e5fd2f0ce5 # PR #1001 (unreleased) permissions: contents: read packages: read - steps: - - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 - with: - username: ${{ vars.DOCKERHUB_REGISTRY_USERNAME }} - password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - - name: Copy the validated multi-platform manifest - env: - IMAGE: ${{ fromJSON(needs.promote.outputs.built-images).app.images[0] }} - RELEASE_TAG: ${{ needs.prepare.outputs.tag }} - run: docker buildx imagetools create --tag "docker.io/webofmars/http-header-authenticator:$RELEASE_TAG" "$IMAGE" + with: + source-image: ${{ fromJSON(needs.promote.outputs.built-images).app.images[0] }} + destination-image: docker.io/webofmars/http-header-authenticator:${{ needs.prepare.outputs.tag }} + destination-registry-username: ${{ vars.DOCKERHUB_REGISTRY_USERNAME }} + secrets: + destination-registry-password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} release-chart: needs: [prepare, validate, mirror] - # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-container/pull/999 - uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-release.yml@d21c49f884d2ca8406bcab4bce9c44b29ce4a8ed # PR #999 (unreleased) + uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-release.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 permissions: contents: read packages: write diff --git a/docs/development/README.md b/docs/development/README.md index e2c893f..eab1448 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -64,8 +64,9 @@ coverage profile through the shared Go workflow. Helm validation and publication use the dedicated container workflows. The Harbor robot username and password remain secrets passed only to chart publication. Image builds wait for code and repository checks; container health/authentication and Helm installation checks validate the built digest before -release promotion. Chart publication and Docker Hub mirroring retain their existing -destinations and credentials. +release promotion. The shared `docker-mirror-image.yml` copies the promoted immutable +reference to Docker Hub and verifies that its digest is unchanged. Chart publication +and Docker Hub mirroring retain their existing destinations and credentials. ## Container and chart policy From 30dda26843c86ad4fcbf58f94939651a61d92ee1 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 26 Nov 2026 09:21:57 +0100 Subject: [PATCH 10/35] ci: publish Docker Hub images through digest promotion --- .github/workflows/release.yml | 29 +++++++++++------------------ docs/development/README.md | 8 +++++--- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2294c44..3115211 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,8 +52,9 @@ jobs: candidate-images: true promote: - needs: validate - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-promote-images.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 + needs: [prepare, validate] + # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-container/pull/1001 + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-promote-images.yml@c9feed706862fc88f0fd33d287e6d6c12e738f74 # PR #1001 (unreleased) permissions: actions: read attestations: read @@ -63,26 +64,18 @@ jobs: pull-requests: read with: job-results: ${{ needs.validate.outputs.job-results }} + additional-destinations: | + {"app":["docker.io/webofmars/http-header-authenticator:${{ needs.prepare.outputs.tag }}"]} secrets: oci-registry-password: ${{ secrets.GITHUB_TOKEN }} - - mirror: - name: Mirror validated image to Docker Hub - needs: [prepare, promote] - # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-container/pull/1001 - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-mirror-image.yml@e8bd81eb506404d63f0304b02ff254e5fd2f0ce5 # PR #1001 (unreleased) - permissions: - contents: read - packages: read - with: - source-image: ${{ fromJSON(needs.promote.outputs.built-images).app.images[0] }} - destination-image: docker.io/webofmars/http-header-authenticator:${{ needs.prepare.outputs.tag }} - destination-registry-username: ${{ vars.DOCKERHUB_REGISTRY_USERNAME }} - secrets: - destination-registry-password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + destination-credentials: | + {"docker.io":{ + "username":${{ toJSON(vars.DOCKERHUB_REGISTRY_USERNAME) }}, + "password":${{ toJSON(secrets.DOCKERHUB_REGISTRY_PASSWORD) }} + }} release-chart: - needs: [prepare, validate, mirror] + needs: [prepare, validate, promote] uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-release.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 permissions: contents: read diff --git a/docs/development/README.md b/docs/development/README.md index eab1448..96fb94d 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -64,9 +64,11 @@ coverage profile through the shared Go workflow. Helm validation and publication use the dedicated container workflows. The Harbor robot username and password remain secrets passed only to chart publication. Image builds wait for code and repository checks; container health/authentication and Helm installation checks validate the built digest before -release promotion. The shared `docker-mirror-image.yml` copies the promoted immutable -reference to Docker Hub and verifies that its digest is unchanged. Chart publication -and Docker Hub mirroring retain their existing destinations and credentials. +release promotion. The shared `docker-promote-images.yml` publishes the validated +digest to GHCR and the explicitly configured Docker Hub destination in one locked, +journaled operation. It preserves and verifies the copied signatures and provenance. +Chart publication waits for both registries to succeed. Registry destinations and +credentials remain unchanged. ## Container and chart policy From f5ca78a5b4d8e6569d30a2c343c32e8c23fb4704 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 02:16:26 +0100 Subject: [PATCH 11/35] ci: consolidate Go matrix, image and chart reports --- .github/linters/actionlint.yml | 16 ++++++++++++++++ .github/workflows/__shared-ci.yml | 21 ++++++++++++++------- .github/workflows/main-ci.yml | 1 + .github/workflows/pull-request-ci.yml | 1 + .github/workflows/release.yml | 1 + docs/development/README.md | 14 ++++++++++++-- 6 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 .github/linters/actionlint.yml diff --git a/.github/linters/actionlint.yml b/.github/linters/actionlint.yml new file mode 100644 index 0000000..c629978 --- /dev/null +++ b/.github/linters/actionlint.yml @@ -0,0 +1,16 @@ +# FIXME: Remove this scoped exception when Actionlint supports code-quality. +# https://github.com/rhysd/actionlint/pull/674 + +paths: + .github/workflows/__shared-ci.yml: + ignore: + - ^unknown permission scope "code-quality"\. + .github/workflows/main-ci.yml: + ignore: + - ^unknown permission scope "code-quality"\. + .github/workflows/pull-request-ci.yml: + ignore: + - ^unknown permission scope "code-quality"\. + .github/workflows/release.yml: + ignore: + - ^unknown permission scope "code-quality"\. diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 0fe6728..d75fe27 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@57ec4a8bf0ab9ea52beea725b5e59895ed39f4f2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -31,7 +31,6 @@ jobs: security-events: write statuses: write with: - comment: false # Keep the repository-managed CodeQL default setup for Go. codeql-languages: "" lint-all: true @@ -44,13 +43,14 @@ jobs: test: name: Go checks and coverage - # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/13 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@9968f40606caff42d54df871ffe01dec80409107 # PR #13 (unreleased) + # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@8245b03d3b26196e5d3d6ed3559f4a3e72fa24f5 # PR #14 (unreleased) permissions: + actions: read contents: read id-token: write with: - test: '{"coverage":"coveralls"}' + go-versions: '["1.26", "1.27"]' chart-testing: name: Test chart with the validated image @@ -151,10 +151,17 @@ jobs: reports: if: ${{ !cancelled() }} - needs: [lint, test] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 + needs: [lint, test, docker-build-images, test-image, chart-testing] + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@57ec4a8bf0ab9ea52beea725b5e59895ed39f4f2 # PR #683 (unreleased) permissions: + actions: read contents: read pull-requests: write + code-quality: write + id-token: write + security-events: write with: job-results: ${{ toJSON(needs) }} + test-coverage-reporters: | + auto + coveralls diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 385f29e..5079c33 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -22,6 +22,7 @@ jobs: name: Continuous Integration uses: $/.github/workflows/__shared-ci.yml permissions: + code-quality: write attestations: write actions: read contents: read diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml index 15c77b5..2b7fc14 100644 --- a/.github/workflows/pull-request-ci.yml +++ b/.github/workflows/pull-request-ci.yml @@ -18,6 +18,7 @@ jobs: name: Continuous Integration uses: $/.github/workflows/__shared-ci.yml permissions: + code-quality: write attestations: write actions: read contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3115211..052007d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,7 @@ jobs: if: needs.prepare.outputs.status == 'ready' uses: $/.github/workflows/__shared-ci.yml permissions: + code-quality: write actions: read attestations: write contents: read diff --git a/docs/development/README.md b/docs/development/README.md index 96fb94d..4bee0a2 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -59,8 +59,18 @@ Review the lockfile and run `make ci` when updating dependencies or features. ## Image and chart checks -Tests run once with race detection and atomic coverage. Coveralls receives that same -coverage profile through the shared Go workflow. Helm validation and publication +Tests run on Go 1.26 and 1.27 with race detection and detailed JUnit results for +both runtimes. Lint, audit, build and atomic coverage run once on Go 1.27. The +shared Go action retains the native coverage profile and validates source paths. + +One terminal `reports` job waits for all code, container and Helm checks. It +publishes annotations and a consolidated summary with expandable details. +Coverage uses GitHub Code Quality when available, otherwise the pull request +comment, and is also submitted to Coveralls. Native Go coverage is shown as +statement coverage; a normalized LCOV projection supplies Coveralls without +changing the retained profile. + +Helm validation and publication use the dedicated container workflows. The Harbor robot username and password remain secrets passed only to chart publication. Image builds wait for code and repository checks; container health/authentication and Helm installation checks validate the built digest before From 055993d0211547bb13ac2f2c6f68a5620827d8f2 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 17:33:15 +0100 Subject: [PATCH 12/35] refactor(ci): separate report publication from CI completion --- .github/workflows/__shared-ci.yml | 26 ++++++++++++++++++++++---- docs/development/README.md | 6 ++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index d75fe27..83dee0b 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@57ec4a8bf0ab9ea52beea725b5e59895ed39f4f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@8245b03d3b26196e5d3d6ed3559f4a3e72fa24f5 # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@ea195d7103a4269e4fa8dc5b1c8ae8debab325a6 # PR #14 (unreleased) permissions: actions: read contents: read @@ -150,9 +150,9 @@ jobs: ].join('\n')); reports: - if: ${{ !cancelled() }} + if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@57ec4a8bf0ab9ea52beea725b5e59895ed39f4f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) permissions: actions: read contents: read @@ -165,3 +165,21 @@ jobs: test-coverage-reporters: | auto coveralls + + complete: + name: CI complete + if: always() + needs: + - lint + - test + - docker-build-images + - test-image + - chart-testing + - reports + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: {} + steps: + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + job-results: ${{ toJSON(needs) }} diff --git a/docs/development/README.md b/docs/development/README.md index 4bee0a2..804b488 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -35,6 +35,12 @@ Go CI still uses the project toolchain. ## Continuous integration +The separate `CI complete` job waits for every required CI job and reporting. +It fails on failed, cancelled or unexpectedly skipped jobs. Report publication +can succeed while reporting failed tests; the producer and `CI complete` remain +failed. Require `CI complete` for merging instead of treating the reporting +workflow as the overall CI verdict. + Pull requests, merge queues and main-branch pushes run the shared language checks and repository linter. A weekly run detects newly disclosed dependency vulnerabilities. Shared CI reports consolidate native reports after the producer jobs finish; producer From bd968363e55522dc7f218d713e1f6961d83e63a7 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 18:06:46 +0100 Subject: [PATCH 13/35] ci: validate the final shared reporting contract --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 83dee0b..173790c 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@ea195d7103a4269e4fa8dc5b1c8ae8debab325a6 # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@37b2f0252f62b352ca7423a31c1f8cef80eab1fb # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From 93942b79b6516d7751cb07da0fbf0ea1fa4384ed Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 09:46:41 +0100 Subject: [PATCH 14/35] fix(ci): adopt external coverage comment ownership --- .github/workflows/__shared-ci.yml | 6 +++--- docs/development/README.md | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 173790c..492bef7 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/docs/development/README.md b/docs/development/README.md index 804b488..8728fb6 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -71,8 +71,9 @@ shared Go action retains the native coverage profile and validates source paths. One terminal `reports` job waits for all code, container and Helm checks. It publishes annotations and a consolidated summary with expandable details. -Coverage uses GitHub Code Quality when available, otherwise the pull request -comment, and is also submitted to Coveralls. Native Go coverage is shown as +Coverage uses GitHub Code Quality when available and is also submitted to +Coveralls. Coveralls owns coverage comments; Common retains coverage in the +summary when GitHub Code Quality is unavailable. Native Go coverage is shown as statement coverage; a normalized LCOV projection supplies Coveralls without changing the retained profile. From 795d06223a2bf31437a16f0b5d64cb6ceb6bc643 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 11:12:15 +0100 Subject: [PATCH 15/35] ci: adopt actionable reports and stable coverage project flags --- .github/workflows/__shared-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 492bef7..f2e8258 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From eca1f9e3ef49e425ec5cbafa13c30fb44d784855 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 11:21:56 +0100 Subject: [PATCH 16/35] ci: update validated reporting implementation --- .github/workflows/__shared-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index f2e8258..91c7638 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From 1e383cf0944519a5e6dc544898f8017e9c3bfd87 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 19:21:30 +0100 Subject: [PATCH 17/35] ci: use the corrected Common reporting actions --- .github/workflows/__shared-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 91c7638..a9a0fc4 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From a0bbdde8bfe2f88188a96249434307976e4e909f Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 20:47:34 +0100 Subject: [PATCH 18/35] ci: use bundled Node.js coverage conversion --- .github/workflows/__shared-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index a9a0fc4..d309459 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From 22b10b3f2b672dee5e0c228d9373e67d27d777ca Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 12:14:40 +0100 Subject: [PATCH 19/35] ci: validate composed report actions --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index d309459..eee7d5f 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@37b2f0252f62b352ca7423a31c1f8cef80eab1fb # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@34e09a186a6f8c40c0c3da55649f21deed16acd3 # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From e543b2447afb607d456e7f47168c4e940d906a7c Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 13:44:57 +0100 Subject: [PATCH 20/35] refactor(ci): use dedicated report publication workflow --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index eee7d5f..88f8146 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@34e09a186a6f8c40c0c3da55649f21deed16acd3 # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@653d1d7ed61df3481712ade5a779c7bbc3ba1d09 # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From afee8581ab53276432ad80f131545b6c86574820 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 14:02:20 +0100 Subject: [PATCH 21/35] refactor(ci): use dedicated report publication workflow --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 88f8146..21598ae 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@653d1d7ed61df3481712ade5a779c7bbc3ba1d09 # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@b361a0ee4e306bfb8e0f903645b6e437468fcd01 # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From f05b3ccd778f69a691a4e61b0c1b51325b2c4ff1 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 17:17:17 +0100 Subject: [PATCH 22/35] ci: adopt upstream-based report preparation and publication --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 21598ae..8a3950b 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@b361a0ee4e306bfb8e0f903645b6e437468fcd01 # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@4fab364ace884571012b31473f30adc9a34daaf9 # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From eaccb3d562c6f3d85230ff819a8871fd7d95e1ab Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 18:32:19 +0100 Subject: [PATCH 23/35] fix(ci): validate reporting with final provider candidates --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 8a3950b..a4ec2b2 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@4fab364ace884571012b31473f30adc9a34daaf9 # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@aed4177da04b4d2b6b28f0db54b561b2b15fca4b # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From f4aebdf5d222a0ff95c1175d80c7cb0200f32a2d Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 18:58:01 +0100 Subject: [PATCH 24/35] fix(reports): adopt file-safe coverage and bounded publication --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index a4ec2b2..de281b0 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@aed4177da04b4d2b6b28f0db54b561b2b15fca4b # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@f895bd98053ae246e41729fec2eb99fd002e99ea # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From 5044f4147583af33903331c91d8b3f35029f8932 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 19:27:51 +0100 Subject: [PATCH 25/35] fix(reports): update common reporting dependency --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index de281b0..955e710 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@f895bd98053ae246e41729fec2eb99fd002e99ea # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@8a5c7d1d4e0e0c0407bb2c4c77556bb803d0dcd7 # PR #14 (unreleased) permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) permissions: actions: read contents: read @@ -180,6 +180,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} From aa81f5f161149747bc6cac63f15cb64cc7113dd5 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 1 Dec 2026 09:26:52 +0100 Subject: [PATCH 26/35] refactor(ci): call shared completion workflow --- .github/workflows/__shared-ci.yml | 9 +++------ docs/development/README.md | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 955e710..563ab57 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -176,10 +176,7 @@ jobs: - test-image - chart-testing - reports - runs-on: ubuntu-latest - timeout-minutes: 5 + uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@cb86863a77462f8837b38ad542b49ab36a825a85 # PR #683 (unreleased) permissions: {} - steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) - with: - job-results: ${{ toJSON(needs) }} + with: + job-results: ${{ toJSON(needs) }} diff --git a/docs/development/README.md b/docs/development/README.md index 8728fb6..0fb67e0 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -38,7 +38,7 @@ Go CI still uses the project toolchain. The separate `CI complete` job waits for every required CI job and reporting. It fails on failed, cancelled or unexpectedly skipped jobs. Report publication can succeed while reporting failed tests; the producer and `CI complete` remain -failed. Require `CI complete` for merging instead of treating the reporting +failed. Require the resulting `CI complete / Check jobs` check for merging instead of treating the reporting workflow as the overall CI verdict. Pull requests, merge queues and main-branch pushes run the shared language checks From 74b02c115b49549ccf55e7b53daa6dfaeedf1a46 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Wed, 2 Dec 2026 17:41:22 +0100 Subject: [PATCH 27/35] ci: refresh unified reporting provider candidates --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 563ab57..bb7d028 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@438cd28e5a79d5f7c49a54675f34df175b96f5c2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@8a5c7d1d4e0e0c0407bb2c4c77556bb803d0dcd7 # PR #14 (unreleased) + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@67bdab4a232e14f8a45c5a0fc4f96048235b6290 # PR #14 permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@438cd28e5a79d5f7c49a54675f34df175b96f5c2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -176,7 +176,7 @@ jobs: - test-image - chart-testing - reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@cb86863a77462f8837b38ad542b49ab36a825a85 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@438cd28e5a79d5f7c49a54675f34df175b96f5c2 # PR #683 (unreleased) permissions: {} with: job-results: ${{ toJSON(needs) }} From 18bcb6db114d55c66cd502e7f5e124ae584a00af Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Wed, 2 Dec 2026 23:35:43 +0100 Subject: [PATCH 28/35] fix(ci): consume native Go coverage discovery correction --- .github/workflows/__shared-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index bb7d028..775d57a 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@438cd28e5a79d5f7c49a54675f34df175b96f5c2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@d2ffd56d454d76f14fef75ec9a3feeb0fb94843e # PR #683 (unreleased) permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@67bdab4a232e14f8a45c5a0fc4f96048235b6290 # PR #14 + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@4f63506f8e05ade7be4323af71d09562b1e46cba # PR #14 permissions: actions: read contents: read @@ -152,7 +152,7 @@ jobs: reports: if: always() needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@438cd28e5a79d5f7c49a54675f34df175b96f5c2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@d2ffd56d454d76f14fef75ec9a3feeb0fb94843e # PR #683 (unreleased) permissions: actions: read contents: read @@ -176,7 +176,7 @@ jobs: - test-image - chart-testing - reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@438cd28e5a79d5f7c49a54675f34df175b96f5c2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@d2ffd56d454d76f14fef75ec9a3feeb0fb94843e # PR #683 (unreleased) permissions: {} with: job-results: ${{ toJSON(needs) }} From fe2d5f420abc19dbaaab74f03bd05531fb435599 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 3 Dec 2026 10:14:10 +0100 Subject: [PATCH 29/35] ci: group checks behind one completion gate --- .github/workflows/__checks.yml | 150 ++++++++++++++++++++++++++++++ .github/workflows/__shared-ci.yml | 143 +++------------------------- docs/development/README.md | 4 +- 3 files changed, 164 insertions(+), 133 deletions(-) create mode 100644 .github/workflows/__checks.yml diff --git a/.github/workflows/__checks.yml b/.github/workflows/__checks.yml new file mode 100644 index 0000000..ef8294b --- /dev/null +++ b/.github/workflows/__checks.yml @@ -0,0 +1,150 @@ +--- +name: Internal - CI checks + +on: + workflow_call: + inputs: + candidate-images: + description: Build temporary candidate images for release validation + type: boolean + default: false + outputs: + chart-helm-set: + description: Installation overrides for the validated immutable image + value: ${{ jobs.test-image.outputs.helm-set }} + job-results: + description: Build and validation results for promotion + value: ${{ toJSON(jobs) }} + +permissions: {} + +jobs: + lint: + name: Repository quality + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a4afe51a04cd4fcb7189f0f6e91ec479649af06f # PR #683 (unreleased) + permissions: + actions: read + contents: read + issues: write + packages: read + pull-requests: write + security-events: write + statuses: write + with: + # Keep the repository-managed CodeQL default setup for Go. + codeql-languages: "" + lint-all: true + # GO_MODULES runs the full linter recursively; standalone-file mode cannot span packages. + linter-env: | + VALIDATE_GO=false + GOTOOLCHAIN=local + IGNORE_GITIGNORED_FILES=true + LOG_LEVEL=INFO + + test: + name: Go checks and coverage + # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@4f63506f8e05ade7be4323af71d09562b1e46cba # PR #14 + permissions: + actions: read + contents: read + id-token: write + with: + go-versions: '["1.26", "1.27"]' + + chart-testing: + name: Test chart with the validated image + needs: [docker-build-images, test-image] + uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-ci.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 + permissions: + contents: read + packages: read + with: + path: helm/chart + config: ct.yaml + images: ${{ needs.docker-build-images.outputs.built-images }} + helm-set: ${{ needs.test-image.outputs.helm-set }} + + docker-build-images: + name: "Docker: Build Images" + needs: [lint, test] + uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 + permissions: + attestations: write + actions: read + contents: read + id-token: write + issues: read + packages: write + pull-requests: read + secrets: + oci-registry-password: ${{ secrets.GITHUB_TOKEN }} + with: + candidate: ${{ inputs.candidate-images }} + images: | + [{ + "name": "app", + "dockerfile": "./Dockerfile", + "platforms": [ + "linux/amd64", + "linux/arm64" + ] + }] + test-image: + name: Test container authentication + needs: docker-build-images + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + outputs: + validated-images: ${{ needs.docker-build-images.outputs.built-images }} + helm-set: ${{ steps.image.outputs.helm-set }} + steps: + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Check allowed and rejected requests against the built digest + env: + IMAGE: ${{ fromJSON(needs.docker-build-images.outputs.built-images).app.images[0] }} + run: | + container=$(docker run -d --rm --read-only --cap-drop ALL --security-opt no-new-privileges \ + --health-interval 1s -p 127.0.0.1::8080 -e HEADER=X-Test-Token -e VALUE=ci-test-value "$IMAGE") + trap 'docker rm -f "$container" >/dev/null' EXIT + port=$(docker port "$container" 8080/tcp | cut -d: -f2) + url="http://127.0.0.1:$port" + curl --fail --retry 15 --retry-connrefused --retry-delay 1 "$url/health" + test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: ci-test-value' "$url/check")" = 200 # gitleaks:allow - test token + test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: wrong-value' "$url/check")" = 403 # gitleaks:allow - invalid test token + test "$(curl -s -o /dev/null -w '%{http_code}' "$url/check")" = 403 + test "$(docker exec "$container" id -u)" = 10001 + for _ in {1..15}; do + if test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy; then + break + fi + sleep 1 + done + test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy + + - name: Map the validated digest into chart values + id: image + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + BUILT_IMAGES: ${{ needs.docker-build-images.outputs.built-images }} + with: + script: | + const { images, digest } = JSON.parse(process.env.BUILT_IMAGES).app; + const reference = images[0].split('@')[0]; + const separator = reference.lastIndexOf(':'); + if (separator <= reference.lastIndexOf('/') || !/^sha256:[a-f0-9]{64}$/.test(digest)) { + throw new Error('Expected a tagged image with an immutable digest'); + } + core.setOutput('helm-set', [ + 'securityHeader.value=ci-test-value', + `image.repository=${reference.slice(0, separator)}`, + `image.tag=${reference.slice(separator + 1)}@${digest}`, + 'imagePullSecrets[0].name=regcred', + ].join('\n')); diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 775d57a..9119190 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -11,148 +11,32 @@ on: outputs: chart-helm-set: description: Installation overrides for the validated immutable image - value: ${{ jobs.test-image.outputs.helm-set }} + value: ${{ jobs.checks.outputs.chart-helm-set }} job-results: description: Build and validation results for promotion - value: ${{ toJSON(jobs) }} + value: ${{ jobs.checks.outputs.job-results }} permissions: {} jobs: - lint: - name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@d2ffd56d454d76f14fef75ec9a3feeb0fb94843e # PR #683 (unreleased) + checks: + uses: $/.github/workflows/__checks.yml permissions: actions: read contents: read issues: write - packages: read + packages: write pull-requests: write security-events: write statuses: write - with: - # Keep the repository-managed CodeQL default setup for Go. - codeql-languages: "" - lint-all: true - # GO_MODULES runs the full linter recursively; standalone-file mode cannot span packages. - linter-env: | - VALIDATE_GO=false - GOTOOLCHAIN=local - IGNORE_GITIGNORED_FILES=true - LOG_LEVEL=INFO - - test: - name: Go checks and coverage - # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@4f63506f8e05ade7be4323af71d09562b1e46cba # PR #14 - permissions: - actions: read - contents: read id-token: write - with: - go-versions: '["1.26", "1.27"]' - - chart-testing: - name: Test chart with the validated image - needs: [docker-build-images, test-image] - uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-ci.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 - permissions: - contents: read - packages: read - with: - path: helm/chart - config: ct.yaml - images: ${{ needs.docker-build-images.outputs.built-images }} - helm-set: ${{ needs.test-image.outputs.helm-set }} - - docker-build-images: - name: "Docker: Build Images" - needs: [lint, test] - uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 - permissions: attestations: write - actions: read - contents: read - id-token: write - issues: read - packages: write - pull-requests: read - secrets: - oci-registry-password: ${{ secrets.GITHUB_TOKEN }} with: - candidate: ${{ inputs.candidate-images }} - images: | - [{ - "name": "app", - "dockerfile": "./Dockerfile", - "platforms": [ - "linux/amd64", - "linux/arm64" - ] - }] - test-image: - name: Test container authentication - needs: docker-build-images - runs-on: ubuntu-latest - permissions: - contents: read - packages: read - outputs: - validated-images: ${{ needs.docker-build-images.outputs.built-images }} - helm-set: ${{ steps.image.outputs.helm-set }} - steps: - - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - - name: Check allowed and rejected requests against the built digest - env: - IMAGE: ${{ fromJSON(needs.docker-build-images.outputs.built-images).app.images[0] }} - run: | - container=$(docker run -d --rm --read-only --cap-drop ALL --security-opt no-new-privileges \ - --health-interval 1s -p 127.0.0.1::8080 -e HEADER=X-Test-Token -e VALUE=ci-test-value "$IMAGE") - trap 'docker rm -f "$container" >/dev/null' EXIT - port=$(docker port "$container" 8080/tcp | cut -d: -f2) - url="http://127.0.0.1:$port" - curl --fail --retry 15 --retry-connrefused --retry-delay 1 "$url/health" - test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: ci-test-value' "$url/check")" = 200 # gitleaks:allow - test token - test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: wrong-value' "$url/check")" = 403 # gitleaks:allow - invalid test token - test "$(curl -s -o /dev/null -w '%{http_code}' "$url/check")" = 403 - test "$(docker exec "$container" id -u)" = 10001 - for _ in {1..15}; do - if test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy; then - break - fi - sleep 1 - done - test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy - - - name: Map the validated digest into chart values - id: image - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - BUILT_IMAGES: ${{ needs.docker-build-images.outputs.built-images }} - with: - script: | - const { images, digest } = JSON.parse(process.env.BUILT_IMAGES).app; - const reference = images[0].split('@')[0]; - const separator = reference.lastIndexOf(':'); - if (separator <= reference.lastIndexOf('/') || !/^sha256:[a-f0-9]{64}$/.test(digest)) { - throw new Error('Expected a tagged image with an immutable digest'); - } - core.setOutput('helm-set', [ - 'securityHeader.value=ci-test-value', - `image.repository=${reference.slice(0, separator)}`, - `image.tag=${reference.slice(separator + 1)}@${digest}`, - 'imagePullSecrets[0].name=regcred', - ].join('\n')); - + candidate-images: ${{ inputs.candidate-images }} reports: if: always() - needs: [lint, test, docker-build-images, test-image, chart-testing] - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@d2ffd56d454d76f14fef75ec9a3feeb0fb94843e # PR #683 (unreleased) + needs: checks + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@a4afe51a04cd4fcb7189f0f6e91ec479649af06f # PR #683 (unreleased) permissions: actions: read contents: read @@ -161,22 +45,17 @@ jobs: id-token: write security-events: write with: - job-results: ${{ toJSON(needs) }} + job-results: ${{ needs.checks.outputs.job-results || toJSON(needs) }} test-coverage-reporters: | auto coveralls - complete: name: CI complete if: always() needs: - - lint - - test - - docker-build-images - - test-image - - chart-testing + - checks - reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@d2ffd56d454d76f14fef75ec9a3feeb0fb94843e # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@a4afe51a04cd4fcb7189f0f6e91ec479649af06f # PR #683 (unreleased) permissions: {} with: job-results: ${{ toJSON(needs) }} diff --git a/docs/development/README.md b/docs/development/README.md index 0fb67e0..cabe137 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -35,7 +35,9 @@ Go CI still uses the project toolchain. ## Continuous integration -The separate `CI complete` job waits for every required CI job and reporting. +The separate `CI complete` job depends on `checks` and `reports`. Add new jobs to +[the checks group](../../.github/workflows/__checks.yml); GitHub exports their +results automatically, so publication and gate dependencies stay unchanged. It fails on failed, cancelled or unexpectedly skipped jobs. Report publication can succeed while reporting failed tests; the producer and `CI complete` remain failed. Require the resulting `CI complete / Check jobs` check for merging instead of treating the reporting From 705b0105fe3e0615aa1cba81fb3572ab4520203e Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 3 Dec 2026 12:13:53 +0100 Subject: [PATCH 30/35] ci: show the repository linter summary only in CI reports --- .github/workflows/__checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/__checks.yml b/.github/workflows/__checks.yml index ef8294b..6cc0cc2 100644 --- a/.github/workflows/__checks.yml +++ b/.github/workflows/__checks.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a4afe51a04cd4fcb7189f0f6e91ec479649af06f # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@cc9b360c9d6fc794dcc1797d4358e16b3f6b5e0b # PR #683 (unreleased) permissions: actions: read contents: read From f068d8bac3fdc69ddecd08e1740c0099d6271f27 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 3 Dec 2026 14:13:39 +0100 Subject: [PATCH 31/35] ci: adopt separate test and lint report comments --- .github/workflows/__shared-ci.yml | 2 +- docs/development/README.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 9119190..b908c88 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -36,7 +36,7 @@ jobs: reports: if: always() needs: checks - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@a4afe51a04cd4fcb7189f0f6e91ec479649af06f # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@a57403ecded4ed077dc24a6574953f7c46e69224 # PR #683 (unreleased) permissions: actions: read contents: read diff --git a/docs/development/README.md b/docs/development/README.md index cabe137..a562bcc 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -74,10 +74,10 @@ shared Go action retains the native coverage profile and validates source paths. One terminal `reports` job waits for all code, container and Helm checks. It publishes annotations and a consolidated summary with expandable details. Coverage uses GitHub Code Quality when available and is also submitted to -Coveralls. Coveralls owns coverage comments; Common retains coverage in the -summary when GitHub Code Quality is unavailable. Native Go coverage is shown as -statement coverage; a normalized LCOV projection supplies Coveralls without -changing the retained profile. +Coveralls. Coveralls keeps its coverage comment. Common publishes a separate PR +overview for test and lint results, with failures visible and successful checks +collapsed, and retains coverage in the Actions summary. The summary labels its +normalized line coverage separately from the native Go statement coverage. Helm validation and publication use the dedicated container workflows. The Harbor robot username and password From 291cb6aac136b929a800b556bc82c34fc7c7c227 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 3 Dec 2026 14:57:06 +0100 Subject: [PATCH 32/35] ci: display lint before tests in reports --- .github/workflows/__shared-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index b908c88..fbf4cf3 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -36,7 +36,7 @@ jobs: reports: if: always() needs: checks - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@a57403ecded4ed077dc24a6574953f7c46e69224 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0ad84c70926a266244e95a652034fb098a4d5399 # PR #683 (unreleased) permissions: actions: read contents: read From 690939e42b72e2330ec93ab51c5cd5aa9b32af6a Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Fri, 4 Dec 2026 14:44:17 +0100 Subject: [PATCH 33/35] ci: refresh reporting providers after Common 5.0.0 --- .github/workflows/__checks.yml | 4 ++-- .github/workflows/__shared-ci.yml | 4 ++-- .github/workflows/semantic-pull-request.yml | 2 +- .github/workflows/stale.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/__checks.yml b/.github/workflows/__checks.yml index 6cc0cc2..718d95f 100644 --- a/.github/workflows/__checks.yml +++ b/.github/workflows/__checks.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@cc9b360c9d6fc794dcc1797d4358e16b3f6b5e0b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: test: name: Go checks and coverage # TODO: Replace this candidate pin with a released SHA after https://github.com/hoverkraft-tech/ci-github-go/pull/14 - uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@4f63506f8e05ade7be4323af71d09562b1e46cba # PR #14 + uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@388094568fd032e8745c061821d3f94ff9f791ad # PR #14 (unreleased) permissions: actions: read contents: read diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index fbf4cf3..3311fcc 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -36,7 +36,7 @@ jobs: reports: if: always() needs: checks - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0ad84c70926a266244e95a652034fb098a4d5399 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: actions: read contents: read @@ -55,7 +55,7 @@ jobs: needs: - checks - reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@a4afe51a04cd4fcb7189f0f6e91ec479649af06f # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: {} with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index a58a750..7f79d25 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -9,6 +9,6 @@ permissions: {} jobs: title: - uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 + uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: contents: read diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b982da1..2f4b986 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -12,4 +12,4 @@ jobs: permissions: issues: write pull-requests: write - uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 + uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 From 82670c06f2620da4a5bd71b7f134267373fbfda4 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Fri, 4 Dec 2026 18:28:58 +0100 Subject: [PATCH 34/35] refactor(ci): validate production images with the shared Goss action --- .github/linters/Dockerfile | 10 +--- .github/workflows/__checks.yml | 87 +++++++++++++---------------- Makefile | 37 +++++++++++- docs/development/README.md | 28 +++++++--- tests/container-image/check-http.sh | 26 +++++++++ tests/container-image/docker-args | 4 ++ tests/container-image/goss.yaml | 10 ++++ tests/container-image/http.yaml | 16 ++++++ 8 files changed, 151 insertions(+), 67 deletions(-) create mode 100755 tests/container-image/check-http.sh create mode 100644 tests/container-image/docker-args create mode 100644 tests/container-image/goss.yaml create mode 100644 tests/container-image/http.yaml diff --git a/.github/linters/Dockerfile b/.github/linters/Dockerfile index 4cb3f77..e7515af 100644 --- a/.github/linters/Dockerfile +++ b/.github/linters/Dockerfile @@ -1,13 +1,7 @@ -FROM ghcr.io/hoverkraft-tech/docker-base-images/super-linter:2.0.2@sha256:12dedee667b43856a9cc792628fecc4723fc0868bf8090d268981407a7402b2c +# TODO: pin the release of https://github.com/hoverkraft-tech/docker-base-images/pull/310. +FROM ghcr.io/hoverkraft-tech/docker-base-images/super-linter:pr-310-b5fda05@sha256:c78bd0f4672ce61fc393d4081d15dcf41002d9b4455e35723c1644c007da522b ARG UID=1000 ARG GID=1000 USER ${UID}:${GID} HEALTHCHECK --interval=5m --timeout=10s --start-period=30s --retries=3 CMD ["/bin/sh", "-c", "test -d /github/home"] - -# Lint every Go package with GO_MODULES; standalone-file mode cannot span packages. -# Use the Go compiler bundled with golangci-lint to keep export-data formats compatible. -ENV VALIDATE_GO=false \ - GOTOOLCHAIN=local \ - LOG_LEVEL=INFO \ - IGNORE_GITIGNORED_FILES=true diff --git a/.github/workflows/__checks.yml b/.github/workflows/__checks.yml index 718d95f..c3fad52 100644 --- a/.github/workflows/__checks.yml +++ b/.github/workflows/__checks.yml @@ -21,7 +21,7 @@ permissions: {} jobs: lint: name: Repository quality - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@68fd463bb94cf9f7dc1db68d190cf57af3dfa8ca # PR #700 (unreleased) permissions: actions: read contents: read @@ -33,13 +33,8 @@ jobs: with: # Keep the repository-managed CodeQL default setup for Go. codeql-languages: "" + # This small repository validates all files, including cross-file configuration. lint-all: true - # GO_MODULES runs the full linter recursively; standalone-file mode cannot span packages. - linter-env: | - VALIDATE_GO=false - GOTOOLCHAIN=local - IGNORE_GITIGNORED_FILES=true - LOG_LEVEL=INFO test: name: Go checks and coverage @@ -49,21 +44,6 @@ jobs: actions: read contents: read id-token: write - with: - go-versions: '["1.26", "1.27"]' - - chart-testing: - name: Test chart with the validated image - needs: [docker-build-images, test-image] - uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-ci.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 - permissions: - contents: read - packages: read - with: - path: helm/chart - config: ct.yaml - images: ${{ needs.docker-build-images.outputs.built-images }} - helm-set: ${{ needs.test-image.outputs.helm-set }} docker-build-images: name: "Docker: Build Images" @@ -91,43 +71,39 @@ jobs: ] }] test-image: + strategy: + fail-fast: false + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-latest + - platform: linux/arm64 + runner: ubuntu-24.04-arm name: Test container authentication needs: docker-build-images - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} permissions: + actions: read contents: read packages: read outputs: validated-images: ${{ needs.docker-build-images.outputs.built-images }} helm-set: ${{ steps.image.outputs.helm-set }} steps: - - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - - name: Check allowed and rejected requests against the built digest - env: - IMAGE: ${{ fromJSON(needs.docker-build-images.outputs.built-images).app.images[0] }} - run: | - container=$(docker run -d --rm --read-only --cap-drop ALL --security-opt no-new-privileges \ - --health-interval 1s -p 127.0.0.1::8080 -e HEADER=X-Test-Token -e VALUE=ci-test-value "$IMAGE") - trap 'docker rm -f "$container" >/dev/null' EXIT - port=$(docker port "$container" 8080/tcp | cut -d: -f2) - url="http://127.0.0.1:$port" - curl --fail --retry 15 --retry-connrefused --retry-delay 1 "$url/health" - test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: ci-test-value' "$url/check")" = 200 # gitleaks:allow - test token - test "$(curl -s -o /dev/null -w '%{http_code}' -H 'X-Test-Token: wrong-value' "$url/check")" = 403 # gitleaks:allow - invalid test token - test "$(curl -s -o /dev/null -w '%{http_code}' "$url/check")" = 403 - test "$(docker exec "$container" id -u)" = 10001 - for _ in {1..15}; do - if test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy; then - break - fi - sleep 1 - done - test "$(docker inspect --format '{{.State.Health.Status}}' "$container")" = healthy + persist-credentials: false + - uses: hoverkraft-tech/ci-github-container/actions/docker/setup@3a669abdd308f05e7f43e16b57f0d40bed555969 # PR #1003 (unreleased) + with: + setup-buildx: "false" + oci-registry-username: ${{ github.actor }} + oci-registry-password: ${{ github.token }} + - name: Test the production image on each published platform + uses: hoverkraft-tech/ci-github-container/actions/docker/test-image@3a669abdd308f05e7f43e16b57f0d40bed555969 # PR #1003 (unreleased) + with: + image: ${{ fromJSON(needs.docker-build-images.outputs.built-images).app.images[0] }} + working-directory: tests/container-image + platform: ${{ matrix.platform }} - name: Map the validated digest into chart values id: image @@ -148,3 +124,16 @@ jobs: `image.tag=${reference.slice(separator + 1)}@${digest}`, 'imagePullSecrets[0].name=regcred', ].join('\n')); + + chart-testing: + name: Test chart with the validated image + needs: [docker-build-images, test-image] + uses: hoverkraft-tech/ci-github-container/.github/workflows/helm-chart-ci.yml@a5dc1ea7c1f4c2dffc3267c5be7304d01284f2ec # 4.2.1 + permissions: + contents: read + packages: read + with: + path: helm/chart + config: ct.yaml + images: ${{ needs.docker-build-images.outputs.built-images }} + helm-set: ${{ needs.test-image.outputs.helm-set }} diff --git a/Makefile b/Makefile index c422fe7..4821bf4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ .DEFAULT_GOAL := help -.PHONY: help setup lint lint-code lint-repository lint-fix test audit build ci +.PHONY: help setup lint lint-code lint-repository lint-fix test audit build docker-build test-image ci LINTER_IMAGE := http-header-authenticator-linter:local +IMAGE := http-header-authenticator:local +# Match the shared docker/test-image action's Goss toolchain. +GOSS_IMAGE := ghcr.io/goss-org/goss:v0.4.10@sha256:8d3924f722a04a660e9e6c2403be0399d737c0187fc065714d26b992286c3f0a help: ## Show development commands @awk 'BEGIN {FS = ":.*## "} /^[a-zA-Z_-]+:.*## / {printf "%-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -24,6 +27,38 @@ audit: ## Audit Go dependencies and the standard library build: ## Build the application without publishing go build -mod=readonly -trimpath -o bin/http-header-authenticator ./src/github.com/hoverkraft-tech/http-header-authenticator +docker-build: ## Build the production image without publishing + docker build --tag "$(IMAGE)" . + +test-image: docker-build ## Build and test the production image with the CI suite + @set -eu; \ + image_id=$$(docker image inspect --format '{{.Id}}' "$(IMAGE)"); \ + platform=$$(docker image inspect --format '{{.Os}}/{{.Architecture}}' "$$image_id"); \ + socket=$$(docker context inspect --format '{{.Endpoints.docker.Host}}'); \ + if [ -n "$${DOCKER_HOST:-}" ] && [ -z "$${DOCKER_CONTEXT:-}" ]; then socket=$$DOCKER_HOST; fi; \ + case "$$socket" in unix://*) socket=$${socket#unix://} ;; *) echo 'Image tests require a local Unix Docker socket.' >&2; exit 1 ;; esac; \ + test -S "$$socket"; \ + mkdir -p .cache/container-tests; \ + rm -f .cache/container-tests/junit.xml; \ + tools=$$(mktemp -d "$(CURDIR)/.cache/container-tests/tools.XXXXXX"); \ + tool_container=; test_container=; \ + trap 'if [ -n "$$test_container" ]; then docker rm --force --volumes "$$test_container" >/dev/null; fi; if [ -n "$$tool_container" ]; then docker rm --force --volumes "$$tool_container" >/dev/null; fi; rm -rf "$$tools"' EXIT; \ + trap 'exit 130' INT; trap 'exit 143' TERM; \ + tool_container=$$(docker create --platform "$$platform" "$(GOSS_IMAGE)" /bin/true); \ + docker cp "$$tool_container:/usr/bin/goss" "$$tools/goss"; \ + chmod 755 "$$tools/goss"; \ + set --; \ + while IFS= read -r option || [ -n "$$option" ]; do \ + case "$$option" in ''|'#'*) continue ;; esac; \ + set -- "$$@" "$$option"; \ + done < tests/container-image/docker-args; \ + test_container=$$(docker create "$$@" --platform "$$platform" \ + --volume "$$tools/goss:/goss-bin:ro" \ + --volume "$(CURDIR)/tests/container-image:/goss:ro" \ + --entrypoint /goss-bin "$$image_id" -g /goss/goss.yaml validate --format junit); \ + echo 'Running image checks; JUnit report: .cache/container-tests/junit.xml'; \ + timeout --kill-after=5s 300s docker start --attach "$$test_container" > .cache/container-tests/junit.xml + lint-fix: ## Apply Go and repository formatting fixes go fmt ./... golangci-lint run --fix --timeout=5m diff --git a/docs/development/README.md b/docs/development/README.md index a562bcc..414467e 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -12,15 +12,16 @@ Use the supported Go toolchain and golangci-lint declared in the devcontainer. ` ## Commands -| Command | Purpose | -| --------------- | ------------------------------------------------- | -| `make setup` | Install or verify dependencies | -| `make lint` | Check application code and repository files | -| `make lint-fix` | Apply supported formatting fixes | -| `make test` | Run tests and collect coverage | -| `make audit` | Check production dependencies for vulnerabilities | -| `make build` | Build locally without publishing | -| `make ci` | Run the complete local validation sequence | +| Command | Purpose | +| ----------------- | ---------------------------------------------------------- | +| `make setup` | Install or verify dependencies | +| `make lint` | Check application code and repository files | +| `make lint-fix` | Apply supported formatting fixes | +| `make test-image` | Build and test the production image with the CI Goss suite | +| `make test` | Run tests and collect coverage | +| `make audit` | Check production dependencies for vulnerabilities | +| `make build` | Build locally without publishing | +| `make ci` | Run the complete local validation sequence | `make lint-repository` uses the same pinned Hoverkraft Super-Linter image and tool configuration as CI, without a repository validator allowlist. It checks @@ -109,3 +110,12 @@ The existing GitHub CodeQL default setup continues to scan Go. The shared linter disables its additional CodeQL job because GitHub rejects advanced-setup results while default setup is enabled. Actionlint, Zizmor and Checkov still check workflow correctness and security. + +### Container checks + +`make test-image` and CI use `tests/container-image/goss.yaml` and the same runtime +restrictions from `docker-args`. The suite starts the real entrypoint, checks the +health probe, accepts the configured header and rejects wrong or missing values. +It runs as the production user with a read-only root filesystem, no Linux +capabilities and no privilege escalation. CI repeats this suite on native amd64 +and arm64 runners before chart testing and image promotion. diff --git a/tests/container-image/check-http.sh b/tests/container-image/check-http.sh new file mode 100755 index 0000000..55de720 --- /dev/null +++ b/tests/container-image/check-http.sh @@ -0,0 +1,26 @@ +#!/bin/sh +set -eu + +work="$(mktemp -d)" +service_pid= +cleanup() { + status=$? + trap - EXIT + if [ -n "$service_pid" ]; then + kill "$service_pid" 2>/dev/null || true + wait "$service_pid" 2>/dev/null || true + fi + if [ "$status" -ne 0 ]; then cat "$work/service.log" >&2; fi + rm -rf "$work" + exit "$status" +} +trap cleanup EXIT +trap 'exit 130' INT +trap 'exit 143' TERM + +# Goss checks run concurrently, so startup and HTTP assertions share one lifecycle. +HEADER=X-Test-Token VALUE=ci-test-value /entrypoint.sh >"$work/service.log" 2>&1 & +service_pid=$! +/goss-bin -g /goss/http.yaml validate --retry-timeout 15s --sleep 1s --format documentation +# Exercise the same probe used by the image's Docker HEALTHCHECK. +wget -q --spider http://127.0.0.1:8080/health diff --git a/tests/container-image/docker-args b/tests/container-image/docker-args new file mode 100644 index 0000000..4d41d1a --- /dev/null +++ b/tests/container-image/docker-args @@ -0,0 +1,4 @@ +--read-only +--cap-drop=ALL +--security-opt=no-new-privileges +--tmpfs=/tmp:uid=10001,gid=10001,mode=0700 diff --git a/tests/container-image/goss.yaml b/tests/container-image/goss.yaml new file mode 100644 index 0000000..ba2ece8 --- /dev/null +++ b/tests/container-image/goss.yaml @@ -0,0 +1,10 @@ +--- +command: + application-user: + exec: id -u + exit-status: 0 + stdout: ["10001"] + authentication: + exec: sh /goss/check-http.sh + exit-status: 0 + timeout: 25000 diff --git a/tests/container-image/http.yaml b/tests/container-image/http.yaml new file mode 100644 index 0000000..ef33997 --- /dev/null +++ b/tests/container-image/http.yaml @@ -0,0 +1,16 @@ +--- +http: + health: + url: http://127.0.0.1:8080/health + status: 200 + accepted-header: + url: http://127.0.0.1:8080/check + request-headers: ["X-Test-Token: ci-test-value"] # gitleaks:allow - test token + status: 200 + wrong-header: + url: http://127.0.0.1:8080/check + request-headers: ["X-Test-Token: wrong-value"] # gitleaks:allow - invalid test token + status: 403 + missing-header: + url: http://127.0.0.1:8080/check + status: 403 From baf1480fd9d0d7ec4b4ccd8bf6263bc7739bf0a6 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Fri, 4 Dec 2026 19:22:51 +0100 Subject: [PATCH 35/35] fix(ci): track Goss updates and use shared lint defaults --- .github/renovate.json | 9 +++++++++ .github/workflows/__checks.yml | 2 -- docs/development/README.md | 10 +++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index bd8e923..f80a29c 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -32,6 +32,15 @@ ], "datasourceTemplate": "go", "depNameTemplate": "golang.org/x/vuln" + }, + { + "customType": "regex", + "managerFilePatterns": ["/^Makefile$/"], + "matchStrings": [ + "GOSS_IMAGE := (?[^\\s:]+):(?[^\\s@]+)@(?sha256:[a-f0-9]{64})" + ], + "datasourceTemplate": "docker", + "versioningTemplate": "docker" } ], "packageRules": [ diff --git a/.github/workflows/__checks.yml b/.github/workflows/__checks.yml index c3fad52..72f9967 100644 --- a/.github/workflows/__checks.yml +++ b/.github/workflows/__checks.yml @@ -33,8 +33,6 @@ jobs: with: # Keep the repository-managed CodeQL default setup for Go. codeql-languages: "" - # This small repository validates all files, including cross-file configuration. - lint-all: true test: name: Go checks and coverage diff --git a/docs/development/README.md b/docs/development/README.md index 414467e..f21f313 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -46,6 +46,8 @@ workflow as the overall CI verdict. Pull requests, merge queues and main-branch pushes run the shared language checks and repository linter. A weekly run detects newly disclosed dependency vulnerabilities. +Repository lint uses Common's default scope: changed files on pull requests and +all files on other triggers, matching the other consumer projects. Shared CI reports consolidate native reports after the producer jobs finish; producer failures continue to block validation. The semantic PR workflow and repository linter share [.commitlintrc.json](../../.commitlintrc.json). @@ -58,7 +60,8 @@ with the first containing release after the supporting PRs merge. Dependabot is the primary updater for Go modules, GitHub Actions, Docker images and devcontainer features, with weekly groups and a seven-day cooldown. Renovate is limited to versions outside those supported manifests: Go and -golangci-lint feature options, and the govulncheck version embedded in the Makefile. +golangci-lint feature options, and the govulncheck version and Goss image tag/digest +embedded in the Makefile. It also maintains the explicit Go `toolchain` directive and the Helm CLI in `.tool-versions`. It cannot update module dependencies or raise the minimum Go version. The scheduled [Renovate workflow](../../.github/workflows/__renovate.yml) uses @@ -68,8 +71,9 @@ Review the lockfile and run `make ci` when updating dependencies or features. ## Image and chart checks -Tests run on Go 1.26 and 1.27 with race detection and detailed JUnit results for -both runtimes. Lint, audit, build and atomic coverage run once on Go 1.27. The +Tests run once with race detection and detailed JUnit results, using the Go +toolchain declared in `go.mod`, aligned with the production Dockerfile. +Lint, audit, build and atomic coverage use the same toolchain. The shared Go action retains the native coverage profile and validates source paths. One terminal `reports` job waits for all code, container and Helm checks. It