Skip to content
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

Encode Task ID and Summary in EDITOR tempfile #160

Merged
merged 2 commits into from
Dec 15, 2021

Conversation

dontlaugh
Copy link
Contributor

Introduce a new utility function (and unit test) for generated truncated
filenames from task ID and summary.

Go strings are UTF-8, and there may be pathological inputs that we need
to sanitize. Add these to the unit test and handle them as we find them.

Fixes #117

@dontlaugh dontlaugh force-pushed the encode_name branch 2 times, most recently from 2080f47 to cf0531b Compare October 23, 2021 18:49
@dontlaugh
Copy link
Contributor Author

A screenshot of the encoded summary and task id
image

@naggie
Copy link
Owner

naggie commented Dec 6, 2021

I think we should run the task name through a whitelist filter and drop any characters not on the list. Also, convert spaces to dashes, and normalise to lowercase. Numbers and a-z should bring enough information over.

@dontlaugh dontlaugh force-pushed the encode_name branch 2 times, most recently from 8f2576c to 9c532d4 Compare December 8, 2021 05:14
@dontlaugh
Copy link
Contributor Author

@naggie Ready for review!

Introduce a new utility function (and unit test) for generated truncated
filenames from task ID and summary.

For now we limit our input to valid utf-8 alphanumerics only a single byte wide.

Fixes naggie#117
@naggie
Copy link
Owner

naggie commented Dec 9, 2021

Thanks @dontlaugh. Nitpicking --- but if we filter characters that aren't in the whitelist we don't end up with repeated dashes; would you mind changing it so we don't get repeated dashes please?

@dontlaugh
Copy link
Contributor Author

@naggie Fixed, I think. I've updated the test cases. Take a look at those to see the current behavior.

@naggie
Copy link
Owner

naggie commented Dec 15, 2021

Thanks @dontlaugh !

@naggie naggie merged commit 6706a78 into naggie:master Dec 15, 2021
@dontlaugh dontlaugh deleted the encode_name branch December 17, 2021 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encode (part of) task ID and Summary in editor tempfile name
2 participants