From 7ca28e5b34612e7f6f8b17cec8fc728f9e6724c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20C=C3=A1mara=20Lara?= Date: Tue, 26 May 2026 15:22:34 +0200 Subject: [PATCH] Improve version bump flexibility and automate AWS deps updates to minor automatically while patching dependencies(#19118) (cherry picked from commit f71e27b492f041a71baf101dc0d1b63a39e90f77) --- .github/workflows/version_bumps.yml | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/version_bumps.yml b/.github/workflows/version_bumps.yml index 4365b900d0..b6f915867f 100644 --- a/.github/workflows/version_bumps.yml +++ b/.github/workflows/version_bumps.yml @@ -5,7 +5,7 @@ on: branch: description: 'Release Branch' required: true - default: '8.4' + default: '9.4' type: string bump: description: 'Bump type' @@ -16,6 +16,16 @@ on: - "patch" - "minor" - "major" + extra_gems_minor: + description: 'Additional gems to bump at minor level (space-separated). AWS gems are always included automatically. Only used during patch runs.' + required: false + default: '' + type: string + extra_gems_major: + description: 'Gems to also bump at major level (space-separated). Used during patch or minor runs.' + required: false + default: '' + type: string permissions: pull-requests: write @@ -28,6 +38,8 @@ jobs: env: INPUTS_BRANCH: "${{ inputs.branch }}" INPUTS_BUMP: "${{ inputs.bump }}" + INPUTS_EXTRA_GEMS_MINOR: "${{ inputs.extra_gems_minor }}" + INPUTS_EXTRA_GEMS_MAJOR: "${{ inputs.extra_gems_major }}" BACKPORT_LABEL: "backport-${{ inputs.branch }}" steps: - name: Fetch logstash-core team member list @@ -49,6 +61,23 @@ jobs: - run: git config --global user.name "logstashmachine" - run: ./gradlew clean installDefaultGems - run: ./vendor/jruby/bin/jruby -S bundle update --all --${{ env.INPUTS_BUMP }} --strict + - name: Bump selected deps at minor level + if: ${{ inputs.bump == 'patch' }} + run: | + AWS_GEMS=$(./vendor/jruby/bin/jruby -S bundle list --name-only | grep '^aws-') + GEMS=$(echo "${AWS_GEMS} ${INPUTS_EXTRA_GEMS_MINOR}" | xargs) + if [ -n "$GEMS" ]; then + echo "Bumping at --minor: ${GEMS}" + ./vendor/jruby/bin/jruby -S bundle update $GEMS --minor --strict --conservative + fi + - name: Bump selected deps at major level + if: ${{ inputs.bump != 'major' && inputs.extra_gems_major != '' }} + run: | + GEMS=$(echo "${INPUTS_EXTRA_GEMS_MAJOR}" | xargs) + if [ -n "$GEMS" ]; then + echo "Bumping at --major: ${GEMS}" + ./vendor/jruby/bin/jruby -S bundle update $GEMS --major --strict --conservative + fi - run: mv Gemfile.lock Gemfile.jruby-*.lock.release - run: echo "T=$(date +%s)" >> $GITHUB_ENV - run: echo "BRANCH=update_lock_${{ env.INPUTS_BRANCH }}_${T}" >> $GITHUB_ENV