-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Add ability to comment in transport version files #134329
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
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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
|
||
public void testComment() { | ||
byte[] data1 = ("#comment" + System.lineSeparator() + "1000000").getBytes(StandardCharsets.UTF_8); | ||
TransportVersion test1 = TransportVersion.fromBufferedReader( |
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: 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?
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.
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("#")); |
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.
I guess this means we don't support comments anywhere in the file, only in the beginning?
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.
Correct. Since this is our internal format, I didn't think it was worth additional parsing complexity to make it work anywhere.
Comments may be added to the beginning of transport version files by starting each comment line with the hash # character.
Comments may be added to the beginning of transport version files by starting each comment line with the hash # character.
Comments may be added to the beginning of transport version files by starting each comment line with the hash # character.
Comments may be added to the beginning of transport version files by starting each comment line with the hash # character.
Comments may be added to the beginning of transport version files by starting each comment line with the hash # character.
BASE=cf671ff721da8a26d4d3e30346b6bb639968f268 HEAD=8021513035fb4cd706874e9b3301dc43fdef0845 Branch=main
…lastic#134339) Comments may be added to the beginning of transport version files by starting each comment line with the hash # character.
BASE=cf671ff721da8a26d4d3e30346b6bb639968f268 HEAD=8021513035fb4cd706874e9b3301dc43fdef0845 Branch=main
…lastic#134339) Comments may be added to the beginning of transport version files by starting each comment line with the hash # character.
Comments may be added to the beginning of transport version
files by starting each comment line with the hash
#
character.