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

[Enhancement] Enhance validation for create connector API #3260

Merged

Conversation

akolarkunnu
Copy link
Contributor

@akolarkunnu akolarkunnu commented Dec 6, 2024

Description

This PR addresses the first part of this enhancement "Validate if connector payload has all the required fields. If not provided, throw the illegal argument exception". Validation of field credentials is added in this fix. All other validations already exist. Added new test cases corresponding to this validation, fixed all failing test cases because of this new validation and refactored some of the test case code.

Related Issues

Partially Resolves #2993

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.

@pyek-bot
Copy link
Contributor

pyek-bot commented Dec 6, 2024

The overall change looks fine to me, added some nitpicks. Thanks for the contribution!

@akolarkunnu akolarkunnu force-pushed the connectorcreatevalidations branch from db98d71 to f1d1af1 Compare December 9, 2024 18:54
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 9, 2024 18:54 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 9, 2024 18:54 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 9, 2024 19:56 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu force-pushed the connectorcreatevalidations branch from f1d1af1 to 22eb03d Compare December 16, 2024 14:05
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 16, 2024 14:06 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 16, 2024 14:06 — with GitHub Actions Inactive
This PR addresses the first part of this enhancement "Validate if connector payload has all the required fields. If not provided, throw the illegal argument exception".
Validation of fields description, parameters, credential, and request_body are missing. That validations are added in this fix.
Added new test cases correspong to these validations and fixed all failing test cases because of these new validations.

Partially Resolves opensearch-project#1382

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
@akolarkunnu akolarkunnu force-pushed the connectorcreatevalidations branch from 22eb03d to ff5392b Compare December 16, 2024 14:13
@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval December 16, 2024 14:13 — with GitHub Actions Failure
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 16, 2024 14:13 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 17, 2024 19:14 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval December 17, 2024 20:14 — with GitHub Actions Inactive
Copy link
Collaborator

@dhrubo-os dhrubo-os left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

@mingshl
Copy link
Collaborator

mingshl commented Dec 17, 2024

LGTM, thanks for adding the null or empty checks for credentials!

Just a following up thoughts, if we can check if the credentials is valid in the create API, that would be even better as a further enhancement coming next. Then we can help user ensure the credentials work before calling the model.

@mingshl mingshl merged commit 58903ba into opensearch-project:main Dec 17, 2024
9 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 17, 2024
This PR addresses the first part of this enhancement "Validate if connector payload has all the required fields. If not provided, throw the illegal argument exception".
Validation of fields description, parameters, credential, and request_body are missing. That validations are added in this fix.
Added new test cases correspong to these validations and fixed all failing test cases because of these new validations.

Partially Resolves #1382

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
(cherry picked from commit 58903ba)
@mingshl mingshl added the enhancement New feature or request label Dec 17, 2024
@akolarkunnu
Copy link
Contributor Author

LGTM, thanks for adding the null or empty checks for credentials!

Just a following up thoughts, if we can check if the credentials is valid in the create API, that would be even better as a further enhancement coming next. Then we can help user ensure the credentials work before calling the model.

Ok, copied this to bug #2993 to include in the upcoming enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[Enhancement] Enhance validation for create connector API
5 participants