Execlude trusted connector check for hidden model#3838
Execlude trusted connector check for hidden model#3838dhrubo-os merged 2 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
|
This pr is only to skip url validation for inline connectors, correct? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3838 +/- ##
=========================================
Coverage 77.99% 78.00%
- Complexity 7316 7318 +2
=========================================
Files 655 655
Lines 33032 33035 +3
Branches 3706 3707 +1
=========================================
+ Hits 25764 25768 +4
Misses 5681 5681
+ Partials 1587 1586 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Yeah. We support hidden model with inline connector. So I'm putting the validation only here for simplicity. Do you see any concern? |
|
No, it's OK to me. Thanks for confirming. |
| } | ||
| registerModelInput.setIsHidden(RestActionUtils.isSuperAdminUser(clusterService, client)); | ||
| boolean isSuperAdmin = isSuperAdminUserWrapper(clusterService, client); | ||
| registerModelInput.setIsHidden(isSuperAdmin); |
There was a problem hiding this comment.
Should we check hidden field in model configuration?
Is it possible super admin create non-hidden model?
There was a problem hiding this comment.
In current design this is not possible for super admin to create non-hidden model.
| ); | ||
| } | ||
| registerModelInput.setIsHidden(RestActionUtils.isSuperAdminUser(clusterService, client)); | ||
| boolean isSuperAdmin = isSuperAdminUserWrapper(clusterService, client); |
There was a problem hiding this comment.
This method for a single line adds complexity, additional method maintenance and reduced readability. this isn't typically considered best practice unless there's a specific testing requirement, but this static method is not covered in the UT at all.
There was a problem hiding this comment.
If you notice, I have mocked the behavior in both of the tests:
// Mock super admin check
doReturn(false).when(transportRegisterModelAction).isSuperAdminUserWrapper(any(), any());
* [BUG] Agent Framework: Handle model response when toolUse is not accompanied by text (#3755) * fix: handle model response when toolUse is not accompanied by text Signed-off-by: Pavan Yekbote <pybot@amazon.com> * feat: add test case for parseLLMOutput Signed-off-by: Pavan Yekbote <pybot@amazon.com> --------- Signed-off-by: Pavan Yekbote <pybot@amazon.com> * [BUG] Allow user to control react agent max_interations value to prevent empty response (#3756) * fix: expose max_iteration for react Signed-off-by: Pavan Yekbote <pybot@amazon.com> * fix: defaults for agent execution and differentiate between step and step result Signed-off-by: Pavan Yekbote <pybot@amazon.com> * fix: return react agent id in agent response to expose more details Signed-off-by: Pavan Yekbote <pybot@amazon.com> * spotless Signed-off-by: Pavan Yekbote <pybot@amazon.com> * fix: remove test prompt from react system prompt Signed-off-by: Pavan Yekbote <pybot@amazon.com> * refactor: rename parameters exposed to user to executor Signed-off-by: Pavan Yekbote <pybot@amazon.com> * fix: give user complete control over planner system prompt Signed-off-by: Pavan Yekbote <pybot@amazon.com> --------- Signed-off-by: Pavan Yekbote <pybot@amazon.com> * Clean up JSM from MCP (#3773) Signed-off-by: rithin-pullela-aws <rithinp@amazon.com> * [Bug] ListTools call does not return tool attributes (#3785) * initial commit for MCP server in OpenSearch (#3781) * initial commit for MCP server in OpenSearch Signed-off-by: zane-neo <zaniu@amazon.com> * Make change to support register or remove tools across cluster Signed-off-by: zane-neo <zaniu@amazon.com> * format code Signed-off-by: zane-neo <zaniu@amazon.com> * fix UT failure caused by code change Signed-off-by: zane-neo <zaniu@amazon.com> * format code Signed-off-by: zane-neo <zaniu@amazon.com> * format code Signed-off-by: zane-neo <zaniu@amazon.com> * add license header Signed-off-by: zane-neo <zaniu@amazon.com> * fix notifications initialized not respond issue Signed-off-by: zane-neo <zaniu@amazon.com> * fix minor issues and add UTs Signed-off-by: zane-neo <zaniu@amazon.com> * Add more UTs Signed-off-by: zane-neo <zaniu@amazon.com> --------- Signed-off-by: zane-neo <zaniu@amazon.com> * Remove beta1 qualifier (#3794) (#3795) (cherry picked from commit 3f503f1) Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> Co-authored-by: Peter Zhu <zhujiaxi@amazon.com> * [AUTO] Increment version to 3.1.0-SNAPSHOT (#3789) * Increment version to 3.1.0-SNAPSHOT Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com> * Update build.gradle Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> --------- Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com> Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> Co-authored-by: opensearch-ci-bot <opensearch-infra@amazon.com> Co-authored-by: Peter Zhu <zhujiaxi@amazon.com> * add release note for 3.0 (#3792) Signed-off-by: Mingshi Liu <mingshl@amazon.com> * support MCP session management (#3803) * support MCP session management Signed-off-by: zane-neo <zaniu@amazon.com> * Addressing comments Signed-off-by: zane-neo <zaniu@amazon.com> * add feature flag for mcp server and renaming mcp connector feature flag Signed-off-by: zane-neo <zaniu@amazon.com> * Address critical comments in #3781 Signed-off-by: zane-neo <zaniu@amazon.com> --------- Signed-off-by: zane-neo <zaniu@amazon.com> * upgrade http client to version align with core (#3809) * upgrade http client to versoin align with core Signed-off-by: zane-neo <zaniu@amazon.com> * upgrade httpclient-h2 to correct versiono Signed-off-by: zane-neo <zaniu@amazon.com> * use placeholder approach Signed-off-by: zane-neo <zaniu@amazon.com> --------- Signed-off-by: zane-neo <zaniu@amazon.com> * support customized message endpoint and addressing comments (#3810) * support customized message endpoint and addressing comments Signed-off-by: zane-neo <zaniu@amazon.com> * fix UT failures Signed-off-by: zane-neo <zaniu@amazon.com> * add files to jacoco exception Signed-off-by: zane-neo <zaniu@amazon.com> * fix tool name issue and optimize register tool api Signed-off-by: zane-neo <zaniu@amazon.com> * fix schema not parsed correctly issue and NPE when parameters is null Signed-off-by: zane-neo <zaniu@amazon.com> * fix failure UT Signed-off-by: zane-neo <zaniu@amazon.com> --------- Signed-off-by: zane-neo <zaniu@amazon.com> * excluding circuit breaker for Agent (#3814) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * change release note (#3811) * change release note Signed-off-by: zane-neo <zaniu@amazon.com> * Update opensearch-ml-common.release-notes-3.0.0.0.md * Update opensearch-ml-common.release-notes-3.0.0.0.md * Update opensearch-ml-common.release-notes-3.0.0.0.md --------- Signed-off-by: zane-neo <zaniu@amazon.com> Co-authored-by: Peter Zhu <zhujiaxi@amazon.com> * Downgrade MCP version to 0.9 (#3821) Signed-off-by: rithin-pullela-aws <rithinp@amazon.com> * remove libs folder (#3824) Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add more logging to deploy/undeploy flows for better debugging (#3825) * add more logging to deploy/undeploy flows for better debugging Signed-off-by: Bhavana Goud Ramaram <rbhavna@amazon.com> * Fix python client not able to connect to MCP server issue (#3822) Signed-off-by: zane-neo <zaniu@amazon.com> Co-authored-by: Dhrubo Saha <dhrubo@amazon.com> * exclude trusted connector check for hidden model (#3838) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding tenantId to the connector executor when this is inline connector (#3837) * adding tenantId to the connector executor when this is inline connector Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * added more unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Pavan Yekbote <pybot@amazon.com> Signed-off-by: rithin-pullela-aws <rithinp@amazon.com> Signed-off-by: zane-neo <zaniu@amazon.com> Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> Signed-off-by: Yaliang Wu <ylwu@amazon.com> Signed-off-by: Bhavana Goud Ramaram <rbhavna@amazon.com> Co-authored-by: Pavan Yekbote <pybot@amazon.com> Co-authored-by: Rithin Pullela <rithinp@amazon.com> Co-authored-by: zane-neo <zaniu@amazon.com> Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Co-authored-by: Peter Zhu <zhujiaxi@amazon.com> Co-authored-by: opensearch-ci-bot <opensearch-infra@amazon.com> Co-authored-by: Mingshi Liu <mingshl@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Bhavana Goud Ramaram <rbhavna@amazon.com>
…3838) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> Signed-off-by: Abdul Muneer Kolarkunnu <muneer.kolarkunnu@netapp.com>
Description
[Execlude trusted connector check for hidden model]
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff.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.