Skip to content

Conversation

jdconrad
Copy link
Contributor

@jdconrad jdconrad commented Sep 8, 2025

Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.

@jdconrad jdconrad added :Core/Infra/Transport API Transport client API >refactoring Team:Core/Infra Meta label for core/infra team auto-backport Automatically create backport pull requests when merged v9.2.0 v9.1.4 v9.0.7 v8.18.7 v8.19.4 labels Sep 8, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM


public void testComment() {
byte[] data1 = ("#comment" + System.lineSeparator() + "1000000").getBytes(StandardCharsets.UTF_8);
TransportVersion test1 = TransportVersion.fromBufferedReader(
Copy link
Member

Choose a reason for hiding this comment

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

nit: seems these are all exactly the same test, just with a different comment before the same id. perhaps it could be moved to a helper function that takes the data as a string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll see if I can make a helper in a separate PR for all the tests that use this byte array.

String line;
do {
line = bufferedReader.readLine();
} while (line.replaceAll("\\s+", "").startsWith("#"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this means we don't support comments anywhere in the file, only in the beginning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. Since this is our internal format, I didn't think it was worth additional parsing complexity to make it work anywhere.

@jdconrad jdconrad merged commit 69d7d5b into elastic:main Sep 8, 2025
34 checks passed
jdconrad added a commit to jdconrad/elasticsearch that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
jdconrad added a commit to jdconrad/elasticsearch that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
jdconrad added a commit to jdconrad/elasticsearch that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
jdconrad added a commit to jdconrad/elasticsearch that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.1
9.0
8.18
8.19

elasticsearchmachine pushed a commit that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
elasticsearchmachine pushed a commit that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
elasticsearchmachine pushed a commit that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
elasticsearchmachine pushed a commit that referenced this pull request Sep 8, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Sep 9, 2025
Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
phananh1010 added a commit to phananh1010/elasticsearch that referenced this pull request Sep 10, 2025
phananh1010 added a commit to phananh1010/elasticsearch that referenced this pull request Sep 10, 2025
BASE=cf671ff721da8a26d4d3e30346b6bb639968f268
HEAD=8021513035fb4cd706874e9b3301dc43fdef0845
Branch=main
sarog pushed a commit to portsbuild/elasticsearch that referenced this pull request Sep 11, 2025
…lastic#134339)

Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
phananh1010 added a commit to phananh1010/elasticsearch that referenced this pull request Sep 16, 2025
BASE=cf671ff721da8a26d4d3e30346b6bb639968f268
HEAD=8021513035fb4cd706874e9b3301dc43fdef0845
Branch=main
sarog pushed a commit to portsbuild/elasticsearch that referenced this pull request Sep 19, 2025
…lastic#134339)

Comments may be added to the beginning of transport version
files by starting each comment line with the hash # character.
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 :Core/Infra/Transport API Transport client API >refactoring Team:Core/Infra Meta label for core/infra team v8.18.7 v8.19.4 v9.0.7 v9.1.4 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants