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.
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.
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.
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.
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.
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.
you can just use getProject() to reference the project object within a task
💔 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 <osjdconrad@gmail.com>
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 <osjdconrad@gmail.com>
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 <osjdconrad@gmail.com>
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 <osjdconrad@gmail.com>
* 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