-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improve version bump flexibility and automate AWS and sequel deps to minor automatically #19118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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' }} | ||
| run: | | ||
| AWS_GEMS=$(./vendor/jruby/bin/jruby -S bundle list --name-only | grep '^aws-') | ||
| EXTRA="${{ inputs.extra_gems_minor }}" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 != '' }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will that include minor and patches?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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.