Skip to content

[8.19] [ML] Automate patch version bump in CI pipeline (#3030)#3067

Merged
edsavage merged 3 commits into
elastic:8.19from
edsavage:backport/8.19/pr-3030
Jul 6, 2026
Merged

[8.19] [ML] Automate patch version bump in CI pipeline (#3030)#3067
edsavage merged 3 commits into
elastic:8.19from
edsavage:backport/8.19/pr-3030

Conversation

@edsavage

@edsavage edsavage commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #3030 to the 8.19 branch, with #3052 (dev-tools pytest CI) bundled as a prerequisite.

Automates patch elasticsearchVersion bumps for ml-cpp via the ml-cpp-version-bump Buildkite pipeline: validate parameters, optionally run the bump (topic branch + GitHub PR + merge), notify Slack, then wait for DRA artifacts.

Commits

  1. [ML] Harden dev-tools Python CI: pytest on bookworm, deps, narrow changelog unittest #3052 — dev-tools pytest CI (run_dev_tools_tests.sh, test-requirements.txt, Buildkite step). Changelog validation steps from main are omitted on 8.19 (no per-PR changelog feature on this branch).
  2. [ML] Automate patch version bump in CI pipeline #3030 — two-phase version bump pipeline and dev-tools scripts/tests (14 files).

Conflict resolution

Same as the 9.3 backport (#3062): job-version-bump.json.py and send_version_bump_notification.sh did not exist on 8.19; added from main.

Test plan

  • CI passes on 8.19 branch (including dev-tools pytest)
  • Coordinate with release-eng before first automated 8.19 patch bump (BRANCH=8.19, WORKFLOW=patch)

Made with Cursor

edsavage and others added 2 commits July 6, 2026 13:29
…ngelog unittest (elastic#3052)

- Add dev-tools pytest step (python:3.11-bookworm) with test-requirements.txt
  including PyYAML/jsonschema so changelog helpers import during collection.
- Add run_dev_tools_tests.sh, pytest.ini, and dev_tools_pytest Buildkite step.
- Restrict test-changelog-tools.sh unittest discover to test_changelog_tools.py so
  pytest-only modules are not loaded without pytest installed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the ml-cpp-version-bump stub with a two-phase Buildkite flow.

Phase 1 (job-version-bump.json.py): validate_version_bump_params.sh on Wolfi
(patch-only rules; optional git fetch re-check when enabled), then
version_bump_upload_phase2.sh uploads phase 2 only when work remains (step
conditionals cannot rely on build meta-data).

Phase 2 (job-version-bump-phase2.json.py): bump_version.sh bumps
elasticsearchVersion on a ci/ml-cpp-version-bump-* topic branch, pushes,
opens a PR via GitHub CLI (ensure_github_cli.sh, create_github_pull_request.sh),
defaults to gh pr merge --auto --squash, optional immediate merge and
VERSION_BUMP_MERGE_ADMIN; records meta-data for no-op and PR URL. Slack step
(send_slack_version_bump_notification.sh) uses Wolfi and step notify. DRA wait
(wait_version_bump_dra.py) skips on DRY_RUN or when validation/bump report no
change.

Adds dev-tools/unittest for validation and pipeline JSON. Does not modify
.backportrc.json (reserved for future release automation). Minor version bumps
stay a follow-up change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@edsavage edsavage added >build >non-issue :ml backport auto-backport Automatically merge backport PRs when CI passes v8.19.16 labels Jul 6, 2026
@prodsecmachine

prodsecmachine commented Jul 6, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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

Backports the automated patch elasticsearchVersion bump workflow to the 8.19 branch by adding a two-phase Buildkite pipeline (validate → upload phase 2) plus the supporting dev-tools scripts/tests, and bundles the prerequisite dev-tools pytest CI wiring.

Changes:

  • Add Buildkite phase 1/phase 2 pipeline generators for the ml-cpp-version-bump workflow, including Slack notification and a DRA “wait for artifacts” step.
  • Add dev-tools scripts for parameter validation, PR creation/merge via gh, and DRA polling; add unit tests for the new validation and pipeline JSON generators.
  • Add dev-tools pytest CI step + test runner/dependency list (test-requirements.txt, pytest.ini, Buildkite step script).

Reviewed changes

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

Show a summary per file
File Description
dev-tools/wait_version_bump_dra.py Polls DRA staging/snapshot JSON until versions match; gated by Buildkite meta-data.
dev-tools/version_bump_validation.py Centralized patch-bump validation rules + CLI.
dev-tools/version_bump_upload_phase2.sh Uploads phase-2 pipeline only when validate indicates a bump is needed.
dev-tools/validate_version_bump_params.sh Validates NEW_VERSION/BRANCH against origin branch gradle.properties and sets no-op meta-data.
dev-tools/unittest/test_wait_version_bump_dra.py Tests DRA wait polling/logging behavior.
dev-tools/unittest/test_version_bump_validation.py Tests validation rules + CLI, with opt-in integration tests.
dev-tools/unittest/test_job_version_bump_pipeline.py Tests JSON shape/env wiring for both Buildkite pipeline generators.
dev-tools/test-requirements.txt Pytest + import-time deps for dev-tools tests.
dev-tools/run_dev_tools_tests.sh Runs dev-tools unit tests via pytest.
dev-tools/pytest.ini Pytest configuration (testpaths/pythonpath + integration marker).
dev-tools/ensure_github_cli.sh Ensures gh is installed (apk or Linux tarball fallback).
dev-tools/create_github_pull_request.sh Creates (and optionally merges/auto-merges) PRs via gh.
dev-tools/bump_version.sh Performs the version bump on a topic branch and opens/merges a PR; sets Buildkite meta-data for downstream steps.
.buildkite/scripts/steps/dev_tools_pytest.sh Buildkite step script: pip install dev-tools deps then run pytest.
.buildkite/pipelines/send_version_bump_notification.sh Legacy version bump Slack notification template adjustment.
.buildkite/pipelines/send_slack_version_bump_notification.sh Step-level Slack notification after PR creation (includes PR link when available).
.buildkite/pipelines/format_and_validation.yml.sh Adds a “dev-tools pytest” PR check step.
.buildkite/job-version-bump.json.py Phase 1 pipeline generator (validate + schedule phase 2).
.buildkite/job-version-bump-phase2.json.py Phase 2 pipeline generator (bump + Slack + DRA wait).

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

Comment thread dev-tools/validate_version_bump_params.sh Outdated
Comment thread dev-tools/bump_version.sh Outdated
Comment thread dev-tools/version_bump_upload_phase2.sh Outdated
Comment thread .buildkite/pipelines/send_slack_version_bump_notification.sh Outdated
Validate NEW_VERSION/BRANCH before git fetch, use git fetch -- for safety,
fail fast when phase-2 meta-data read errors, and use Slack mrkdwn bold.

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

Labels

auto-backport Automatically merge backport PRs when CI passes backport >build :ml >non-issue v8.19.19

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants