Skip to content

Add newly cut minor branch to snapshot build pipeline during minor freeze#3074

Merged
edsavage merged 4 commits into
elastic:mainfrom
edsavage:feature/minor-freeze-snapshot-schedule
Jul 15, 2026
Merged

Add newly cut minor branch to snapshot build pipeline during minor freeze#3074
edsavage merged 4 commits into
elastic:mainfrom
edsavage:feature/minor-freeze-snapshot-schedule

Conversation

@edsavage

Copy link
Copy Markdown
Contributor

Summary

The minor-freeze automation cuts the release branch and bumps main, but it did not register the new branch in the daily snapshot build pipeline defined in catalog-info.yaml. As a result the newly cut branch got no daily SNAPSHOT builds, and any scheduled/triggered build for it would be blocked by the snapshot pipeline's filter_condition. This was missed for 9.5.

This PR both automates the registration for future freezes and fixes the current gap by adding 9.5.

Changes

  • dev-tools/update_catalog_snapshot.py (new): a scoped, comment-preserving text edit (stdlib only — no YAML round-trip, so comments/formatting are preserved) that, for a MAJOR.MINOR branch:
    • adds build.branch == "<branch>" to the snapshot pipeline filter_condition, immediately after main (newest-first ordering);
    • inserts a Daily <branch> schedule (before Daily main) with the next free "half past the hour" cron slot (30 HH * * *), avoiding collisions with existing schedules.
    • Idempotent, and only the snapshot pipeline block is touched (the staging pipeline already matches any MAJOR.MINOR via regex and has no schedules).
  • dev-tools/bump_main_minor_freeze.sh (Leg B): invokes the updater so the catalog-info.yaml change lands in the same PR into main as the .backportrc.json update. The PR summary/body now lists the snapshot change.
  • catalog-info.yaml: registers the already-cut 9.5 branch (filter + Daily 9.5 @ 30 05 * * *).
  • dev-tools/unittest/test_update_catalog_snapshot.py (new): unit tests for filter/schedule insertion, ordering, next-free-hour selection, idempotency, partial-state completion, input validation, section scoping, plus a check that editing the real catalog-info.yaml yields valid YAML with unique cronlines.

Diff to the live file

filter_condition: ... "main" || "9.5" || "9.4" || "9.3" || "8.19" || "7.17"

+ Daily 9.5:
+   branch: '9.5'
+   cronline: 30 05 * * *
+   message: Daily SNAPSHOT build for 9.5

Test plan

  • python3 -m pytest dev-tools/unittest/ -q passes (73 passed, 2 git-integration skipped)
  • bash -n dev-tools/bump_main_minor_freeze.sh OK
  • Editing the real catalog-info.yaml parses as valid YAML; all snapshot cronlines remain unique
  • Re-running the updater for 9.5 is a no-op (idempotent)
  • Next minor freeze: confirm the Leg B PR into main includes the new Daily <branch> schedule + filter entry

Notes / follow-ups

  • Cron slots are assigned as max(existing hour) + 1 at 30 HH. With branches being EOL'd over time this won't realistically exhaust the 0–23 range; the script errors clearly if it ever would, prompting a prune of EOL schedules.
  • This does not remove EOL branch schedules — that remains a manual/cleanup decision.

Related

Made with Cursor

The minor-freeze automation cut the release branch and bumped main but did
not add the new branch to the daily snapshot build pipeline in
catalog-info.yaml, so the branch got no daily SNAPSHOT builds (and scheduled
builds would be blocked by the filter_condition). This was missed for 9.5.

- update_catalog_snapshot.py: scoped, comment-preserving edit that adds the
  branch to the snapshot pipeline filter_condition (newest-first) and inserts
  a "Daily <branch>" schedule with the next free half-past-hour slot. Idempotent
  and touches only the snapshot pipeline block.
- bump_main_minor_freeze.sh (Leg B): invoke the updater so the change lands in
  the same PR into main as the .backportrc.json update.
- catalog-info.yaml: register the already-cut 9.5 branch (fills the current gap).
- Add unit tests, including a real-file validity/uniqueness check.

Co-authored-by: Cursor <cursoragent@cursor.com>
@edsavage edsavage added >enhancement ci:skip-es-tests no-backport Skip automatic backport when this PR merges (version-bump automation) labels Jul 13, 2026
@edsavage edsavage requested review from Copilot and valeriy42 July 13, 2026 03:38
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automation to ensure newly cut MAJOR.MINOR release branches are registered in the Backstage/Buildkite snapshot pipeline (catalog-info.yaml) during minor freeze, and patches the current gap by registering 9.5. This prevents newly cut branches from being blocked by the snapshot pipeline filter_condition and ensures they receive daily SNAPSHOT builds.

Changes:

  • Add dev-tools/update_catalog_snapshot.py to perform a scoped, comment-preserving text edit of the snapshot pipeline’s filter_condition and schedules (idempotent).
  • Invoke the updater from dev-tools/bump_main_minor_freeze.sh so the catalog update lands alongside the main bump/backport config changes in Leg B.
  • Update catalog-info.yaml to include 9.5 in the snapshot filter and add a Daily 9.5 schedule; add unit tests covering insertion/ordering/idempotency and real-file YAML validity checks.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
dev-tools/update_catalog_snapshot.py New updater script to add a release branch to snapshot pipeline filter + daily schedule via comment-preserving text transform.
dev-tools/unittest/test_update_catalog_snapshot.py New pytest coverage for filter/schedule insertion logic, idempotency, scoping, and real catalog-info.yaml YAML validity/cron uniqueness.
dev-tools/bump_main_minor_freeze.sh Calls the new updater and includes catalog-info.yaml in the Leg B commit/PR body summary.
catalog-info.yaml Registers branch 9.5 for snapshot builds (filter condition + Daily 9.5 schedule).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dev-tools/update_catalog_snapshot.py Outdated
When the snapshot schedules block has no "Daily main" entry, append the new
schedule after the last existing entry (before the next sibling key) instead
of prepending right after "schedules:", matching the documented behaviour.
Add a regression test for the fallback path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread dev-tools/unittest/test_update_catalog_snapshot.py Outdated
Comment thread dev-tools/unittest/test_update_catalog_snapshot.py
- Use a sentinel branch (99.0) that will never ship for the real-catalog
  tests, so they don't flip to a no-op and fail confusingly once a plausible
  version is released.
- Add test_partial_state_schedule_only_is_completed covering the inverse
  partial state (schedule present, filter absent).

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

7.17 is no longer supported and there is no longer anywhere to upload its
build artifacts, so drop it from the snapshot pipeline filter_condition and
daily schedule. Removal of EOL branches is a manual step, independent of the
minor-freeze automation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@edsavage edsavage merged commit b49c5a8 into elastic:main Jul 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>build ci:skip-es-tests :ml no-backport Skip automatic backport when this PR merges (version-bump automation) v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants