Skip to content

Improve version bump flexibility and automate AWS and sequel deps to minor automatically#19118

Open
alexcams wants to merge 1 commit into
elastic:mainfrom
alexcams:7160-logstash-improve-version-bump-flexibility
Open

Improve version bump flexibility and automate AWS and sequel deps to minor automatically#19118
alexcams wants to merge 1 commit into
elastic:mainfrom
alexcams:7160-logstash-improve-version-bump-flexibility

Conversation

@alexcams
Copy link
Copy Markdown
Contributor

@alexcams alexcams commented May 15, 2026

  • enhancement

Release notes

[rn:skip]

What does this PR do?

Automates AWS minor updates on lock file patch bumps and adds 2 config parameters, allowing selected gems to be updated to minor or major automatically, improving workflow flexibility.

Why is it important/What is the impact to the user?

It allows to select gems where a desired feature/fix has been shipped as minor/major release and also keeps up to date gemps that don't ship patch releases (AWS).

Related issues

Tests

Example job run and the resulting PR. Some gems were manually downgraded at target branch befor the workflow execution. elasticsearch and rubocop chose as selected minor gems input param, and redis as major.

@alexcams alexcams requested review from a team as code owners May 15, 2026 08:15
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • run exhaustive tests : Run the exhaustive tests Buildkite pipeline.

@alexcams alexcams added backport-9.3 Automated backport to the 9.3 branch backport-9.4 labels May 15, 2026
@alexcams alexcams changed the title 7160 logstash improve version bump flexibility Improve version bump flexibility and update external gems to minor automatically on patch runs. May 15, 2026
@alexcams alexcams force-pushed the 7160-logstash-improve-version-bump-flexibility branch 2 times, most recently from 3c7a074 to c357e5e Compare May 15, 2026 08:32
@donoghuc
Copy link
Copy Markdown
Member

do you have any example workflow runs or outputs/diffs to point to seeing how this works in action?

Dynamically generating sets of gems with the gem list + regex probably has some edge cases, but i'm not fully opposed to it. The other option would be to maintain a static list. The nice thing is that this action is just used to generate a PR which will be reviewed so we will have a built in check point to be monitoring the performance of whatever approach we go with.

@alexcams alexcams force-pushed the 7160-logstash-improve-version-bump-flexibility branch 3 times, most recently from 1d740df to fcae407 Compare May 18, 2026 08:40
@alexcams
Copy link
Copy Markdown
Contributor Author

alexcams commented May 18, 2026

@donoghuc Yes! here's the job eun and the resulting PR. As extra_gems_major input, I've set redis (previously downgraded manually )

I avoided creating and maintaining a separate list/file with the list of dependencies, I'm not really agains it, but I think would be easier using gem list+ regex. Anyway, it would be pretty straightforward to add a list of dependencies. WDYT?

@alexcams alexcams force-pushed the 7160-logstash-improve-version-bump-flexibility branch 2 times, most recently from c357e5e to 3947da9 Compare May 20, 2026 16:42
@alexcams alexcams changed the title Improve version bump flexibility and update external gems to minor automatically on patch runs. Improve version bump flexibility and automate AWS and sequel deps to minor automatically May 21, 2026
@alexcams alexcams force-pushed the 7160-logstash-improve-version-bump-flexibility branch 2 times, most recently from 42666bf to c18ee2d Compare May 21, 2026 09:43
- 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.

./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.

@alexcams alexcams force-pushed the 7160-logstash-improve-version-bump-flexibility branch from c18ee2d to 3947da9 Compare May 21, 2026 13:48
@alexcams
Copy link
Copy Markdown
Contributor Author

@donoghuc I sent back this PR to its first version where just AWS gems were automatically updated to minor and 2 new input parameters to select specific gems and provide more flexibility, following the comment in the 8.19 PR. It is described in the PR description with an example run and PR.

The thing I've doubts about is the backport, it looks like the workflow has diverged a lot between 8.19 and 9.x branches, that are almost up to date with main. I think this workflow is always run ffrom main(correct me if I'm wrong). Maybe ithe backport to all active is not needed. WDYT?

if: ${{ inputs.bump == '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.

- name: Bump selected deps at major level
if: ${{ inputs.bump != 'major' && inputs.extra_gems_major != '' }}
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.

@donoghuc
Copy link
Copy Markdown
Member

The thing I've doubts about is the backport, it looks like the workflow has diverged a lot between 8.19 and 9.x branches, that are almost up to date with main. I think this workflow is always run ffrom main(correct me if I'm wrong). Maybe ithe backport to all active is not needed. WDYT?

Unfortunately no. The reason is that the lockfile has a ruby version component to it, so you must run the workflow from the branch that you are doing the update for. For example if you try to run the workflow from main on 8.19 you will be using bundler/jruby 10 that tracks ruby 3.4 to attempt to manage the bundler/jruby env in 8.19 which is for jruby 9.4 that tracks ruby 3.1.

SO, with the current architecture we must do backports to all branches so that the workflow we run corresponds to the branch it is operating on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.3 Automated backport to the 9.3 branch backport-9.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants