Skip to content

ci: Migrate DRA GCS publishing from Release manager to dra-prep-plugin - #7756

Draft
ninalee12 wants to merge 6 commits into
elastic:mainfrom
ninalee12:dra-processing
Draft

ci: Migrate DRA GCS publishing from Release manager to dra-prep-plugin#7756
ninalee12 wants to merge 6 commits into
elastic:mainfrom
ninalee12:dra-processing

Conversation

@ninalee12

Copy link
Copy Markdown
Contributor

What is the problem this PR solves?

Release manager will be decommisioned as part of https://github.com/elastic/platform-engineering-productivity/issues/2257

This PR replaces release-manager

How does this PR solve the problem?

Replaces the Release Manager Docker step with elastic/dra-prep-buildkite-plugin +
a trigger to unified-release-dra-processing.

Testing

Run a dry run for the snapshot and staging pipelines

  • dry run build

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

Copilot AI lite review requested due to automatic review settings September 2, 2026 17:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new artifact staging step can drop nested distribution artifacts (and potentially fail early), which would break DRA uploads.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR migrates the Buildkite DRA publishing flow away from the deprecated Release Manager container and onto the elastic/dra-prep Buildkite plugin, then triggers the centralized unified-release-dra-processing pipeline for downstream processing.

Changes:

  • Replaced the Release Manager-based DRA step with a generated sub-pipeline that runs elastic/dra-prep and triggers unified-release-dra-processing.
  • Added artifact staging and dependency report generation to feed dra-prep.
  • Removed Vault credential setup and Release Manager scripts that are no longer needed.
File summaries
File Description
.buildkite/scripts/stage-dra-artifacts.sh New helper to download packaged artifacts, generate dependency CSV, and stage inputs for dra-prep.
.buildkite/scripts/release-manager.sh Removed Release Manager invocation script.
.buildkite/scripts/dra.sh New generator script that uploads a DRA prep + annotate + trigger sub-pipeline per workflow.
.buildkite/scripts/dra-annotate.sh New script to annotate the build with a summary link derived from the DRA manifest.
.buildkite/scripts/dra_release.sh Removed legacy DRA wrapper around Release Manager + dependency report generation.
.buildkite/pipeline.package.mbp.yml Switched DRA steps to call the new generator script and removed docker-login plugin usage.
.buildkite/hooks/pre-command Removed Vault-based DRA credential fetching now that Release Manager is gone.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .buildkite/scripts/stage-dra-artifacts.sh
Comment thread .buildkite/scripts/dra-annotate.sh
Comment thread .buildkite/scripts/dra.sh
@mergify

mergify Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @ninalee12? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

Copilot AI review requested due to automatic review settings September 2, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

New DRA scripts have failure paths that can exit with non-actionable errors (missing artifacts/manifest), which will make CI failures harder to diagnose.

Review details

Suppressed comments (2)

.buildkite/scripts/stage-dra-artifacts.sh:34

  • chmod -R a+r "${BASE_DIR}"/* will cause the script to exit with a generic "cannot access" error when no packages were downloaded (unmatched glob), so the later explicit "no artifacts found" check never runs. This makes the failure mode harder to diagnose.
chmod -R a+r "${BASE_DIR}"/*

.buildkite/scripts/dra-annotate.sh:22

  • If the dra-prep step doesn't upload a manifest (or artifact download fails silently), find ... | head -1 can yield an empty path and jq will fail with a non-obvious error. Add a guard that the manifest exists and that build_id/version were extracted successfully, so the step fails with a clear message.
manifest=$(find artifacts/dra/fleet-server -name "manifest-*.json" | head -1)
build_id=$(jq -r '.build_id' "${manifest}")
version=$(jq -r '.version' "${manifest}")
url="https://artifacts-${WORKFLOW}.elastic.co/dra-builds/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_BUILD_NUMBER}/${build_id}/summary-${version}.html"
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ninalee12 ninalee12 added backport-8.x Automated backport to the 8.x branch with mergify backport-9.4 Automated backport to 9.4 branch. backport-9.5 Automated backport to the 9.5 branch labels Sep 2, 2026
Copilot AI review requested due to automatic review settings September 2, 2026 21:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The snapshot dependency report naming behavior appears to regress from the previous DRA flow and may break downstream consumers expecting the prior -SNAPSHOT suffix.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .buildkite/scripts/stage-dra-artifacts.sh
…lename

mage getVersion only appends -SNAPSHOT when the SNAPSHOT env var is set,
which happens in the separate package.sh job. Neither dra.sh (stack_version
passed to dra-prep plugin) nor stage-dra-artifacts.sh (dependency CSV
filename) set it, so snapshot builds used the bare version instead of
matching the packaged artifacts.
dra.sh and stage-dra-artifacts.sh both needed to append "-SNAPSHOT" to
the mage-derived version for snapshot builds. Move that into a shared
resolve_dra_version() helper so the two copies can't drift again.
Copilot AI review requested due to automatic review settings September 2, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The new artifact staging/annotation scripts have confirmed failure modes that can drop nested artifacts and bypass intended error handling under set -euo pipefail.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

.buildkite/scripts/stage-dra-artifacts.sh:44

  • The staging step only copies top-level files from build/distributions into artifacts/ (via find ... -maxdepth 1 -type f), but the packaging job uploads build/distributions/**/* (see .buildkite/scripts/package.sh:33), so any nested artifacts/directories will be dropped and the dra-prep plugin may not see the full artifact set. Also, using the ${BASE_DIR}/* glob makes the failure mode an unhelpful chmod: cannot access ... rather than a clear "no artifacts downloaded" error.

Consider failing fast with an explicit check, and copy the entire distributions tree into artifacts/ preserving directory structure.
.buildkite/scripts/dra-annotate.sh:19

  • With set -euo pipefail, manifest=$(find ... | head -1) will exit the script early if the artifacts/dra/fleet-server directory is missing (because the pipeline fails under pipefail), so the subsequent -z check and custom error message won't run. Capture at most one match directly from find and tolerate a missing directory so the explicit error path is used.
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.x Automated backport to the 8.x branch with mergify backport-9.4 Automated backport to 9.4 branch. backport-9.5 Automated backport to the 9.5 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants