[ML] Make Appex QA/PyTorch tests version-aware on release branches - #3115
Conversation
The downstream appex-qa-stateful-custom-ml-cpp-build-testing pipeline
(elastic/qaf-tests) defaults to ES_BRANCH=main and STACK_VERSION=<current
main SNAPSHOT>, then downloads ml-cpp-<version>-SNAPSHOT-linux-x86_64.zip
from the parent build. On a release-branch / backport build the parent
produced ml-cpp-<release-version>-SNAPSHOT-... instead, so the download
missed ('No artifacts found') and the QA/PyTorch build failed spuriously
(e.g. a 9.5 backport looking for 9.6.0-SNAPSHOT).
Derive STACK_VERSION from gradle.properties (the exact artifact version)
and ES_BRANCH by comparing to ml-cpp main's version (main for the current
dev line, else major.minor), and forward both through the QA and PyTorch
downstream triggers. For main builds the derived values equal today's
defaults, so only release-branch/backport builds change behaviour. No
qaf-tests change is required; it already supports these overrides and lists
the active release branches/versions.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pinging @elastic/ml-core (Team:ML) |
|
buildkite build |
|
buildkite build |
There was a problem hiding this comment.
Pull request overview
This PR fixes spurious downstream Appex QA/PyTorch failures on release-branch/backport builds by ensuring the triggered qaf-tests pipeline receives the correct STACK_VERSION (matching the produced ml-cpp artifact version) and ES_BRANCH (matching the corresponding Elasticsearch branch), instead of relying on qaf-tests defaults that assume main.
Changes:
- Add a new sourced helper script to derive
STACK_VERSIONfromgradle.propertiesand computeES_BRANCHby comparing against ml-cppmain’s version (with a branch-name heuristic fallback). - Source the helper from the QA and PyTorch pipeline generator scripts.
- Forward derived
ES_BRANCH/STACK_VERSIONinto the downstream trigger env when non-empty.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.buildkite/pipelines/run_qa_tests.yml.sh |
Sources the new helper so QA triggers on backports use the correct stack version/branch. |
.buildkite/pipelines/run_pytorch_tests.yml.sh |
Sources the new helper and forwards ES_BRANCH/STACK_VERSION into the downstream PyTorch trigger env. |
.buildkite/pipelines/derive_qa_stack_env.sh |
New helper that derives STACK_VERSION/ES_BRANCH in a stdout-safe way for piped pipeline uploads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
💔 Some backports could not be created
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
…alog-info (#3129) The ml-cpp-pr-builds required status check 'buildkite/ml-cpp-pr-builds' is produced by the pipeline's publish_commit_status setting. It was declared false (with publish_commit_status_per_step true) in catalog-info.yaml, so the Backstage sync kept resetting the pipeline to that — the required rollup was never posted and PRs/backports stayed BLOCKED despite green builds (seen on the #3115 backports #3125/#3126). Pipeline settings must be changed here, not via the Buildkite API (the sync overwrites API changes). Set publish_commit_status: true and publish_commit_status_per_step: false so the single required rollup posts and per-step statuses don't flood PRs. Co-authored-by: Cursor <cursoragent@cursor.com>
…3115) (#3126) The downstream appex-qa-stateful-custom-ml-cpp-build-testing pipeline (elastic/qaf-tests) defaults to ES_BRANCH=main and STACK_VERSION=<current main SNAPSHOT>, then downloads ml-cpp-<version>-SNAPSHOT-linux-x86_64.zip from the parent build. On a release-branch / backport build the parent produced ml-cpp-<release-version>-SNAPSHOT-... instead, so the download missed ('No artifacts found') and the QA/PyTorch build failed spuriously (e.g. a 9.5 backport looking for 9.6.0-SNAPSHOT). Derive STACK_VERSION from gradle.properties (the exact artifact version) and ES_BRANCH by comparing to ml-cpp main's version (main for the current dev line, else major.minor), and forward both through the QA and PyTorch downstream triggers. For main builds the derived values equal today's defaults, so only release-branch/backport builds change behaviour. No qaf-tests change is required; it already supports these overrides and lists the active release branches/versions. (cherry picked from commit 6c3df89) Co-authored-by: Ed Savage <ed.savage@elastic.co> Co-authored-by: Cursor <cursoragent@cursor.com>
…3115) (#3125) The downstream appex-qa-stateful-custom-ml-cpp-build-testing pipeline (elastic/qaf-tests) defaults to ES_BRANCH=main and STACK_VERSION=<current main SNAPSHOT>, then downloads ml-cpp-<version>-SNAPSHOT-linux-x86_64.zip from the parent build. On a release-branch / backport build the parent produced ml-cpp-<release-version>-SNAPSHOT-... instead, so the download missed ('No artifacts found') and the QA/PyTorch build failed spuriously (e.g. a 9.5 backport looking for 9.6.0-SNAPSHOT). Derive STACK_VERSION from gradle.properties (the exact artifact version) and ES_BRANCH by comparing to ml-cpp main's version (main for the current dev line, else major.minor), and forward both through the QA and PyTorch downstream triggers. For main builds the derived values equal today's defaults, so only release-branch/backport builds change behaviour. No qaf-tests change is required; it already supports these overrides and lists the active release branches/versions. (cherry picked from commit 6c3df89) Co-authored-by: Ed Savage <ed.savage@elastic.co> Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Fixes the spurious PyTorch/QA build failure seen on backport PRs (e.g. build 2879 on the [9.5] backport of #3081), where the synchronous Appex QA trigger went red with:
Root cause
The downstream
appex-qa-stateful-custom-ml-cpp-build-testingpipeline (generated byelastic/qaf-tests,pipeline_generators/local/ml-cpp-custom.py) downloads the ml-cpp artifact from the parent build (--build $BUILDKITE_TRIGGERED_FROM_BUILD_ID) but names it fromSTACK_VERSION, which defaults toACTIVE_VERSIONS[0](the current main SNAPSHOT), and builds ES fromES_BRANCH, which defaults tomain. On a release-branch/backport build the parent producedml-cpp-<release>-SNAPSHOT-...(e.g.9.5.0), so the9.6.0-SNAPSHOTlookup missed.ci:run-pytorch-testsis inherited by backport PRs, so every backport hit this. It didn't block merges (the gating status is posted by the launch step; the synchronous downstream result isn't a required check), but it produced a red, misleading job on every backport.Fix (ml-cpp side only — no
qaf-testschange)qaf-testsalready supportsSTACK_VERSION/ES_BRANCHoverrides and lists our release lines as active (main, 9.5, 9.4, 9.3, 8.19). We just need to pass the right values:.buildkite/pipelines/derive_qa_stack_env.sh:STACK_VERSION←gradle.propertieselasticsearchVersion(exactly the artifact version).ES_BRANCH←mainif this build's version equalsml-cppmain's version (fetched fromgithub.laiyagushi.com/ghraw/elastic/ml-cpp/main/gradle.properties, the same host the downstream already uses), else<major>.<minor>. This is self-updating — no hard-coded "current dev minor" to bump at feature freeze. Falls back to a branch-name heuristic if that fetch fails.GITHUB_PR_COMMENT_VAR_BRANCH/_VERSION), and writes only to stderr (the generators pipe stdout tobuildkite-agent pipeline upload).run_pytorch_tests.yml.shnow sources the helper and forwardsES_BRANCH/STACK_VERSIONinto the trigger (mirroringrun_qa_tests.yml.sh, which already forwarded them but had nothing to derive them).run_qa_tests.yml.shsources the same helper, so QA on backports gets the same treatment.Behaviour
main/9.6.0) → no change.9.5/9.5.0etc. → the parent's artifact matches and the custom ES distribution is built from the right branch.Dry-run of the generators confirms the emitted trigger YAML:
Note
The generator scripts live in the checked-out branch, so this must be backported to
9.5/9.4/8.19for their backport builds to benefit (same as theci:skip-es-testsfix). Backports will follow.Test plan
ES_BRANCH/STACK_VERSIONfor main and a simulated release build (done locally).ci:run-pytorch-teststriggers a downstream QA build that finds theml-cpp-<release>-SNAPSHOTartifact and runs (no "No artifacts found").ci:run-pytorch-testsare unaffected.Made with Cursor