Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 19, 2025

Release notes

[rn:skip]

What does this PR do?

The pluginmanager tests modify ~/.m2/settings.xml. Previously when that file exists it would be restored on test cleanup. However if that file did not exist prior to the tests, the file with nonsense values generated during testing would persist. This would cause subsequent issues when the pluginmanager or other systems that respect those maven settings. This commit updates the test to ensure the test file is deleted if it did not previously exist.

Previously any developer who run the tests locally and did not have an existing ~/.m2/settings.xml would get a file with nonsense proxies which would break the pluginmanager's ability to download jar dependencies of gems.

NOTE: Fortunately this did not affect logstash artifact creation because we do testing/packaging on separate hosts.

How to test this PR locally

# Ensure ~/.m2/settings.xml is empty or has "real" config in it
cat ~/.m2/settings.xml
# run tests 
./gradlew rubyTests
# Ensure settings.xml is the same (or does not exist if it did not previously). 
cat ~/.m2/settings.xml

Logs

Previously the tests would leave behing a file like:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
  https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <proxies>
    
    <proxy>
      <id>local.dev.0</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>local.dev</host>
      <port>9898</port>
      <username>a</username>
      <password>b</password>
    </proxy>
  
    <proxy>
      <id>local.dev.1</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>local.dev</host>
      <port>9898</port>
      <username>c</username>
      <password>d</password>
    </proxy>
  
  </proxies>
</settings>

This would cause issues with the pluginmanager when jar-dependencies need to dowload jars for gem installation. Unfortunately that is masked because of retry logic (the jar is failed to be downlaoded but the rest of the gem code is, so on the second retry the pluginmanager thinks the complete gem has been installed).


This is an automatic backport of pull request #18525 done by Mergify.

The pluginmanager tests modify `~/.m2/settings.xml`. Previously when that file
exists it would be restored on test cleanup. However if that file did not exist
prior to the tests, the file with nonsense values generated during testing would
persist. This would cause subsequent issues when the pluginmanager or other
systems that respect those maven settings. This commit updates the test to
ensure the test file is deleted if it did not previously exist.

(cherry picked from commit f36ba65)
@github-actions
Copy link
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.

@elasticmachine
Copy link

💚 Build Succeeded

cc @donoghuc

@mergify
Copy link
Contributor Author

mergify bot commented Dec 22, 2025

This pull request has not been merged yet. Could you please review and merge it @donoghuc? 🙏

@donoghuc donoghuc merged commit cd6a199 into 8.19 Dec 22, 2025
12 checks passed
@donoghuc donoghuc deleted the mergify/bp/8.19/pr-18525 branch December 22, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants