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

[Refactor] Version and LegacyESVersion from server module to core lib #7328

Merged
merged 2 commits into from
May 1, 2023

Conversation

nknize
Copy link
Collaborator

@nknize nknize commented Apr 28, 2023

Refactors the Version and LegacyESVersion classes from the server module to the core library. All gradle build scripts and dependencies are updated. This commit serves as a foundation for refactoring all OpenSearch base classes from the server module into appropriate libraries to decouple core search logic from the cluster model so it can be reused in serverless and cloud native environments.

relates #5910

Refactors the Version and LegacyESVersion classes from the server module
to the core library. All gradle build scripts and dependencies are
updated. This commit serves as a foundation for refactoring all
OpenSearch base classes from the server module into appropriate
libraries to decouple core search logic from the cluster model so
it can be reused in serverless and cloud native environments.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@nknize nknize added enhancement Enhancement or improvement to existing feature or request skip-changelog v2.8.0 'Issues and PRs related to version v2.8.0' labels Apr 28, 2023
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #7328 (40c7853) into main (d984f50) will decrease coverage by 0.10%.
The diff coverage is 85.36%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #7328      +/-   ##
============================================
- Coverage     70.71%   70.61%   -0.10%     
+ Complexity    59497    59421      -76     
============================================
  Files          4859     4859              
  Lines        285339   285340       +1     
  Branches      41133    41133              
============================================
- Hits         201772   201489     -283     
- Misses        66965    67242     +277     
- Partials      16602    16609       +7     
Impacted Files Coverage Δ
.../opensearch/gradle/info/GlobalBuildInfoPlugin.java 38.46% <0.00%> (ø)
libs/core/src/main/java/org/opensearch/Build.java 66.66% <ø> (ø)
.../src/main/java/org/opensearch/LegacyESVersion.java 63.10% <0.00%> (ø)
...ibs/core/src/main/java/org/opensearch/Version.java 76.73% <0.00%> (ø)
...admin/indices/upgrade/post/ShardUpgradeResult.java 0.00% <0.00%> (ø)
...on/admin/indices/upgrade/post/UpgradeResponse.java 0.00% <0.00%> (ø)
...n/indices/upgrade/post/UpgradeSettingsRequest.java 0.00% <0.00%> (ø)
.../main/java/org/opensearch/env/NodeEnvironment.java 77.73% <ø> (-0.19%) ⬇️
...a/org/opensearch/extensions/ExtensionsManager.java 45.25% <ø> (ø)
...rg/opensearch/index/translog/RemoteFsTranslog.java 74.37% <ø> (ø)
... and 31 more

... and 458 files with indirect coverage changes

@dblock dblock merged commit 142ae46 into opensearch-project:main May 1, 2023
@ashking94 ashking94 added the backport 2.x Backport to 2.x branch label May 23, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7328-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 142ae4611042669c9511a81a014828ca22376afc
# Push it to GitHub
git push --set-upstream origin backport/backport-7328-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7328-to-2.x.

@ashking94 ashking94 removed the backport 2.x Backport to 2.x branch label May 23, 2023
@ashking94
Copy link
Member

@nknize @dblock Is this supposed to be backported to 2.x?

@dblock
Copy link
Member

dblock commented May 23, 2023

I don't know, @nknize?

@Xtansia
Copy link
Contributor

Xtansia commented May 29, 2023

@nknize This refactoring looks to have broken the check here https://github.com/opensearch-project/OpenSearch/blob/main/libs/core/src/main/java/org/opensearch/Build.java#L112-L149 as it's based on the code source location of the Build class. The code expects it to still be in opensearch-3.0.0-SNAPSHOT.jar but it is now in opensearch-core-3.0.0-SNAPSHOT.jar causing it to return unknown for build hash and build date.

Xtansia added a commit to Xtansia/OpenSearch that referenced this pull request May 29, 2023
…search-{version}.jar`.

Fixes breakage introduced in opensearch-project#7328, causing `GET /` to return "unknown" for build hash and date.
Xtansia added a commit to Xtansia/OpenSearch that referenced this pull request May 29, 2023
…search-{version}.jar`.

Fixes breakage introduced in opensearch-project#7328, causing `GET /` to return "unknown" for build hash and date.

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
@Xtansia Xtansia mentioned this pull request May 29, 2023
6 tasks
Xtansia added a commit to Xtansia/OpenSearch that referenced this pull request May 30, 2023
…search-{version}.jar`.

Fixes breakage introduced in opensearch-project#7328, causing `GET /` to return "unknown" for build hash and date.

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
Xtansia added a commit to Xtansia/OpenSearch that referenced this pull request May 30, 2023
…search-{version}.jar`.

Fixes breakage introduced in opensearch-project#7328, causing `GET /` to return "unknown" for build hash and date.

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
@nknize nknize added the backport 2.x Backport to 2.x branch label Jun 28, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7328-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 142ae4611042669c9511a81a014828ca22376afc
# Push it to GitHub
git push --set-upstream origin backport/backport-7328-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7328-to-2.x.

nknize added a commit to nknize/OpenSearch that referenced this pull request Jun 30, 2023
…opensearch-project#7328)

Refactors the Version and LegacyESVersion classes from the server module
to the core library. All gradle build scripts and dependencies are
updated. This commit serves as a foundation for refactoring all
OpenSearch base classes from the server module into appropriate
libraries to decouple core search logic from the cluster model so
it can be reused in serverless and cloud native environments.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@nknize nknize added v2.9.0 'Issues and PRs related to version v2.9.0' and removed v2.8.0 'Issues and PRs related to version v2.8.0' labels Jun 30, 2023
nknize added a commit to nknize/OpenSearch that referenced this pull request Jul 5, 2023
…opensearch-project#7328)

Refactors the Version and LegacyESVersion classes from the server module
to the core library. All gradle build scripts and dependencies are
updated. This commit serves as a foundation for refactoring all
OpenSearch base classes from the server module into appropriate
libraries to decouple core search logic from the cluster model so
it can be reused in serverless and cloud native environments.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
andrross pushed a commit that referenced this pull request Jul 5, 2023
…#7328) (#8382)

Refactors the Version and LegacyESVersion classes from the server module
to the core library. All gradle build scripts and dependencies are
updated. This commit serves as a foundation for refactoring all
OpenSearch base classes from the server module into appropriate
libraries to decouple core search logic from the cluster model so
it can be reused in serverless and cloud native environments.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…opensearch-project#7328)

* [Refactor] Version and LegacyESVersion to core lib

Refactors the Version and LegacyESVersion classes from the server module
to the core library. All gradle build scripts and dependencies are
updated. This commit serves as a foundation for refactoring all
OpenSearch base classes from the server module into appropriate
libraries to decouple core search logic from the cluster model so
it can be reused in serverless and cloud native environments.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* fix javadoc

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

---------

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch enhancement Enhancement or improvement to existing feature or request skip-changelog v2.9.0 'Issues and PRs related to version v2.9.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants