Skip to content
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

[8.x] Pluginmanager install preserve (backport #17267) #17268

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Mar 6, 2025

Release notes

[rn:skip]

What does this PR do?

Fixes a regression introduced in #17203 that caused the bin/logstash-plugin install --preserve flag to not preserve.

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

  • When a plugin is installed with --version, the Gemfile is amended to add the plugin and its version requirement.
  • When this version requirement is present, installing it again with the --preserve flag should preserve the requirement.
  • A fix to allow plugins installed with --version to be upgraded had the side-effect of making the install command's --preserve not work.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

How to test this PR locally

This PR comes with tests and a fix separately. The tests can be used to verify the pre-broken behaviour as so:

  1. check out the branch
  2. revert the fixing commit and observe test failures:
    back-out the portion of the breaking commit
    git revert --no-commit HEAD
    ci/integration_tests.sh specs/cli/install_spec.rb
    
  3. revert the portion of Pluginmanager clean after mutate #17203 that caused the regression, and observe that tests pass:
    git diff 8c969138073b98de7a99daf3c62527e5758711f9^! -- lib/pluginmanager/gemfile.rb | patch --strip 1 --reverse
    ci/integration_tests.sh specs/cli/install_spec.rb
    

This is an automatic backport of pull request #17267 done by [Mergify](https://mergify.com).

* tests: integration tests for pluginmanager install --preserve

* fix regression where pluginmanager's install --preserve flag didn't

(cherry picked from commit a736178)

# Conflicts:
#	qa/integration/specs/cli/install_spec.rb
#	qa/integration/specs/cli/pluginmanager_spec_helper.rb
Copy link
Author

mergify bot commented Mar 6, 2025

Cherry-pick of a736178 has failed:

On branch mergify/bp/8.x/pr-17267
Your branch is up to date with 'origin/8.x'.

You are currently cherry-picking commit a736178d.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   lib/pluginmanager/install.rb

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   qa/integration/specs/cli/install_spec.rb
	deleted by us:   qa/integration/specs/cli/pluginmanager_spec_helper.rb

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@donoghuc
Copy link
Member

donoghuc commented Mar 6, 2025

Closing in favor of #17270

@donoghuc donoghuc closed this Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants