-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add more transport version files validation #132373
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
Add more transport version files validation #132373
Conversation
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
} | ||
} | ||
|
||
def javaSource(String project, String packageName, String className, String imports, String content) { |
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.
Nit: The purpose of this function is unobvious from the name. Some light javadoc or clearer name would help.
} | ||
} | ||
|
||
def definedTransportVersion(String name, String ids) { |
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.
suggestion: addDefinedTransportVersion or defineTransportVersion. A "defined" TV is the result.
"[myserver/src/main/resources/transport/defined/not_used.csv] is not referenced") | ||
} | ||
|
||
def "names must be lowercase"() { |
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.
Should we test that a few additional invalid names fail? (e.g. "hyphen-tv", "period.tv", "spaces tv", "trailing_spaces_tv ", "slashes/tv"). Should we also test that valid tvs succeed? (e.g. "valid", "valid_tv", "valid1", "valid_tv1"?). We could use a where:
clause with a "data table" for this
return results; | ||
} | ||
|
||
private static TransportVersionId parseId(String rawId) { |
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.
Should this be a static factory on TransportVersionId
? e.g. fromString
?
return stdout.toString(StandardCharsets.UTF_8); | ||
} | ||
|
||
private void recordExistingResources() { |
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.
Is there a reason we use mutation here rather than having this function return the value that is used to initialize existingResources
?
...ava/org/elasticsearch/gradle/internal/transport/ValidateTransportVersionDefinitionsTask.java
Show resolved
Hide resolved
...ava/org/elasticsearch/gradle/internal/transport/ValidateTransportVersionDefinitionsTask.java
Show resolved
Hide resolved
|
||
@Inject | ||
public ValidateTransportVersionDefinitionsTask(Project project, ExecOperations execOperations) { | ||
this.project = project; |
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.
you can just use getProject()
to reference the project object within a task
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
💔 Backport failed
You can use sqren/backport to manually backport by running |
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases. Co-authored-by: Jack Conradson <[email protected]>
* upstream/8.19: (62 commits) Use consistent terminology for transport version resources/references (elastic#132882) (elastic#132898) Move inner records out of TransportVersionUtils (elastic#132872) (elastic#132886) Forward port release notes for v8.18.5 (elastic#132758) Add more transport version files validation (elastic#132373) (elastic#132777) Forward port release notes for v8.17.10 (elastic#132760) Refactor TransportVersion loading to support external consumers (elastic#132694) (elastic#132862) manual backporting| (elastic#132783) 9.1 docs backports for 8.19 features (elastic#132605) Migrate x-pack-deprecation REST tests (elastic#131444) (elastic#132802) Update 8.19.1.asciidoc (elastic#132755) Update wolfi (versioned) (elastic#132752) Update 8.19.0.asciidoc (elastic#132754) Prune changelogs after 8.19.2 release Bump versions after 8.19.2 release Finalize release notes for v8.19.2 Bump versions after 8.17.10 release Prune changelogs after 8.18.5 release Bump versions after 8.18.5 release Add release notes for v8.19.2 release (elastic#132696) [ML] Improve EIS auth call logs and fix revocation bug (elastic#132546) (elastic#132690) ...
This commit adds additional validation cases to the new transport version resource files. It also adds gradle tests for the validation cases.
Jira: https://elasticco.atlassian.net/browse/ES-12336