Skip to content

Conversation

jsvd
Copy link
Member

@jsvd jsvd commented Jul 29, 2025

this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs. From what I can gleam this isn't an anti-pattern, but happy to be convinced otherwise.

Exhaustive test suite: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/2179/steps/canvas

@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Jul 29, 2025

This pull request does not have a backport label. Could you fix it @jsvd? 🙏
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

@elastic-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

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

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

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

I like the idea to avoid duplication.

I tried with the input java test plugin (https://github.com/logstash-plugins/logstash-input-java_input_example) and ./gradlew clean test fails with:

FAILURE: Build failed with an exception.

* Where:
Script '/Users/andrea/workspace/logstash_andsel/rubyUtils.gradle' line: 27

* What went wrong:
A problem occurred evaluating script.
> Cannot get property 'versions' on extra properties extension as it does not exist

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s

We have to understand if we want to support that example or not.

@jsvd
Copy link
Member Author

jsvd commented Jul 31, 2025

@andsel I've addressed the java plugin issue by tweaking the plugin's build.gradle here logstash-plugins/logstash-input-java_input_example#19

This would have to be replicated to the other example plugins. I couldn't find a more elegant solution, unfortunately.

@jsvd jsvd requested a review from andsel July 31, 2025 09:19
Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

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

LGTM

@jsvd jsvd added backport-9.0 Automated backport to the 9.0 branch with mergify backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch labels Aug 1, 2025
@jsvd jsvd merged commit b430599 into elastic:main Aug 1, 2025
14 checks passed
@jsvd jsvd deleted the dry_version_yml_loading branch August 1, 2025 17:08
mergify bot pushed a commit that referenced this pull request Aug 1, 2025
this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs.

(cherry picked from commit b430599)

# Conflicts:
#	rubyUtils.gradle
mergify bot pushed a commit that referenced this pull request Aug 1, 2025
this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs.

(cherry picked from commit b430599)

# Conflicts:
#	rubyUtils.gradle
mergify bot pushed a commit that referenced this pull request Aug 1, 2025
this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs.

(cherry picked from commit b430599)
jsvd added a commit to jsvd/logstash that referenced this pull request Aug 1, 2025
this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs.
jsvd added a commit that referenced this pull request Aug 4, 2025
…7901)

this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs.

(cherry picked from commit b430599)

Co-authored-by: João Duarte <[email protected]>
jsvd added a commit that referenced this pull request Aug 4, 2025
… gradle.ext (#17900)

* make sure versions.yml is only read once into gradle.ext (#17865)

this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs.

(cherry picked from commit b430599)

# Conflicts:
#	rubyUtils.gradle

* Update rubyUtils.gradle

---------

Co-authored-by: João Duarte <[email protected]>
jsvd added a commit that referenced this pull request Aug 4, 2025
…o gradle.ext (#17899)

* make sure versions.yml is only read once into gradle.ext (#17865)

this removes the need to re-read the yaml file in so many places, and also avoids having to state the jruby version an extra time in the rubyUtils.gradle

It uses gradle.ext, computed in settings.gradle, as a place to store the versions. This is important to load the versions before any other buildscript {} block runs.

(cherry picked from commit b430599)

# Conflicts:
#	rubyUtils.gradle

* Update rubyUtils.gradle

* Update build.gradle

* Update build.gradle

---------

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

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.0 Automated backport to the 9.0 branch with mergify backport-9.1 Automated backport to the 9.1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants