Skip to content

Conversation

DarshitChanpura
Copy link
Member

@DarshitChanpura DarshitChanpura commented Oct 2, 2025

Depends on: opensearch-project/security#5677

Description

Adds capability to automatically switch to old access-control if model-group is excluded from protected resources setting.

For more details to enable/disable cluster setting, refer this guide:
https://github.com/opensearch-project/security/blob/main/RESOURCE_SHARING_AND_ACCESS_CONTROL.md#part-2-cluster-admin-and-user-guide

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

… cluster setting

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura DarshitChanpura changed the title Adds check to enable resource sharing for protected types supplied in cluster setting Adds capability to automatically switch to old access-control if model-group is excluded from protected resources setting Oct 2, 2025
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 2, 2025 04:05 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 2, 2025 04:05 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 2, 2025 04:05 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 2, 2025 04:05 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura requested a deployment to ml-commons-cicd-env-require-approval October 14, 2025 15:49 — with GitHub Actions Waiting
@DarshitChanpura DarshitChanpura requested a deployment to ml-commons-cicd-env-require-approval October 14, 2025 15:49 — with GitHub Actions Waiting
@DarshitChanpura DarshitChanpura requested a deployment to ml-commons-cicd-env-require-approval October 14, 2025 15:49 — with GitHub Actions Waiting
@DarshitChanpura DarshitChanpura requested a deployment to ml-commons-cicd-env-require-approval October 14, 2025 15:49 — with GitHub Actions Waiting
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 18:59 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 18:59 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 18:59 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 18:59 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 23:11 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 23:11 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 23:11 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 14, 2025 23:11 — with GitHub Actions Failure
@DarshitChanpura
Copy link
Member Author

blocked by:
#4279

@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 15, 2025 15:32 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 15, 2025 15:32 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 15, 2025 15:32 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 15, 2025 15:32 — with GitHub Actions Failure
…error

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 15, 2025 18:44 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 15, 2025 18:44 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 15, 2025 18:44 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 16, 2025 21:37 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 16, 2025 21:37 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 16, 2025 21:37 — with GitHub Actions Failure
@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented Oct 17, 2025

Unable to reproduce the tests failures locally:

Tests with failures:
 - org.opensearch.ml.action.model_group.DeleteModelGroupTransportActionTests.test_ValidationFailedException
 - org.opensearch.ml.action.model_group.TransportUpdateModelGroupActionTests.test_UserSpecifiedRestrictedButNoBackendRolesField
 - org.opensearch.ml.action.model_group.TransportUpdateModelGroupActionTests.test_NoAccessUserUpdatingModelGroupException

@DarshitChanpura
Copy link
Member Author

Found the root cause:
Since ResourceSharingClientAccessor is static and I added tests here that changes the value inside those tests it caused flaky-ness; as tests are run inside same jvm and if the last test that ran left the accessor assigned to some value, next test that didn't expect it would fail.

./gradlew :opensearch-ml-plugin:test                                                                                    
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.14.3
  OS Info               : Mac OS X 15.7.1 (aarch64)
  JDK Version           : 21 (Eclipse Temurin JDK)
  JAVA_HOME             : /Users/dchanp/.sdkman/candidates/java/21.0.4-tem
  Random Testing Seed   : FE9A768CB2E8A43F
  Crypto Standard       : any-supported
=======================================

> Task :opensearch-ml-plugin:compileTestJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

...

BUILD SUCCESSFUL in 54s
27 actionable tasks: 2 executed, 25 up-to-date

@DarshitChanpura DarshitChanpura force-pushed the conditional-resource-sharing branch from e476c18 to 505ce49 Compare October 17, 2025 17:58
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 17, 2025 18:01 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 17, 2025 18:01 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura temporarily deployed to ml-commons-cicd-env-require-approval October 17, 2025 18:01 — with GitHub Actions Inactive
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 17, 2025 18:01 — with GitHub Actions Failure
@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented Oct 17, 2025

integTest failure:

Tests with failures:
 - org.opensearch.ml.rest.RestMLRAGSearchProcessorIT.testBM25WithCohere

not related to this PR.

Seems flaky as well since it passed on another run:
https://github.com/opensearch-project/ml-commons/actions/runs/18600818784/job/53038758361?pr=4244

@dhrubo-os
Copy link
Collaborator

Overall looks good. Can you please update your PR description with more details like how customer will disable this resource? This will help to understand better the end to end flow.

@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 21, 2025 03:09 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 21, 2025 03:09 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 21, 2025 03:09 — with GitHub Actions Error
@DarshitChanpura
Copy link
Member Author

Overall looks good. Can you please update your PR description with more details like how customer will disable this resource? This will help to understand better the end to end flow.

done.

@DarshitChanpura DarshitChanpura temporarily deployed to ml-commons-cicd-env-require-approval October 21, 2025 13:31 — with GitHub Actions Inactive
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 21, 2025 13:31 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 21, 2025 13:31 — with GitHub Actions Error
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 21, 2025 13:31 — with GitHub Actions Failure
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.18%. Comparing base (f5510c9) to head (1f72bc2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...opensearch/ml/helper/ModelAccessControlHelper.java 33.33% 2 Missing and 2 partials ⚠️
.../opensearch/ml/action/handler/MLSearchHandler.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4244      +/-   ##
============================================
+ Coverage     80.11%   80.18%   +0.06%     
- Complexity    10160    10180      +20     
============================================
  Files           854      854              
  Lines         44219    44221       +2     
  Branches       5113     5114       +1     
============================================
+ Hits          35428    35459      +31     
+ Misses         6639     6617      -22     
+ Partials       2152     2145       -7     
Flag Coverage Δ
ml-commons 80.18% <64.28%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@DarshitChanpura DarshitChanpura temporarily deployed to ml-commons-cicd-env-require-approval October 21, 2025 17:23 — with GitHub Actions Inactive
@DarshitChanpura DarshitChanpura temporarily deployed to ml-commons-cicd-env-require-approval October 21, 2025 17:23 — with GitHub Actions Inactive
@DarshitChanpura DarshitChanpura had a problem deploying to ml-commons-cicd-env-require-approval October 21, 2025 17:23 — with GitHub Actions Failure
@DarshitChanpura DarshitChanpura deployed to ml-commons-cicd-env-require-approval October 21, 2025 20:46 — with GitHub Actions Active
@DarshitChanpura DarshitChanpura requested a deployment to ml-commons-cicd-env-require-approval October 21, 2025 22:01 — with GitHub Actions In progress
@DarshitChanpura DarshitChanpura requested a deployment to ml-commons-cicd-env-require-approval October 21, 2025 22:01 — with GitHub Actions In progress
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

Successfully merging this pull request may close these issues.

2 participants