-
Notifications
You must be signed in to change notification settings - Fork 18
fix: filename too long in some cases #277
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
apotterri
left a comment
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.
Hi @buzzcz. Thank you so much for submitting this improvement!
There are a couple of minor changes I'd ask you to consider making. Please let me know if you have any questions.
| @@ -1,18 +1,18 @@ | |||
| package com.appland.appmap.record; | |||
|
|
|||
| import java.io.IOException; | |||
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.
It doesn't look like most of these changes to the imports are necessary. Can you limit them to what's required for the new functionality, please?
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.
Oh, sorry about that. Default IDE settings for new project and I missed it. Fixed in the new version
| public void testSanitizeFilename() { | ||
| String longFilename = "foo".repeat(100); | ||
| assertEquals("foo.appmap.json", Recorder.sanitizeFilename("foo")); | ||
| assertEquals( |
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.
It might be more obvious that this was operating as expected if the length of the return value from sanitizeFilename was checked.
Maybe something like
| assertEquals( | |
| Pattern p = Pattern.compile("([fo]*?)-538355d.appmap.json"); | |
| Matcher m = p.matcher(Recorder.sanitizeFilename(longFilename)); | |
| assertTrue(m.find()); | |
| assertEquals(255, m.group(0).length()); | |
| assertEquals(235, m.group(1).length()); |
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.
That makes sense, I'll use it like this. Fixed in the next version
bf7bb2f to
70cc552
Compare
| @@ -1,19 +1,17 @@ | |||
| package com.appland.appmap.record; | |||
|
|
|||
| import static com.github.stefanbirkner.systemlambda.SystemLambda.tapSystemErr; | |||
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.
Sorry to be a nuisance about this, but looks like some more import change snuck in.
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.
It's ok, it's your job 😉 It's fixed
70cc552 to
fc74f0a
Compare
apotterri
left a comment
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.
Looks good. Thanks again.
|
Perfect, thank you! |
|
🎉 This PR is included in version 1.26.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thanks so much for your contribution! |
This patch should similarly fix #75 as in getappmap/appmap-python#91