[ML] CustomService adding template validation prior to request flow#129591
Merged
jonathan-buttner merged 6 commits intoelastic:mainfrom Jun 18, 2025
Merged
[ML] CustomService adding template validation prior to request flow#129591jonathan-buttner merged 6 commits intoelastic:mainfrom
jonathan-buttner merged 6 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/ml-core (Team:ML) |
davidkyle
approved these changes
Jun 18, 2025
Member
davidkyle
left a comment
There was a problem hiding this comment.
LGTM
Definitly an improvement, this change should make it much easier to configure a custom service
|
|
||
| try { | ||
| new CustomRequest(query, List.of("test input"), model).createHttpRequest(); | ||
| } catch (Exception e) { |
Member
There was a problem hiding this comment.
Is there a more specific exception to catch, perhaps define a new exception class CustomServiceSubsitutionException extends ElasticsearchException and throw that in ValidatingSubstitutor
| throwIfNotEmptyMap(serviceSettingsMap, NAME); | ||
| throwIfNotEmptyMap(taskSettingsMap, NAME); | ||
|
|
||
| validateConfiguration(model); |
Collaborator
💚 Backport successful
|
kderusso
pushed a commit
to kderusso/elasticsearch
that referenced
this pull request
Jun 23, 2025
…lastic#129591) * Adding template validation prior to request flow * Fixing tests * Narrowing exception
mridula-s109
pushed a commit
to mridula-s109/elasticsearch
that referenced
this pull request
Jun 25, 2025
…lastic#129591) * Adding template validation prior to request flow * Fixing tests * Narrowing exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the feedback item from the original PR: #127939
This PR adds some additional validation logic prior to the typical test request validation. This addresses the validation error being nested a couple levels deep when the traditional validation is executed.
The error would also be caught in the normal request validation logic but it is nested a few levels. This change performs the initial validation for schema before making an actual request.
Comments:
#127939 (comment)
Example error after this change