Skip to content

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Aug 3, 2025

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

This commit adds additional validation cases to the new transport
version resource files. It also adds gradle tests for the validation
cases.
@rjernst rjernst requested a review from a team as a code owner August 3, 2025 14:10
@rjernst rjernst added :Core/Infra/Core Core issues without another label >refactoring auto-backport Automatically create backport pull requests when merged v9.2.0 v9.1.1 v8.19.1 v9.0.5 v8.18.5 labels Aug 3, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Aug 3, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

}
}

def javaSource(String project, String packageName, String className, String imports, String content) {
Copy link
Contributor

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) {
Copy link
Contributor

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"() {
Copy link
Contributor

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) {
Copy link
Contributor

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() {
Copy link
Contributor

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?


@Inject
public ValidateTransportVersionDefinitionsTask(Project project, ExecOperations execOperations) {
this.project = project;
Copy link
Contributor

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

Copy link
Contributor

@JVerwolf JVerwolf left a comment

Choose a reason for hiding this comment

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

LGTM

@rjernst rjernst merged commit df5cd30 into elastic:main Aug 12, 2025
33 checks passed
@rjernst rjernst deleted the transport/validation-and-tests branch August 12, 2025 22:08
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.18 Commit could not be cherrypicked due to conflicts
9.0 Commit could not be cherrypicked due to conflicts
9.1
8.19 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 132373

rjernst added a commit to rjernst/elasticsearch that referenced this pull request Aug 12, 2025
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]>
elasticsearchmachine pushed a commit that referenced this pull request Aug 12, 2025
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]>
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Aug 12, 2025
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]>
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Aug 12, 2025
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]>
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Aug 12, 2025
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]>
rjernst added a commit that referenced this pull request Aug 13, 2025
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]>
rjernst added a commit that referenced this pull request Aug 13, 2025
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]>
rjernst added a commit that referenced this pull request Aug 13, 2025
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]>
szybia added a commit to szybia/elasticsearch that referenced this pull request Aug 15, 2025
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending :Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v8.18.6 v8.19.3 v9.0.6 v9.1.3 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants