From 83c2a05dbdd23502a15bff8b12e42bee03c38e15 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sat, 31 Oct 2026 01:57:38 +0100 Subject: [PATCH] Harden nightly publishing and bound CI job runtimes Write the nightly release notes only after every bundle is uploaded. The notes carry the build key that prepare compares against, so a failed upload used to record the new build anyway, and the following nights skipped it while the release kept stale or missing bundles. Publish only from the default branch. A manual run defaulted to publishing, so testing the workflow on a topic branch replaced the nightly with that branch. Run the packaging build on pull requests that touch MANIFEST.in, which decides what goes into the client and server packages, or anything under confluent_vtbufferd, which is compiled here and carries the only debian/ packaging in the tree. Give every job a timeout instead of the six hour default, so a hung container or download fails within minutes. --- .github/workflows/ci.yml | 4 ++++ .github/workflows/nightly.yml | 29 ++++++++++++++++++++++++----- .github/workflows/release.yml | 1 + 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a17a518..e3aaeed7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: shellcheck: name: ShellCheck runs-on: ubuntu-26.04 + timeout-minutes: 15 steps: - uses: actions/checkout@v7 - name: Run ShellCheck (errors only) @@ -41,6 +42,7 @@ jobs: ruff: name: Ruff runs-on: ubuntu-26.04 + timeout-minutes: 15 steps: - uses: actions/checkout@v7 # Pinned to an exact release: unlike actions/checkout, ruff-action @@ -56,6 +58,7 @@ jobs: pyrefly: name: Pyrefly runs-on: ubuntu-26.04 + timeout-minutes: 15 steps: - uses: actions/checkout@v7 - uses: facebook/pyrefly@main @@ -64,6 +67,7 @@ jobs: name: Python compileall # Python 3.8 and 3.9 are unavailable on Ubuntu 26.04. runs-on: ubuntu-24.04 + timeout-minutes: 15 env: # One entry per Python version shipped by the distros confluent # targets, limited to versions actions/setup-python still provides diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9cc3574e..cc48f89d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,7 +11,7 @@ on: workflow_dispatch: inputs: publish: - description: Publish the result as the nightly pre-release + description: Publish the result as the nightly pre-release (default branch only) type: boolean default: true force: @@ -27,9 +27,12 @@ on: - '**/builddeb' - '**/makesetup' - '**/setup.py.tmpl' + - '**/MANIFEST.in' - '**/*.spec' - '**/*.spec.tmpl' - confluent_osdeploy/utils/** + # compiled here, and its debian/ packaging is the only one in the tree + - confluent_vtbufferd/** - build/arm/** - mkversion - VERSION @@ -53,6 +56,7 @@ jobs: prepare: name: prepare runs-on: ubuntu-26.04 + timeout-minutes: 30 outputs: build: ${{ steps.check.outputs.build }} version: ${{ steps.check.outputs.version }} @@ -96,6 +100,7 @@ jobs: needs: prepare if: needs.prepare.outputs.build == 'true' runs-on: ${{ matrix.runner }} + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -123,6 +128,7 @@ jobs: needs: prepare if: needs.prepare.outputs.build == 'true' runs-on: ${{ matrix.runner }} + timeout-minutes: 30 container: ${{ matrix.image }} strategy: fail-fast: false @@ -160,6 +166,7 @@ jobs: name: osdeploy RPM (${{ matrix.arch }}) needs: utils runs-on: ubuntu-26.04 + timeout-minutes: 30 container: almalinux:9 strategy: fail-fast: false @@ -194,6 +201,7 @@ jobs: needs: prepare if: needs.prepare.outputs.build == 'true' runs-on: ubuntu-26.04 + timeout-minutes: 30 container: almalinux:9 steps: - name: Install build dependencies @@ -212,6 +220,7 @@ jobs: needs: prepare if: needs.prepare.outputs.build == 'true' runs-on: ${{ matrix.runner }} + timeout-minutes: 30 container: almalinux:10 strategy: fail-fast: false @@ -238,6 +247,7 @@ jobs: name: debs (${{ matrix.release }}-${{ matrix.arch }}) needs: [osdeploy, ipxe, go] runs-on: ${{ matrix.runner }} + timeout-minutes: 30 container: ubuntu:${{ matrix.release }} strategy: fail-fast: false @@ -284,6 +294,7 @@ jobs: name: assemble bundles needs: [prepare, rpms, osdeploy, ipxe, go, debs] runs-on: ubuntu-26.04 + timeout-minutes: 30 steps: - uses: actions/checkout@v7 - name: Install tools @@ -347,6 +358,7 @@ jobs: name: smoketest (${{ matrix.target }}) needs: bundle runs-on: ${{ matrix.runner }} + timeout-minutes: 30 container: ${{ matrix.image }} strategy: fail-fast: false @@ -383,11 +395,15 @@ jobs: publish: name: publish nightly release needs: [prepare, smoketest] + # a manual run on a topic branch builds and tests, but must not replace + # the nightly with that branch if: >- needs.prepare.outputs.build == 'true' && + github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.publish)) runs-on: ubuntu-26.04 + timeout-minutes: 30 permissions: contents: write env: @@ -447,14 +463,17 @@ jobs: set -e if gh release view nightly > /dev/null 2>&1; then gh api -X PATCH "repos/$GH_REPO/git/refs/tags/nightly" -f sha="$GITHUB_SHA" -F force=true > /dev/null - gh release edit nightly --title "Nightly $VERSION" --notes-file notes.md --prerelease --latest=false for old in $(gh release view nightly --json assets -q '.assets[].name'); do [ -f "bundles/$old" ] || gh release delete-asset nightly "$old" -y done - gh release upload nightly bundles/*.tar.gz --clobber else # a stale tag without a release would keep pointing at its old commit gh api -X DELETE "repos/$GH_REPO/git/refs/tags/nightly" > /dev/null 2>&1 || true - gh release create nightly bundles/*.tar.gz --target "$GITHUB_SHA" \ - --title "Nightly $VERSION" --notes-file notes.md --prerelease --latest=false + gh release create nightly --target "$GITHUB_SHA" \ + --title "Nightly $VERSION" --notes "" --prerelease --latest=false fi + gh release upload nightly bundles/*.tar.gz --clobber + # The notes carry the build key prepare compares against, so write + # them only once every bundle is up: after a failed upload the old + # key stays, and the next night rebuilds instead of skipping. + gh release edit nightly --title "Nightly $VERSION" --notes-file notes.md --prerelease --latest=false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6ea1c5f..e1f36b6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ permissions: jobs: release: runs-on: ubuntu-26.04 + timeout-minutes: 10 steps: - uses: actions/checkout@v7 - name: Create Release