Skip to content

Conversation

@buzzcz
Copy link
Contributor

@buzzcz buzzcz commented May 14, 2024

This patch should similarly fix #75 as in getappmap/appmap-python#91

Copy link
Contributor

@apotterri apotterri left a 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;
Copy link
Contributor

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?

Copy link
Contributor Author

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

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

Suggested change
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());

Copy link
Contributor Author

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

@buzzcz buzzcz force-pushed the fix/filename-too-long branch from bf7bb2f to 70cc552 Compare May 14, 2024 13:51
@buzzcz buzzcz requested a review from apotterri May 15, 2024 13:14
@@ -1,19 +1,17 @@
package com.appland.appmap.record;

import static com.github.stefanbirkner.systemlambda.SystemLambda.tapSystemErr;
Copy link
Contributor

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.

Copy link
Contributor Author

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

@buzzcz buzzcz force-pushed the fix/filename-too-long branch from 70cc552 to fc74f0a Compare May 16, 2024 12:54
@buzzcz buzzcz requested a review from apotterri May 16, 2024 12:55
Copy link
Contributor

@apotterri apotterri left a 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.

@apotterri apotterri merged commit 1af9316 into getappmap:master May 16, 2024
@buzzcz
Copy link
Contributor Author

buzzcz commented May 16, 2024

Perfect, thank you!

@appland-release
Copy link

🎉 This PR is included in version 1.26.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kgilpin
Copy link
Contributor

kgilpin commented May 16, 2024

Perfect, thank you!

Thanks so much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Appmap generated file name too long

4 participants