Skip to content

Conversation

@donoghuc
Copy link
Member

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

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

@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2025

This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@donoghuc donoghuc added the backport-active-all Automated backport with mergify to all the active branches label Dec 19, 2025
@elasticmachine
Copy link

💚 Build Succeeded

Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

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

LGTM

@donoghuc donoghuc merged commit f36ba65 into elastic:main Dec 19, 2025
15 checks passed
@github-actions
Copy link
Contributor

@Mergifyio backport 8.19 9.1 9.2 9.3

@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2025

backport 8.19 9.1 9.2 9.3

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Dec 19, 2025
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)
mergify bot pushed a commit that referenced this pull request Dec 19, 2025
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)
mergify bot pushed a commit that referenced this pull request Dec 19, 2025
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)
mergify bot pushed a commit that referenced this pull request Dec 19, 2025
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)
donoghuc added a commit that referenced this pull request Dec 22, 2025
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)

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Dec 22, 2025
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)

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Dec 22, 2025
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)

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Dec 22, 2025
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)

Co-authored-by: Cas Donoghue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants