Skip to content

Move Randomness from server to lib/common#20570

Merged
cwperks merged 2 commits intoopensearch-project:mainfrom
cwperks:slim-fips-installer
Feb 8, 2026
Merged

Move Randomness from server to lib/common#20570
cwperks merged 2 commits intoopensearch-project:mainfrom
cwperks:slim-fips-installer

Conversation

@cwperks
Copy link
Copy Markdown
Member

@cwperks cwperks commented Feb 6, 2026

Description

Move Randomness from server to lib/common to reduce the size of the fips demo installer.

ls -latr /Users/cwperx/Projects/opensearch/OpenSearch/build/distribution/local/opensearch-3.6.0-SNAPSHOT/lib/tools/fips-demo-installer-cli
total 18240
-rw-r--r--@ 1 cwperx  staff   417640 Feb  6 17:23 picocli-4.7.7.jar
-rw-r--r--@ 1 cwperx  staff    78146 Feb  6 17:23 jopt-simple-5.0.4.jar
-rw-r--r--@ 1 cwperx  staff   155669 Feb  6 17:23 opensearch-common-3.6.0-SNAPSHOT.jar
-rw-r--r--@ 1 cwperx  staff     7420 Feb  6 17:23 java-version-checker-3.6.0-SNAPSHOT.jar
-rw-r--r--@ 1 cwperx  staff    18395 Feb  6 17:23 opensearch-cli-3.6.0-SNAPSHOT.jar
-rw-r--r--@ 1 cwperx  staff  8608495 Feb  6 17:23 bc-fips-2.1.2.jar
drwxr-xr-x@ 9 cwperx  staff      288 Feb  6 17:23 .
-rw-r--r--@ 1 cwperx  staff    37379 Feb  6 17:23 fips-demo-installer-cli-3.6.0-SNAPSHOT.jar

Related Issues

Resolves #20520

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks cwperks requested a review from a team as a code owner February 6, 2026 22:25
@github-actions github-actions bot added bug Something isn't working lucene Plugins labels Feb 6, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

The changes relocate randomness generation functionality from the server module to libs/common. The fips-demo-installer-cli build configuration is updated to depend on libs/opensearch-common instead of the server module. NodeEnvironment is refactored to handle seed logic locally instead of delegating to a removed utility method.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added entry documenting the relocation of randomness functionality from server to libs/common.
Build Configuration
distribution/tools/fips-demo-installer-cli/build.gradle
Updated API dependency from project(":server") to project(":libs:opensearch-common") to reduce transitive dependencies and binary size.
Randomness Refactoring
libs/common/src/main/java/org/opensearch/common/Randomness.java, server/src/main/java/org/opensearch/env/NodeEnvironment.java
Removed get(Settings settings, Setting<Long> setting) method from Randomness class. NodeEnvironment.generateNodeId updated to conditionally initialize Random with explicit seed if NODE_ID_SEED_SETTING exists, otherwise falls back to default Randomness.get().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR changes meet the objective of issue #20520 by reducing FIPS installer dependencies. Moving Randomness to libs/common allows the installer to depend on libs/common instead of the larger server module, directly addressing the image size concern.
Out of Scope Changes check ✅ Passed All changes are directly related to moving Randomness from server to libs/common. CHANGELOG and build configuration updates are necessary supporting changes, with no unrelated modifications detected.
Title check ✅ Passed The title accurately and clearly summarizes the main change: moving the Randomness component from the server module to libs/common, which is reflected in the CHANGELOG, build.gradle update, and code refactoring across multiple files.
Description check ✅ Passed The PR description includes a clear description of the change, related issue reference, and DCO compliance confirmation, but the functionality testing checklist item is unchecked.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 6, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@cwperks cwperks changed the title Move Randomness from server to libs/common Move Randomness from server to lib/common Feb 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

❌ Gradle check result for ebbd372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 8, 2026

✅ Gradle check result for ebbd372: SUCCESS

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.22%. Comparing base (3ba2f37) to head (ebbd372).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20570      +/-   ##
============================================
- Coverage     73.25%   73.22%   -0.04%     
+ Complexity    72103    72051      -52     
============================================
  Files          5798     5798              
  Lines        329732   329729       -3     
  Branches      47519    47519              
============================================
- Hits         241554   241428     -126     
- Misses        68805    68932     +127     
+ Partials      19373    19369       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cwperks cwperks merged commit 8134f12 into opensearch-project:main Feb 8, 2026
54 of 91 checks passed
@cwperks cwperks added the v3.6.0 Issues and PRs related to version 3.6.0 label Feb 8, 2026
tanyabti pushed a commit to tanyabti/OpenSearch that referenced this pull request Feb 24, 2026
* Move Randomness from server to libs/common

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add CHANGELOG entry

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
tanyabti pushed a commit to tanyabti/OpenSearch that referenced this pull request Feb 24, 2026
* Move Randomness from server to libs/common

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add CHANGELOG entry

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lucene Plugins v3.6.0 Issues and PRs related to version 3.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] FIPS demo installer CLI causes significant increase in image size

2 participants