-
Notifications
You must be signed in to change notification settings - Fork 4
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
Make most output file and directory names shorter #618
Comments
Ran into this today, so here's some rough calculations for how longs names are in windows, taking the following steps:
The prefix of the path is Then due to how windows unzips files, it's the main zip name + the very similar internal folder name:
Here's an example image that won't extract inside that dir:
The whole thing was 299, so ~40 characters over the limit. |
Ran into this again. It does seem that a lot of the characters are from things that we can't shorten, only take out completely (the Downloads folder + screen id + scenario description, 30 + 10 to 30 + 50 to 90 = 90 to 150). The conservative way, avoiding any sort of info loss would be to do "16hrs 14mins 15secs" -> "16h14m15s", saving a total of 30 chars, and changing "alkin_test_output" to "alkiln" to save another 10. That would put this specific example below the file limit, and would help most people avoid the problem. If we want to be more rigorous, we could put a hard length limit on the screen id and scenario description (how much info is in the scenario description after the first 80 chars?). That can come later though, and IMO isn't urgent. |
Avoid artifact names whose whole paths are longer than 260 characters, which causes issues on Windows machines. See #618 for more details and analysis. Doesn't fix completely, but does make less likely.
Avoid artifact names whose whole paths are longer than 260 characters, which causes issues on Windows machines. See #618 for more details and analysis. Doesn't fix completely, but does make less likely.
Avoid artifact names whose whole paths are longer than 260 characters, which causes issues on Windows machines. See #618 for more details and analysis. Doesn't fix completely, but does make less likely.
To reiterate and add a little, my current plan:
So taking the maxes and using a scenario's default screenshot name, which I think is the longest path name (where 1234567890123 represents a timestamp): Dir names:
Filename
Total = 263 [That's 3 too many, actually, so changing 'screenshot' to 'pic' will save us 7 and get us just under the limit. Maybe will have a 20 char limit on screen id instead of 30 to give us some extra room to work with. As I said lower down, I've seen some really deeply nested stuff with long names. Maybe decrease the max scenario name cutoff too.]
Maybe we could shorten 'screenshot' to 'pic'. That would give us 7 more... I'll try to clobber out something. Just had a possible idea for some of our current users, though! Bit of a pain, but maybe they could put the zip onto another system, like google drive, and open files there. |
lol, just rediscovered the random inputs screenshots prefix for a folder name: So, with all the changes (after the adjustments I mentioned, but forgot to calculate into that table): Dir names:
Filename:
Total: 266 (6 over the limit) We'll also have Le sigh. That's not too bad if their folders aren't too deeply nested I suppose. That is, assuming they don't go over 37 chars in their prefix. |
Do [dir-separating] slashes ( |
Yeah, it includes folder separators.
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry |
With a dir prefix that's 36 chars long (with slashes), current longest of our own paths is Edited: |
Thanks, this is helpful for us Windows folks. Just a quick note about your path calculation: you need to include the drive letter and colon in the path length. That just adds two letters. Like: |
I keep being tempted to take this opportunity to refactor, but I'm thinking that I'd like this change to be fairly small since we want to cherry pick it into v4 as well as have it in v5. I do think refactoring this functionality would be a win in the future. |
This is 255 characters: c:/Users/abcdefg/Downloads/1234567890/alkiln-2023-04-08 at 02h08m58sUTC/alkiln-2023-04-08 at 02h08m58sUTC/Longest filepath should be under 184 characters with scenario descript-1680919740070/random1680919742254/random-25-characters-questi1680919742327.jpg Thoughts? |
Merge v5 first, then this will close #618.
Closed by #700 and PRs for v5 as well |
Windows (which most users will be downloading Github artifacts to if their test fails), has a default limit of full file paths of 260. Trying to extract specific files to view their contents will fail sometimes. We should more generally have shorter artifact names.
Steps to shorten artifact names:
The text was updated successfully, but these errors were encountered: