-
Notifications
You must be signed in to change notification settings - Fork 25.4k
[ML] Validate inference model ids #103669
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
Conversation
… validateInferenceModelIds
…validateInferenceModelIds
Pinging @elastic/ml-core (Team:ML) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you change the PR description to a standalone explanation of what's been done. Linking to a private issue is no use for a user who reads the release note, navigates from it to this PR, and tries to understand what it's doing.
They'll find it more helpful if you say that a valid ID is a string that contains lower case characters, digits, hyphens, underscores or dots, and must start and end only in lower case characters or digits.
@@ -33,6 +33,38 @@ public final class MlStrings { | |||
|
|||
public static final int ID_LENGTH_LIMIT = 64; | |||
|
|||
// for testing | |||
public static String[] someInvalidChars = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this final
:
public static final String[] SOME_INVALID_CHARS = {
Also, please move it to MlStringsTests
, as it's purely for testing and doesn't need to be built into the production jars.
Hi @maxhniebergall, I've created a changelog YAML for you. |
…c/elasticsearch into validateInferenceModelIds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if you could just rename the variable.
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/MlStringsTests.java
Outdated
Show resolved
Hide resolved
Co-authored-by: David Roberts <dave.roberts@elastic.co>
This change adds requirements for inference service model IDs. Specifically, Model IDs must can contain only lowercase alphanumeric (a-z and 0-9), hyphens or underscore characters and must start and end with lowercase alphanumeric.
closes https://github.com/elastic/ml-team/issues/1093