From 9505a9d8e20e82565d17fd3ddf10e6d6053fe0c7 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Thu, 12 Nov 2026 11:52:01 +0100 Subject: [PATCH 1/2] ci: render every component on a schedule against main and the latest releases Component ranges float within their major, so a component release can break an already published agent-platform release without any agent-platform commit. A GitHub Actions workflow now runs the existing component render (verify-components-charts or, for a tag, verify-release-floors, plus verify-examples) every six hours against main and the latest patch of the last three minors, and opens one issue per failing ref. Refs giantswarm/giantswarm#39196 Signed-off-by: Marian Steinbach --- .circleci/custom.yml | 3 + .../workflows/component-render-schedule.yaml | 153 ++++++++++++++++++ README.md | 1 + docs/ci.md | 29 ++++ 4 files changed, 186 insertions(+) create mode 100644 .github/workflows/component-render-schedule.yaml create mode 100644 docs/ci.md diff --git a/.circleci/custom.yml b/.circleci/custom.yml index 16228fb4c..4952ba99d 100644 --- a/.circleci/custom.yml +++ b/.circleci/custom.yml @@ -35,6 +35,9 @@ # agent renders without skills; make verify-default-agent # simulates the step. # +# The same render on a schedule, against main and the latest releases, is the +# GitHub Actions workflow component-render-schedule (docs/ci.md). +# # The agent-platform-crds chart has been RETIRED — every component now ships # its own CRDs (app-owned CRDs), so there is no longer a CRD-bundle chart to # build/test/publish here. diff --git a/.github/workflows/component-render-schedule.yaml b/.github/workflows/component-render-schedule.yaml new file mode 100644 index 000000000..fd1e525a0 --- /dev/null +++ b/.github/workflows/component-render-schedule.yaml @@ -0,0 +1,153 @@ +# Renders every component chart with the values the meta chart forwards to it, +# against main and the latest patch of the last three minor releases, every six +# hours. A component range floats within its major, so a component release +# changes what an already published agent-platform release installs without an +# agent-platform commit; the PR and tag pipelines never see that. +# +# Each ref is judged by its own values and its own test code: main runs +# `make verify-components-charts verify-examples`, a release tag runs +# `make verify-release-floors verify-examples` (the strict run, no fallback for +# an unreleased component). A red ref opens or comments on one issue per ref, +# a green one closes it. docs/ci.md says how to respond. +name: component-render-schedule + +on: + schedule: + - cron: '23 */6 * * *' + workflow_dispatch: + inputs: + refs: + description: Refs to render, space-separated (default main and the latest patch of the last three minors) + required: false + pull_request: + paths: + - '.github/workflows/component-render-schedule.yaml' + +permissions: {} + +concurrency: + group: component-render-schedule-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + refs: + name: Pick the refs to render + runs-on: ubuntu-26.04 + permissions: + contents: read + outputs: + refs: ${{ steps.pick.outputs.refs }} + steps: + - name: main and the latest patch of the last three minors + id: pick + env: + REFS: ${{ inputs.refs }} + REPO: ${{ github.repository }} + run: | + set -euo pipefail + if [ -n "${REFS:-}" ]; then + read -r -a picked <<<"$REFS" + else + tags="$(git ls-remote --tags --refs "https://github.com/$REPO" 'v*' \ + | sed 's#.*refs/tags/##' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V)" + mapfile -t releases < <(awk -F. '{ last[$1"."$2] = $0 } END { for (m in last) print last[m] }' <<<"$tags" | sort -V | tail -n 3) + picked=(main "${releases[@]}") + fi + json="$(jq -cn '$ARGS.positional' --args "${picked[@]}")" + echo "refs=$json" >> "$GITHUB_OUTPUT" + echo "rendering: ${picked[*]}" + + render: + name: Render ${{ matrix.ref }} + needs: refs + runs-on: ubuntu-26.04 + timeout-minutes: 30 + permissions: + contents: read + issues: write + strategy: + fail-fast: false + matrix: + ref: ${{ fromJSON(needs.refs.outputs.refs) }} + steps: + - name: Check out ${{ matrix.ref }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ matrix.ref }} + persist-credentials: false + - name: Install helm + uses: giantswarm/install-binary-action@5bef88f65012037dd836117c8d344b21bb559854 # v4.1.0 + with: + binary: helm + # The pin of .circleci/custom.yml's test-ingress-modes. + version: "3.17.3" + download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" + tarball_binary_path: "linux-amd64/helm" + smoke_test: "${binary} version --short" + - name: Install PyYAML + run: | + sudo timeout 180 apt-get update -qq + sudo timeout 180 apt-get install -y -qq python3-yaml + python3 -c 'import yaml' + - name: Render every component with the forwarded values + id: render + env: + REF: ${{ matrix.ref }} + run: | + set -o pipefail + if [ "$REF" = main ]; then + targets=(verify-components-charts verify-examples) + else + targets=(verify-release-floors verify-examples) + fi + make "${targets[@]}" 2>&1 | tee "$RUNNER_TEMP/render.log" + - name: Summarize the refusal + if: failure() && steps.render.outcome == 'failure' + run: | + { + echo '```' + sed -n '/^FAIL/,$p' "$RUNNER_TEMP/render.log" | head -n 60 + echo '```' + } > "$RUNNER_TEMP/fail.md" + if [ "$(wc -l < "$RUNNER_TEMP/fail.md")" -le 2 ]; then + { echo '```'; tail -n 40 "$RUNNER_TEMP/render.log"; echo '```'; } > "$RUNNER_TEMP/fail.md" + fi + cat "$RUNNER_TEMP/fail.md" >> "$GITHUB_STEP_SUMMARY" + - name: Open, update or close the issue for ${{ matrix.ref }} + if: always() && github.event_name != 'pull_request' && (steps.render.outcome == 'success' || steps.render.outcome == 'failure') + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + REF: ${{ matrix.ref }} + OUTCOME: ${{ steps.render.outcome }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + set -euo pipefail + if [ "$REF" = main ]; then + title="agent-platform main branch chart doesn't render" + else + title="agent-platform release $REF chart doesn't render" + fi + number="$(gh issue list --state open --label team/bumblebee --search "\"$title\" in:title" \ + --json number,title --jq "map(select(.title == \"$title\"))[0].number // empty")" + if [ "$OUTCOME" = success ]; then + if [ -n "$number" ]; then + gh issue close "$number" --comment "Every component renders again on \`$REF\`: $RUN_URL" + fi + exit 0 + fi + body="$(cat <` chart doesn't render* (or *agent-platform main branch chart doesn't render*), labelled `team/bumblebee`. Later red runs comment on it, and the next green run closes it. The issue names the component, the version its range resolved to, and the refusal. + +Installations that reconcile that release into the new component version fail. Respond in one of these ways: + +- Fix the meta chart on `main`: forward values the new component accepts, or cap the range below the breaking version. Then release a patch, and when an older minor that installations still run is affected, a patch of that minor too. +- Have the component restore what it removed in a patch release, when the refusal is a breaking change inside a major. From 9fcda552e90d9ed1e38869ba5ad75da469b33a54 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Thu, 12 Nov 2026 12:02:22 +0100 Subject: [PATCH 2/2] ci: classify render failures, keep one quiet issue per ref and close issues of refs no longer rendered - open issues with the giantswarm-release App token so board workflows run and the team mention notifies (workflow token as fallback) - tell a refusal apart from a stale unreleased annotation and a check that could not finish - comment only when the failure changes, mention the team only on open - close the issue of a ref the schedule no longer renders - render the last five minors, run make -k, unbuffered output, per-event concurrency, retried apt - issue handling in its own job, the only one with issues: write Signed-off-by: Marian Steinbach --- .../workflows/component-render-schedule.yaml | 187 +++++++++++++----- docs/ci.md | 12 +- 2 files changed, 146 insertions(+), 53 deletions(-) diff --git a/.github/workflows/component-render-schedule.yaml b/.github/workflows/component-render-schedule.yaml index fd1e525a0..f64fc9fbb 100644 --- a/.github/workflows/component-render-schedule.yaml +++ b/.github/workflows/component-render-schedule.yaml @@ -1,5 +1,5 @@ # Renders every component chart with the values the meta chart forwards to it, -# against main and the latest patch of the last three minor releases, every six +# against main and the latest patch of the last five minor releases, every six # hours. A component range floats within its major, so a component release # changes what an already published agent-platform release installs without an # agent-platform commit; the PR and tag pipelines never see that. @@ -7,8 +7,8 @@ # Each ref is judged by its own values and its own test code: main runs # `make verify-components-charts verify-examples`, a release tag runs # `make verify-release-floors verify-examples` (the strict run, no fallback for -# an unreleased component). A red ref opens or comments on one issue per ref, -# a green one closes it. docs/ci.md says how to respond. +# an unreleased component). The report job keeps one issue per failing ref. +# docs/ci.md says how to respond. name: component-render-schedule on: @@ -17,7 +17,7 @@ on: workflow_dispatch: inputs: refs: - description: Refs to render, space-separated (default main and the latest patch of the last three minors) + description: Refs to render, space-separated (default main and the latest patch of the last five minors) required: false pull_request: paths: @@ -26,8 +26,11 @@ on: permissions: {} concurrency: - group: component-render-schedule-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true + group: component-render-schedule-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +env: + MINORS: 5 jobs: refs: @@ -38,7 +41,7 @@ jobs: outputs: refs: ${{ steps.pick.outputs.refs }} steps: - - name: main and the latest patch of the last three minors + - name: main and the latest patch of the last minors id: pick env: REFS: ${{ inputs.refs }} @@ -50,7 +53,7 @@ jobs: else tags="$(git ls-remote --tags --refs "https://github.com/$REPO" 'v*' \ | sed 's#.*refs/tags/##' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V)" - mapfile -t releases < <(awk -F. '{ last[$1"."$2] = $0 } END { for (m in last) print last[m] }' <<<"$tags" | sort -V | tail -n 3) + mapfile -t releases < <(awk -F. '{ last[$1"."$2] = $0 } END { for (m in last) print last[m] }' <<<"$tags" | sort -V | tail -n "$MINORS") picked=(main "${releases[@]}") fi json="$(jq -cn '$ARGS.positional' --args "${picked[@]}")" @@ -64,11 +67,14 @@ jobs: timeout-minutes: 30 permissions: contents: read - issues: write strategy: fail-fast: false matrix: ref: ${{ fromJSON(needs.refs.outputs.refs) }} + env: + # The checks print `ok:` lines to stdout and their FAIL to stderr: unbuffered, + # the log keeps them in order. + PYTHONUNBUFFERED: "1" steps: - name: Check out ${{ matrix.ref }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -86,8 +92,11 @@ jobs: smoke_test: "${binary} version --short" - name: Install PyYAML run: | - sudo timeout 180 apt-get update -qq - sudo timeout 180 apt-get install -y -qq python3-yaml + for attempt in 1 2 3; do + python3 -c 'import yaml' 2>/dev/null && break + (sudo timeout 180 apt-get update -qq && sudo timeout 180 apt-get install -y -qq python3-yaml) && break + echo "apt attempt $attempt failed or stalled; retrying" >&2; sleep 15 + done python3 -c 'import yaml' - name: Render every component with the forwarded values id: render @@ -100,54 +109,132 @@ jobs: else targets=(verify-release-floors verify-examples) fi - make "${targets[@]}" 2>&1 | tee "$RUNNER_TEMP/render.log" - - name: Summarize the refusal - if: failure() && steps.render.outcome == 'failure' - run: | - { - echo '```' - sed -n '/^FAIL/,$p' "$RUNNER_TEMP/render.log" | head -n 60 - echo '```' - } > "$RUNNER_TEMP/fail.md" - if [ "$(wc -l < "$RUNNER_TEMP/fail.md")" -le 2 ]; then - { echo '```'; tail -n 40 "$RUNNER_TEMP/render.log"; echo '```'; } > "$RUNNER_TEMP/fail.md" - fi - cat "$RUNNER_TEMP/fail.md" >> "$GITHUB_STEP_SUMMARY" - - name: Open, update or close the issue for ${{ matrix.ref }} - if: always() && github.event_name != 'pull_request' && (steps.render.outcome == 'success' || steps.render.outcome == 'failure') + # -k: every target reports, not only the first that fails. + make -k "${targets[@]}" 2>&1 | tee "$RUNNER_TEMP/render.log" + - name: Classify the result + if: always() env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} REF: ${{ matrix.ref }} OUTCOME: ${{ steps.render.outcome }} - RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} run: | set -euo pipefail - if [ "$REF" = main ]; then - title="agent-platform main branch chart doesn't render" + log="$RUNNER_TEMP/render.log" + touch "$log" + mkdir -p result + # refused: a component chart refuses the forwarded values (what breaks + # installations); unreleased: main's Chart.yaml annotation is stale; + # failed: anything else (setup, the registry, the check itself). + if [ "$OUTCOME" = success ]; then + kind=success + elif grep -q -E 'rejects the values (the meta chart forwards to it|the example gives it)' "$log"; then + kind=refused + elif grep -q 'run `make sync-unreleased`' "$log"; then + kind=unreleased else - title="agent-platform release $REF chart doesn't render" + kind=failed fi - number="$(gh issue list --state open --label team/bumblebee --search "\"$title\" in:title" \ - --json number,title --jq "map(select(.title == \"$title\"))[0].number // empty")" - if [ "$OUTCOME" = success ]; then - if [ -n "$number" ]; then - gh issue close "$number" --comment "Every component renders again on \`$REF\`: $RUN_URL" - fi - exit 0 + # The FAIL blocks, without the lines that change from run to run. + { grep -E -A6 '^FAIL' "$log" || tail -n 40 "$log"; } | head -n 80 > result/excerpt.txt + echo "$kind" > result/kind + echo "$REF" > result/ref + if [ "$kind" != success ]; then + { echo "### $REF: $kind"; echo '```'; cat result/excerpt.txt; echo '```'; } >> "$GITHUB_STEP_SUMMARY" fi - body="$(cat </dev/null || true) | head -n 1 | xargs -r dirname)" + if [ -n "$dir" ]; then + kind="$(cat "$dir/kind")"; excerpt="$(cat "$dir/excerpt.txt")" + else + kind=failed; excerpt="The render job reported no result: it failed before the render ran." + fi + title="$(title_of "$ref")" + number="$(number_of "$title")" + if [ "$kind" = success ]; then + [ -z "$number" ] || gh issue close "$number" --comment "Every component renders again on \`$ref\`: $RUN_URL" + continue + fi + if [ "$ref" = main ]; then where="the next release"; else where="installations that reconcile \`$ref\`"; fi + case "$kind" in + refused) what="A component chart refuses the values agent-platform \`$ref\` forwards to it: $where now fail to install or upgrade that component." ;; + unreleased) what="\`main\`'s \`agent-platform.giantswarm.io/unreleased\` annotation no longer matches the registry: run \`make sync-unreleased\` on \`main\`. Installations are not affected." ;; + *) what="The render check for \`$ref\` could not finish (setup, the registry or the check itself). This does not say that installations fail; look at the run." ;; + esac + signature="$(printf '%s\n%s' "$kind" "$excerpt" | sha256sum | cut -c1-16)" + report="$(printf '%s\n\nRun: %s\n\n```\n%s\n```\n\nHow to respond: [docs/ci.md](https://github.com/%s/blob/main/docs/ci.md#scheduled-component-render).\n\n' \ + "$what" "$RUN_URL" "$excerpt" "$GH_REPO" "$signature")" + if [ -z "$number" ]; then + gh issue create --title "$title" --label team/bumblebee --body "$(printf '@giantswarm/team-bumblebee %s' "$report")" + continue + fi + # A new comment only when the failure changed: the same refusal + # every six hours says nothing new. + last="$(gh issue view "$number" --json body,comments \ + --jq '[.body, (.comments[].body)] | map(select(contains("render-signature"))) | last // ""')" + if [[ "$last" != *"render-signature: $signature"* ]]; then + gh issue comment "$number" --body "$report" + fi + done - How to respond: [docs/ci.md](https://github.com/$GH_REPO/blob/main/docs/ci.md#scheduled-component-render). - EOF - )" - if [ -n "$number" ]; then - gh issue comment "$number" --body "$body" - else - gh issue create --title "$title" --label team/bumblebee --body "$body" + # A ref the schedule no longer renders (a newer patch or minor took its + # place, or it was rendered once by hand) never turns green: close its + # issue so the open ones are the refs that are still checked. + if [ "$SCHEDULED" = true ]; then + TITLES="$(for ref in "${refs[@]}"; do title_of "$ref"; done | jq -R . | jq -sc .)" \ + jq -r '(env.TITLES | fromjson) as $t + | .[] | select(.title | test("^agent-platform (release v[0-9.]+|main branch) chart doesn.t render$")) + | select(.title as $x | $t | index($x) | not) | .number' <<<"$open" \ + | while read -r stale; do + gh issue close "$stale" --comment "The schedule no longer renders this ref (a newer patch or minor took its place): $RUN_URL. Reopen it if installations still run it." + done fi diff --git a/docs/ci.md b/docs/ci.md index 301d89674..222bbd7fb 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -10,7 +10,7 @@ Each `components.*.versionRange` floats within its major, so a component release changes what an already published agent-platform release installs, without any agent-platform commit. The pull request and tag pipelines run before that component release and cannot see it. -[`component-render-schedule`](../.github/workflows/component-render-schedule.yaml) closes that gap. Every six hours it checks out `main` and the latest patch of the three highest minor releases, resolves every component range the way Flux does today, pulls the charts, and renders each one with the values the meta chart forwards to it. Each ref runs its own targets, with its own values: +[`component-render-schedule`](../.github/workflows/component-render-schedule.yaml) closes that gap. Every six hours it checks out `main` and the latest patch of the five highest minor releases, resolves every component range the way Flux does today, pulls the charts, and renders each one with the values the meta chart forwards to it. Each ref runs its own targets, with its own values: - `main`: `make verify-components-charts verify-examples` - a release tag: `make verify-release-floors verify-examples` @@ -21,9 +21,15 @@ To render other refs, run the workflow by hand with the `refs` input, for exampl ### When an issue opens -A red ref opens the issue *agent-platform release `` chart doesn't render* (or *agent-platform main branch chart doesn't render*), labelled `team/bumblebee`. Later red runs comment on it, and the next green run closes it. The issue names the component, the version its range resolved to, and the refusal. +A failing ref opens the issue *agent-platform release `` chart doesn't render* (or *agent-platform main branch chart doesn't render*), labelled `team/bumblebee`, mentioning the team. The issue says which kind of failure it is: -Installations that reconcile that release into the new component version fail. Respond in one of these ways: +- **A component refuses the forwarded values.** Installations that reconcile that release into the new component version fail. It names the component, the version its range resolved to and the refusal. +- **The `unreleased` annotation is stale** (`main` only). A component the annotation waits for is now published: run `make sync-unreleased` on `main`. Installations are not affected. +- **The check could not finish**, for example on a setup or registry failure. It does not mean installations fail; look at the run. + +A later failing run comments only when the failure changed. The next passing run closes the issue, and so does the next scheduled run once the ref is no longer rendered (a newer patch or minor took its place, or it was rendered by hand). + +When a component refuses the values, respond in one of these ways: - Fix the meta chart on `main`: forward values the new component accepts, or cap the range below the breaking version. Then release a patch, and when an older minor that installations still run is affected, a patch of that minor too. - Have the component restore what it removed in a patch release, when the refusal is a breaking change inside a major.