Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e125c90
mergify: support backports automation with labels
v1v Jan 23, 2025
19e3438
add copy labels for the backported PRs created with Mergify
v1v Jan 23, 2025
a75a52c
support pre-commit: to detect merge conflicts
v1v Jan 23, 2025
417ae95
missed
v1v Jan 23, 2025
f2ccbce
create github backport label
v1v Jan 24, 2025
a164988
deps: bump and validate inputs
v1v Jan 24, 2025
2321927
help with creating the mergify entry
v1v Jan 26, 2025
de3d0e3
refactor: use a makefile to help with testing locally
v1v Jan 26, 2025
b6cf79d
Merge branch 'main' into feature/support-mergify
v1v Jan 28, 2025
1106f78
integration tests: switch log input to filestream in filebeat (#16983)
jsvd Jan 29, 2025
96a2989
Update branches.json for 8.18 (#16981)
andsel Jan 29, 2025
01b3d1f
Remove sample breaking change from breaking changes doc (#16978)
robbavey Jan 29, 2025
67e006c
[wip] Changing upgrade docs to refer to `9.0` instead of `8.0` (#16977)
robbavey Jan 29, 2025
53e3450
Adding elastic_integration upgrade guidelines. (#16979)
mashhurs Jan 29, 2025
b216075
upgrade jdk to 21.0.6+7 (#16932)
jsvd Jan 30, 2025
75e9440
github-action: Add AsciiDoc freeze warning (#16969)
reakaleek Jan 30, 2025
5a6a8a4
Add 9.0 branch to the CI branches definition (#16997)
mashhurs Jan 30, 2025
26bb33a
Core version bump to 9.1.0 (#16991)
mashhurs Jan 30, 2025
2504cf8
Add short living 9.0 next and update main in CI release version defin…
mashhurs Jan 31, 2025
973a435
Fix BufferedTokenizer to properly resume after a buffer full conditio…
andsel Feb 5, 2025
3eba7f7
Release note placeholder might be empty, making parsing lines nil tol…
mashhurs Feb 5, 2025
b9a77cb
Don't honor VERSION_QUALIFIER if set but empty (#17032)
dliappis Feb 7, 2025
4f778f5
fix logstash-keystore to accept spaces in values when added via stdin…
kaisecheng Feb 7, 2025
3037707
Update logstash_releases.json (#17055)
yaauie Feb 11, 2025
7b47f18
Use centralized source of truth for active branches (#17063)
dliappis Feb 12, 2025
945adf4
Allow capturing heap dumps in DRA BK jobs (#17081)
dliappis Feb 13, 2025
0de154f
qa: use clean expansion of LS tarball per fixture instance (#17082)
yaauie Feb 14, 2025
6cc6f6b
CPM handle 404 response gracefully with user-friendly log (#17052)
kaisecheng Feb 17, 2025
d80705d
allow concurrent Batch deserialization (#17050)
jsvd Feb 17, 2025
9028351
spec: improve ls2ls spec (#17114)
yaauie Feb 19, 2025
3f734b1
plugins: improve `remove` command to support multiple plugins (#17030)
yaauie Feb 19, 2025
3e50919
Fix acceptance test assertions for updated plugin `remove` (#17122)
donoghuc Feb 19, 2025
866a9bb
Fix acceptance test assertions for updated plugin remove (#17126)
donoghuc Feb 20, 2025
8e3f644
entrypoint: avoid polluting stdout (#17125)
yaauie Feb 20, 2025
f55b8d9
Update container acceptance tests with stdout/stderr changes (#17138)
donoghuc Feb 21, 2025
e846feb
Add Windows 2025 to CI (#17133)
dliappis Feb 24, 2025
5b7c095
Merge remote-tracking branch 'upstream/main' into feature/support-mer…
v1v Feb 25, 2025
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
4 changes: 3 additions & 1 deletion .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"skip_ci_labels": [ ],
"skip_target_branches": [ ],
"skip_ci_on_only_changed": [
"^docs/",
"^.github/",
"^docs/",
"^.mergify.yml$",
"^.pre-commit-config.yaml",
"\\.md$"
],
"always_require_ci_on_changed": [ ]
Expand Down
47 changes: 47 additions & 0 deletions .ci/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.SILENT:
MAKEFLAGS += --no-print-directory
.SHELLFLAGS = -euc
SHELL = /bin/bash

#######################
## Templates
#######################
## Mergify template
define MERGIFY_TMPL

- name: backport patches to $(BRANCH) branch
conditions:
- merged
- base=main
- label=$(BACKPORT_LABEL)
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "$(BRANCH)"
labels:
- "backport"
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"
endef

# Add mergify entry for the new backport label
.PHONY: mergify
export MERGIFY_TMPL
mergify: BACKPORT_LABEL=$${BACKPORT_LABEL} BRANCH=$${BRANCH} PUSH_BRANCH=$${PUSH_BRANCH}
mergify:
@echo ">> mergify"
echo "$$MERGIFY_TMPL" >> ../.mergify.yml
git add ../.mergify.yml
git status
if [ ! -z "$$(git status --porcelain)" ]; then \
git commit -m "mergify: add $(BACKPORT_LABEL) rule"; \
git push origin $(PUSH_BRANCH) ; \
fi

# Create GitHub backport label
.PHONY: backport-label
backport-label: BACKPORT_LABEL=$${BACKPORT_LABEL}
backport-label:
@echo ">> backport-label"
gh label create $(BACKPORT_LABEL) --description "Automated backport with mergify" --color 0052cc --force
23 changes: 23 additions & 0 deletions .github/workflows/mergify-labels-copier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: mergify backport labels copier

on:
pull_request:
types:
- opened

permissions:
contents: read

jobs:
mergify-backport-labels-copier:
runs-on: ubuntu-latest
if: startsWith(github.head_ref, 'mergify/bp/')
permissions:
# Add GH labels
pull-requests: write
# See https://github.com/cli/cli/issues/6274
repository-projects: read
steps:
- uses: elastic/oblt-actions/mergify/labels-copier@v1
with:
excluded-labels-regex: "^backport-*"
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: pre-commit

on:
pull_request:
push:
branches:
- main
- 8.*
- 9.*
Comment on lines +7 to +9
Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to skip 7.17 for the pre-commit validation.


permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: elastic/oblt-actions/pre-commit@v1
29 changes: 23 additions & 6 deletions .github/workflows/version_bumps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ jobs:
version_bumper:
name: Bump versions
runs-on: ubuntu-latest
env:
INPUTS_BRANCH: "${{ inputs.branch }}"
INPUTS_BUMP: "${{ inputs.bump }}"
Comment on lines +28 to +30
Copy link
Member Author

Choose a reason for hiding this comment

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

Best practice to avoid shell injection

BACKPORT_LABEL: "backport-${{ inputs.branch }}"
steps:
- name: Fetch logstash-core team member list
uses: tspascoal/get-user-teams-membership@v1
uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 #v3.0.0
Copy link
Member Author

Choose a reason for hiding this comment

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

Best practice, tags are mutable.

with:
username: ${{ github.actor }}
organization: elastic
Expand All @@ -37,14 +41,14 @@ jobs:
if: ${{ steps.checkUserMember.outputs.isTeamMember == 'false' }}
run: exit 1
- name: checkout repo content
uses: actions/checkout@v2
uses: actions/checkout@v4
Copy link
Member Author

Choose a reason for hiding this comment

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

Best practice, update checkout, we trust actions/checkout

with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
ref: ${{ env.INPUTS_BRANCH }}
- run: git config --global user.email "43502315+logstashmachine@users.noreply.github.com"
- run: git config --global user.name "logstashmachine"
- run: ./gradlew clean installDefaultGems
- run: ./vendor/jruby/bin/jruby -S bundle update --all --${{ github.event.inputs.bump }} --strict
- run: ./vendor/jruby/bin/jruby -S bundle update --all --${{ env.INPUTS_BUMP }} --strict
- run: mv Gemfile.lock Gemfile.jruby-*.lock.release
- run: echo "T=$(date +%s)" >> $GITHUB_ENV
- run: echo "BRANCH=update_lock_${T}" >> $GITHUB_ENV
Expand All @@ -53,8 +57,21 @@ jobs:
git add .
git status
if [[ -z $(git status --porcelain) ]]; then echo "No changes. We're done."; exit 0; fi
git commit -m "Update ${{ github.event.inputs.bump }} plugin versions in gemfile lock" -a
git commit -m "Update ${{ env.INPUTS_BUMP }} plugin versions in gemfile lock" -a
git push origin $BRANCH

- name: Update mergify (minor only)
if: ${{ inputs.bump == 'minor' }}
continue-on-error: true
run: make -C .ci mergify BACKPORT_LABEL=$BACKPORT_LABEL BRANCH=$INPUTS_BRANCH PUSH_BRANCH=$BRANCH

- name: Create Pull Request
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d "{\"title\": \"bump lock file for ${{ github.event.inputs.branch }}\",\"head\": \"${BRANCH}\",\"base\": \"${{ github.event.inputs.branch }}\"}" https://api.github.com/repos/elastic/logstash/pulls
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d "{\"title\": \"bump lock file for ${{ env.INPUTS_BRANCH }}\",\"head\": \"${BRANCH}\",\"base\": \"${{ env.INPUTS_BRANCH }}\"}" https://api.github.com/repos/elastic/logstash/pulls

- name: Create GitHub backport label (Mergify) (minor only)
if: ${{ inputs.bump == 'minor' }}
continue-on-error: true
Comment on lines +72 to +74
Copy link
Member Author

Choose a reason for hiding this comment

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

Only for minor releases we create the backport labels. for major releases is not needed

run: make -C .ci backport-label BACKPORT_LABEL=$BACKPORT_LABEL
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114 changes: 114 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
pull_request_rules:
- name: ask to resolve conflict
conditions:
- conflict
actions:
comment:
message: |
This pull request is now in conflicts. Could you fix it @{{author}}? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
```
git fetch upstream
git checkout -b {{head}} upstream/{{head}}
git merge upstream/{{base}}
git push upstream {{head}}
```

- name: notify the backport policy
conditions:
- -label~=^backport
- base=main
actions:
comment:
message: |
This pull request does not have a backport label. Could you fix it @{{author}}? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:
* `backport-8./d` is the label to automatically backport to the `8./d` branch. `/d` is the digit.
* `backport-8.x` is the label to automatically backport to the `8.x` branch.

- name: add backport-8.x for the all the PRs targeting main if no skipped or assigned already
conditions:
- -label~=^(backport-skip|backport-8.x)$
- base=main
actions:
comment:
message: |
`backport-8.x` has been added to help with the transition to the new branch `8.x`.
If you don't need it please use `backport-skip` label.
label:
add:
- backport-8.x

- name: remove backport-skip label
conditions:
- label~=^backport-\d
actions:
label:
remove:
- backport-skip

- name: remove backport-8.x label if backport-skip is present
conditions:
- label~=^backport-skip
actions:
label:
remove:
- backport-8.x

- name: notify the backport has not been merged yet
conditions:
- -merged
- -closed
- author=mergify[bot]
- "#check-success>0"
- schedule=Mon-Mon 06:00-10:00[Europe/Paris]
actions:
comment:
message: |
This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏

- name: backport patches to 8.x branch
conditions:
- merged
- base=main
- label=backport-8.x
actions:
backport:
assignees:
- "{{ author }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

this is awesome because the BK bot will be able to ping the author if there are failures / flakiness via the comment.

branches:
- "8.x"
labels:
- "backport"
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"

- name: backport patches to 8.16 branch
conditions:
- merged
- base=main
- label=backport-8.16
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "8.16"
labels:
- "backport"
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"

- name: backport patches to 8.17 branch
conditions:
- merged
- base=main
- label=backport-8.17
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "8.17"
labels:
- "backport"
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-merge-conflict
args: ['--assume-in-merge']