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

Add this repo to core's version.properties for plugins to have seamless access #205

Closed
DarshitChanpura opened this issue Jul 26, 2022 · 1 comment

Comments

@DarshitChanpura
Copy link
Member

Security plugin (among other plugins) uses common_utils_version to get common-utils version dynamically based on opensearch-build's version.

opensearch_version = System.getProperty("opensearch.version", "2.2.0-SNAPSHOT")
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
common_utils_version = System.getProperty("common_utils.version", opensearch_build);

This is breaking the build because build.gradle is expecting common-utils to be available with version 2.2.0.0 but it is not out yet. This will block PRs from getting merged. A temporary solution to fix this is to hard-code common_utils_version property to latest stable version.

Proposed Solution:
Since hard-coding is not a good practice, and other plugins might be similarly affected by this issue, common-utils version should be added to version.properties file in core, to enable other plugins to easily access this dependency in build.gradle using something like:

testImplementation "org.opensearch:common-utils:${versions.common_utils}"

And common-utils can create a PR against core to update the core's version.properties each time there is a new release.

@dblock
Copy link
Member

dblock commented Jul 26, 2022

Common-utils version cannot be added in core because it depends on core, and it would be a chicken-and-egg problem.

Hard-coding common-utils to a stable version will lead to broken software because versions must match.

Since you have a dependency on common-utils and all versions must match, I think the right thing to do is to wait for common-utils to increment its version and publish a SNAPSHOT. You can always PR that here when you find yourself in that situation. There's an effort to automate that away in #106.

Feel free to comment/reopen if I missed something.

@dblock dblock closed this as completed Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants