Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/check-dev-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ jobs:
- uses: actions/setup-go@v7
with:
go-version-file: .go-version
- uses: actions/setup-python@v7
# ubuntu-latest (26.04+) has no actions/python-versions build for 3.9.x
- name: Setup Python
uses: actions/setup-python@v7
with:
cache: "pip"
python-version-file: .python-version
python-version: '3.10'
- name: Run check/update
run: |
go install github.com/magefile/mage
Expand Down
2,200 changes: 1,963 additions & 237 deletions NOTICE.txt

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Beats Release Automation

Release-manager guide for Beats feature-freeze and patch releases using mage.

For commands, environment variables, file lists, and troubleshooting, see
[dev-tools/mage/release/README.md](dev-tools/mage/release/README.md).

## When to run which workflow

| Situation | Version shape | Command |
|-----------|---------------|---------|
| Feature freeze / major or minor release | `X.Y.0` (e.g. `9.5.0`) | `mage release:runMajorMinor` |
| Patch release on an existing branch | `X.Y.Z` with `Z > 0` (e.g. `9.2.1`) | `mage release:runPatch` |
| Refresh the Beats release checklist issue only | any `NEXT_RELEASE` | `mage release:ensureIssueTracker` |

Minor feature-freeze releases for 6.x, 7.x, and 8.x are blocked. Patch releases
are allowed for all supported versions.

Release notes are **not** produced by mage. Use
[`.github/workflows/release-notes.yml`](.github/workflows/release-notes.yml)
separately.

## Quick Start

Always prefer `DRY_RUN=true` first. `GITHUB_TOKEN` is required only when not in
dry-run mode.

### Feature freeze (e.g. 9.5.0)

```bash
export NEXT_RELEASE="9.5.0"
export GITHUB_TOKEN="ghp_your_token"
export DRY_RUN=true

mage release:runMajorMinor

# Review local branches and diffs, then:
export DRY_RUN=false
mage release:runMajorMinor
```

### Patch release (e.g. 9.2.1)

```bash
git checkout 9.2
git pull

export NEXT_RELEASE="9.2.1"
export BASE_BRANCH="9.2"
export GITHUB_TOKEN="ghp_your_token"
export DRY_RUN=true

mage release:runPatch

# Review, then:
export DRY_RUN=false
mage release:runPatch
```

## What feature freeze produces

Creates the release branch (e.g. `9.5` from `main`) and opens **3 grouped PRs**.

`NEXT_RELEASE` must already match `libbeat/version/version.go` on `BASE_BRANCH`
(set by the previous cycle's next-minor version bump). The workflow fails fast if
they differ. Next-patch bumps are **not** opened here; use `runPatch` after the
patch release trigger.

Merge order matters; labels encode timing. Titles are prefixed with
`[Release <NEXT_RELEASE>]`.

| Order | PR | Target | Merge label | Purpose |
|-------|-----|--------|-------------|---------|
| 1 | PR-A | `main` | `merge:1-ff-day` | Mergify backport rule + bump `version.go` to next minor |
| 2 | PR-B | release branch | `merge:2-after-branch` | Feature-freeze version, docs, test env, `make update` |
| 3 | PR-C | `main` | `merge:3-after-images` | Docs + test env for the next minor |

**RM merge order:** push release branch → merge PR-A → merge PR-B → merge PR-C.

## What a patch release produces

Runs on the existing release branch and opens **1 PR**: the post-release version
bump to `NEXT_RELEASE` (`NEW_VERSION` from version-bump), plus Beats test-env.
Docs stay off this path.

`NEXT_RELEASE` must have patch `> 0`, and `version.go` on the release branch
must equal the previous patch on the same line. The workflow fails fast otherwise.

| Order | PR | Target | Merge label | Purpose |
|-------|-----|--------|-------------|---------|
| 1 | bump | release branch | `merge:4-after-release` | `version.go` → CURRENT + test-env (`LATEST=prev`) |

Titles are prefixed with `[Release <NEXT_RELEASE>]`.

**RM merge order:** merge the bump PR promptly after the patch job opens it.
Release notes stay on the separate GitHub Actions workflow.

Both `runMajorMinor` and `runPatch` finish by ensuring a Beats issue titled
`[RELEASE <NEXT_RELEASE>] Instructions & Checklist` exists (create or update).
The issue links https://github.com/elastic/ingest-dev/issues/8866 and lists
related Beats PRs with label `release` for that version. That step is
**best-effort**: a tracker failure is logged as a warning and does not fail the
release workflow. Re-run anytime with `mage release:ensureIssueTracker`.

## Release manager checklist

1. Set `NEXT_RELEASE` (and `BASE_BRANCH` for patches).
2. Run with `DRY_RUN=true` and review branches / `git diff`.
3. Re-run with `DRY_RUN=false` to push and open PRs (also creates/updates the release issue tracker).
4. Merge PRs in label order (`merge:1-…` before `merge:2-…`, and so on).
5. Generate release notes via the separate GitHub Actions workflow when needed.
6. Optionally re-run `mage release:ensureIssueTracker` if more `release`-labeled PRs appear later.

## More detail

Operator and developer documentation (full env table, individual mage targets,
DRY_RUN behavior, files touched, FAQ, troubleshooting):

→ [dev-tools/mage/release/README.md](dev-tools/mage/release/README.md)
Loading
Loading