Add weekly DRA scheduler to prevent snapshot expiry - #7656
Add weekly DRA scheduler to prevent snapshot expiry#7656gurevichdmitry wants to merge 6 commits into
Conversation
Fan out Buildkite cloudbeat DRA builds from Mergify-maintained branches so quiet release branches stay within the 15-day GCS retention window. Co-authored-by: Cursor <cursoragent@cursor.com>
|
This pull request does not have a backport label. Could you fix it @gurevichdmitry? 🙏
|
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds a weekly Buildkite “scheduler” pipeline to keep Cloudbeat DRA snapshot manifests fresh by periodically triggering the existing cloudbeat DRA pipeline for all maintained branches derived from .mergify.yml backport destinations plus main.
Changes:
- Registers a new Backstage/RRE Buildkite pipeline resource for
cloudbeat-dra-schedulerwith a weekly Monday 06:00 UTC schedule. - Adds a new Buildkite pipeline definition and scheduler script that derives maintained branches and uploads trigger steps to Buildkite.
- Documents scheduler behavior, branch source-of-truth, and operational maintenance in
.buildkite/README.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
catalog-info.yaml |
Adds Backstage/RRE resource for the new weekly scheduler pipeline and its schedule. |
.buildkite/dra-scheduler-pipeline.yml |
Defines the scheduler pipeline step that runs the branch-derivation + trigger upload script. |
.buildkite/scripts/dra-scheduler.sh |
Implements deriving branches from .mergify.yml, optional origin validation, and Buildkite trigger-step generation/upload. |
.buildkite/README.md |
Documents the new weekly refresh mechanism and how to maintain/verify it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Tolerate empty/missing Mergify rules, pin yq to a temp install, quote trigger pipeline slug, and use a portable numeric sort. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
.buildkite/scripts/dra-scheduler.sh:137
- The EXIT trap currently only deletes the steps file; if
install_yquses a temp dir, it should also be cleaned up to avoid accumulatingmktemp -ddirectories across runs.
trap 'rm -f "${STEPS_FILE}"' EXIT
.buildkite/scripts/dra-scheduler.sh:53
EXCLUDE_BRANCHESis documented as CSV, butis_excludeddoes an exact string compare without trimming whitespace. Values likeEXCLUDE_BRANCHES="9.3, 9.4"won’t exclude9.4due to the leading space.
local IFS=','
# shellcheck disable=SC2086
for excl in ${EXCLUDE_BRANCHES}; do
if [[ "${branch}" == "${excl}" ]]; then
return 0
.buildkite/scripts/dra-scheduler.sh:27
install_yqcreates a temp directory viamktemp -dbut never cleans it up, which will leak directories on every run (especially noticeable for local dry-runs). Capturing the temp dir path in a global var allows the existing EXIT trap to remove it without changing the rest of the function’s logic.
echo "--- Installing yq ${YQ_VERSION}"
local yq_dir yq_bin yq_asset
yq_dir="$(mktemp -d)"
yq_bin="${yq_dir}/yq"
Verify downloaded yq against release SHA-256 (or YQ_SHA256), remove temp dirs on EXIT, and trim whitespace in EXCLUDE_BRANCHES CSV values. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
cloudbeat-dra-schedulerBuildkite pipeline (weekly Monday 06:00 UTC) that derives maintained branches from.mergify.ymlbackport destinations +mainand triggers the existingcloudbeatDRA pipeline for each.catalog-infoschedule edits (new minors appear when version-bump adds Mergify rules)..buildkite/README.md.Fixes https://github.com/elastic/security-team/issues/18691
Test plan
SKIP_UPLOAD=true SKIP_REMOTE_CHECK=true .buildkite/scripts/dra-scheduler.shemits triggers formain,8.19,9.3,9.4,9.5cloudbeatDRA builds for all five branches (esp.9.3)latest/<branch>.jsonfreshness and cloudbeat on dra-infoMade with Cursor