Skip to content
Open
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 .github/workflows/version_bumps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,6 +64,24 @@ 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' }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I know naming is hard, but I've found the bump type to be misleading here, is patch level rather than minor level?

  • major : from 9.x to 10.x, such as 9.0.0 or 10.0.0
  • minor: from 9.x to 9.x+1, such as 9.3.x to 9.4.0
  • patch: from 9.x.y to 9.x.y+1, such as 9.2.0 to 9.2.1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This step is intended to update selected gems at minor level and should only be exec when the bump type is patch.

run: |
AWS_GEMS=$(./vendor/jruby/bin/jruby -S bundle list --name-only | grep '^aws-')
EXTRA="${{ inputs.extra_gems_minor }}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

GEMS=$(echo "${AWS_GEMS} ${EXTRA}" | 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 != '' }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will that include minor and patches?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is possible that at some point (really unusual but harness to have it) we'd like some feature shipped with a new major dependency version while running patch/minor bump dependencies.

run: |
GEMS=$(echo "${{ inputs.extra_gems_major }}" | xargs)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
Expand Down
Loading