Centralize build scheduling into a single version-aware dispatcher#46
Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates weekly build scheduling into a single GitHub Actions workflow that checks upstream Go/FIPS versions against tags already published to quay.io/konveyor/builder, and dispatches only the missing version builds. This reduces unnecessary rebuilds across the six existing image build workflows.
Changes:
- Added a new scheduled dispatcher workflow that queries upstream Go/FIPS versions and Quay tags, then triggers the appropriate build workflows when tags are missing.
- Removed the
schedule:trigger from all six existing build workflows so they only run viaworkflow_dispatch,push, andpull_request. - Implemented a
dry_runmode for the dispatcher to log intended dispatches.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/scheduled_dispatch.yml | New centralized scheduled workflow that compares upstream versions to Quay tags and dispatches builds when needed. |
| .github/workflows/ubi8_multi_arch_image_build.yml | Removed weekly schedule trigger. |
| .github/workflows/ubi9_multi_arch_image_build.yml | Removed weekly schedule trigger. |
| .github/workflows/ubi10_multi_arch_image_build.yml | Removed weekly schedule trigger. |
| .github/workflows/ubi8_openssl_fips_multi_arch_image_build.yml | Removed weekly schedule trigger. |
| .github/workflows/ubi9_openssl_fips_multi_arch_image_build.yml | Removed weekly schedule trigger. |
| .github/workflows/ubi10_openssl_fips_multi_arch_image_build.yml | Removed weekly schedule trigger. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "Checking OpenSSL FIPS image versions ..." | ||
| fips_releases=$(gh api repos/golang-fips/go/releases --paginate) | ||
| mapfile -t FIPS_ENTRIES < <(echo "$fips_releases" | jq -r ' |
| echo "Checking standard (non-FIPS) image versions ..." | ||
| go_json=$(curl -sfS --retry 3 --retry-delay 5 --max-time 30 'https://go.dev/dl/?mode=json') | ||
| mapfile -t GO_VERSIONS < <(echo "$go_json" | jq -r '[.[] | select(.stable == true) | .version | ltrimstr("go")] | .[]') | ||
|
|
| push: | ||
| paths: | ||
| - 'Dockerfile.ubi8' | ||
| - '.github/workflows/ubi8_multi_arch_image_build.yml' | ||
| schedule: | ||
| - cron: '0 0 * * 6' | ||
| pull_request: |
| push: | ||
| paths: | ||
| - 'Dockerfile.ubi9' | ||
| - '.github/workflows/ubi9_multi_arch_image_build.yml' | ||
| schedule: | ||
| - cron: '0 0 * * 6' | ||
| pull_request: |
| push: | ||
| paths: | ||
| - 'Dockerfile.ubi10' | ||
| - '.github/workflows/ubi10_multi_arch_image_build.yml' | ||
| schedule: | ||
| - cron: '0 0 * * 6' | ||
| pull_request: |
There was a problem hiding this comment.
This was already addressed in commit 1f38d76 — the condition was simplified from "schedule" || "pull_request" to just "pull_request", and the comment updated accordingly.
| push: | ||
| paths: | ||
| - 'Dockerfile.ubi8-openssl-fips' | ||
| - '.github/workflows/ubi8_openssl_fips_multi_arch_image_build.yml' | ||
| schedule: | ||
| - cron: '0 2 * * 6' | ||
| pull_request: |
| push: | ||
| paths: | ||
| - 'Dockerfile.ubi9-openssl-fips' | ||
| - '.github/workflows/ubi9_openssl_fips_multi_arch_image_build.yml' | ||
| schedule: | ||
| - cron: '0 2 * * 6' | ||
| pull_request: |
| push: | ||
| paths: | ||
| - 'Dockerfile.ubi10-openssl-fips' | ||
| - '.github/workflows/ubi10_openssl_fips_multi_arch_image_build.yml' | ||
| schedule: | ||
| - cron: '0 2 * * 6' | ||
| pull_request: |
|
GitHub’s docs say that events created with GITHUB_TOKEN usually do not trigger new workflow runs, but workflow_dispatch and repository_dispatch are explicit exceptions and always create workflow runs. See GITHUB_TOKEN. @copilot address the review and use the built-in GitHub token. |
Done in Address review: use GITHUB_TOKEN, limit Go versions, remove dead schedule branches. Changes made:
|
| # workflow_dispatch events are an explicit exception to the rule that | ||
| # GITHUB_TOKEN cannot trigger new workflow runs, so no additional token is | ||
| # required (see https://docs.github.com/en/actions/concepts/security/github_token). |
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || false }} |
| - name: Check version availability and dispatch builds | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| # --- Standard (non-FIPS) image variants --------------------------------- |
|
Note Responses generated with Claude @copilot Two things to fix on this PR:
Everything else (tag-matching logic between this dispatcher and each build workflow's published |
Added the For the PR description: I don't have a way to directly edit the PR body through the available tools. Could you update the "Reviewer note" section manually? The stale text to remove/replace is:
It can be removed entirely, or replaced with something like:
|
|
@copilot .github/workflows/scheduled_dispatch.yml should also run when .github/workflows/scheduled_dispatch.yml changes. |
Added in |
|
@copilot add retries
|
Co-authored-by: kaovilai <[email protected]>
Added in |
Each of the six image build workflows (ubi8/9/10 and their OpenSSL FIPS variants) ran its own weekly
schedule, rebuilding every version regardless of whether anything upstream changed. This centralizes scheduling into one workflow that dispatches builds only when a newer Go version is available than what's published inquay.io/konveyor/builder.Changes
scheduled_dispatch.yml— the single scheduled entry point (0 0 * * 6, plus manualworkflow_dispatchwith adry_runtoggle). It:go.dev(standard images) andgolang-fips/goreleases (FIPS images), reusing the FIPS selection logic from the existing workflow.go_version; previous → explicit version).schedule:trigger from all six build workflows; they now run onworkflow_dispatch,push, andpull_requestonly. PR validation behavior is unchanged.Tag scheme used for comparison
ubi8publishes with no prefix;ubi9/ubi10are prefixed:Reviewer note
Uses the built-in
GITHUB_TOKENwithpermissions: actions: write.workflow_dispatchAPI calls are an explicit exception to the GITHUB_TOKEN recursion guard, so no additional PAT or secret is required.