Skip to content
Open
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
28 changes: 28 additions & 0 deletions .buildkite/version_bump_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@ steps:
logstash-version: "${NEW_VERSION}"
logstash-branch: "${BRANCH}"

- group: "Bump version minor"
if: build.env("WORKFLOW") == "minor"
steps:
- label: "Bump version minor - branch/versions"
key: bump-version-minor-branch-versions
plugins:
- elastic/vault-github-token#v0.1.0:
- elastic/gh-cli#v0.1.1:
version: "2.88.1"
wait: true
workflow-file: "bump-minor-logstash.yml"
workflow-ref: "main"
workflow-inputs:
logstash-version: "${NEW_VERSION}"
logstash-branch: "${BRANCH}"

- label: "Bump version minor - dependencies"
depends_on: bump-version-minor-branch-versions
plugins:
- elastic/vault-github-token#v0.1.0:
- elastic/gh-cli#v0.1.1:
version: "2.88.1"
wait: true
workflow-file: "version_bumps.yml"
workflow-ref: "${BRANCH}"
workflow-inputs:
bump: "minor"

- block: "Ready to fetch for DRA artifacts?"
prompt: |
Unblock when your team is ready to proceed.
Expand Down
149 changes: 149 additions & 0 deletions .github/workflows/bump-minor-logstash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: bump-minor-logstash-version

# Automates the "Before feature freeze" pull-request-opening
# steps of the minor release checklist, up to (but not including) the
# "Week before release" section:
# https://github.com/elastic/ingest-dev/blob/main/.github/ISSUE_TEMPLATE/logstash-release-checklist-minor.md
#
# Purely manual steps (QA testing, doc coordination, DRA monitoring, Slack
# notifications, etc.) are intentionally NOT automated here.

on:
workflow_dispatch:
inputs:
logstash-version:
description: 'New release branch initial version (example: 9.1.0)'
required: true
type: string
logstash-branch:
description: 'New release branch to create (example: 9.1)'
required: true
type: string
next-minor-version:
description: 'Version main should move to after the branch is cut (example: 9.2.0). Optional; when omitted it is computed by bumping the minor of logstash-version.'
required: false
type: string
skip-branch-creation:
description: 'Skip creating the new release branch (use when logstash-branch is the last minor version of a major).'
required: false
type: boolean
default: false
Comment on lines +26 to +30

permissions:
contents: read

jobs:
# "Before feature freeze" - check and unpin any active pins in the gemspec/Gemfile.
check-and-unpin-dependencies:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: main
- uses: elastic/oblt-actions/git/setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Find undocumented exact-version pins
id: unpin
run: |
# Any gem pinned with an exact "=" version constraint that does not carry
# an explanatory inline comment is treated as a candidate for unpinning.
FILES="Gemfile.template logstash-core/logstash-core.gemspec"
CHANGED=0
for f in $FILES; do
[ -f "$f" ] || continue
while IFS= read -r line; do
echo "Candidate pin in $f: $line"
CHANGED=1
done < <(grep -nE "['\"]= [0-9]" "$f" | grep -v "#" || true)
done
echo "changed=$CHANGED" >> "$GITHUB_OUTPUT"
- name: Open PR if any undocumented pins were found
if: steps.unpin.outputs.changed == '1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH="unpin_check_$(date +%s)"
git checkout -b "$BRANCH"
git commit --allow-empty -m "Reminder: review active dependency pins before feature freeze"
git push origin "$BRANCH"
gh pr create \
--title "Review active dependency pins before feature freeze" \
--body "Undocumented exact-version pins were found in Gemfile.template or logstash-core.gemspec. Please review whether they can be unpinned before feature freeze." \
--base main \
--head "$BRANCH"

# "Before feature freeze" - create the new release branch on elastic/logstash
create-release-branch:
if: ${{ inputs.skip-branch-creation != true }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: main
fetch-depth: 0
- name: Create release branch on elastic/logstash
Comment thread
v1v marked this conversation as resolved.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOGSTASH_BRANCH: ${{ inputs.logstash-branch }}
run: |
if git ls-remote --exit-code --heads origin "${LOGSTASH_BRANCH}" > /dev/null 2>&1; then
echo "Branch ${LOGSTASH_BRANCH} already exists, skipping creation."
else
git push origin "HEAD:refs/heads/${LOGSTASH_BRANCH}"
fi

Comment thread
v1v marked this conversation as resolved.
# "Before feature freeze" - update versions.yml on main to the next minor.
bump-versions-yml-main:
needs: [create-release-branch]
if: always() && (needs.create-release-branch.result == 'success' || needs.create-release-branch.result == 'skipped')
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: main
- uses: elastic/oblt-actions/git/setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compute next minor version
id: next
env:
NEXT_MINOR_VERSION: ${{ inputs.next-minor-version }}
LOGSTASH_VERSION: ${{ inputs.logstash-version }}
run: |
if [ -n "$NEXT_MINOR_VERSION" ]; then
echo "version=${NEXT_MINOR_VERSION}" >> "$GITHUB_OUTPUT"
else
IFS='.' read -r major minor _patch <<< "$LOGSTASH_VERSION"
echo "version=${major}.$((minor + 1)).0" >> "$GITHUB_OUTPUT"
fi
- name: Update versions.yml on main
run: |
NEXT_VERSION="${{ steps.next.outputs.version }}"
sed -i "s/^logstash: .*/logstash: ${NEXT_VERSION}/" versions.yml
sed -i "s/^logstash-core: .*/logstash-core: ${NEXT_VERSION}/" versions.yml
- name: Open PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOGSTASH_BRANCH: ${{ inputs.logstash-branch }}
run: |
NEXT_VERSION="${{ steps.next.outputs.version }}"
BRANCH="bump_versions_yml_main_${NEXT_VERSION}"
git add versions.yml
if [ -z "$(git status --porcelain)" ]; then echo "No changes. We're done."; exit 0; fi
git checkout -b "$BRANCH"
git commit -m "Bump versions.yml on main to ${NEXT_VERSION}"
git push origin "$BRANCH"
gh pr create \
--title "Bump versions.yml on main to ${NEXT_VERSION}" \
--body "Move main forward to the next minor version now that ${LOGSTASH_BRANCH} has been branched off." \
--base main \
--head "$BRANCH"
Loading