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

Handles : in path names (+ more for 0.15.1) #174

Merged
merged 7 commits into from May 9, 2024
Merged

Conversation

skrawcz
Copy link
Contributor

@skrawcz skrawcz commented May 8, 2024

: isn't supported by windows machines.

Therefore install doesn't work on windows.
We need to therefore:

  1. update demo data
  2. change tracking client to not allow : in the path to be present.

[Short description explaining the high-level reason for the pull request]

Changes

How I tested this

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

skrawcz and others added 2 commits May 8, 2024 11:17
`:` isn't supported by windows machines.

Therefore install doesn't work on windows.
We need to therefore:

1. update demo data
2. change tracking client to not allow `:` in the path to be present.
We also don't copy over if they had the old ones.
@@ -85,7 +85,10 @@ def __init__(

@classmethod
def get_storage_path(cls, project, storage_dir) -> str:
return os.path.join(os.path.expanduser(storage_dir), project)
# need to replace `:` with `_` for the project_id; it becomes part of the path and characters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right solution. Better to error if it doesn't match. We can fix upstream, or add a patch to have demo_ instead of demo:

Comment on lines 88 to 91
# need to replace `:` with `_` for the project_id; it becomes part of the path and characters
# need to work on windows, etc.
sanitized_project_id = project.replace(":", "_")
return os.path.join(os.path.expanduser(storage_dir), sanitized_project_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue is that unbeknown to people the project name passed into the tracker gets turned into a path. so either we enforce what a project name can be, or we still need this and instead save the project name as part of metadata and not rely on the UI to assume that the directory name maps to the project name -- that would be longer term fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a side-effect of the storage for now and not something we should design around. Can add an error if its windows.

Really, we should be escaping it and this whole problem would go away, but I don't have access to a windows box to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a bad design assumption on our part to assume the project name is something that becomes part of the file path verbatim. If the project name has / in it, etc. then there's more to sanitize, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, its sloppy. As we discussed in person we'll add guards on the project name (fail earlier).

Not too concerned (the local tracking client is not prod-ready anyway), but we want to reduce onboarding friction.

We use the project name as the filename so we have to guard it. This is
a bit hacky, but we'll decouple them later.
Nothing respects dark mode except for one button which was hard to find
in dark mode. This turns it off for now. TODO -- turn it back on!
@elijahbenizzy elijahbenizzy changed the title Handles : in path names Handles : in path names (+ more for 0.15.1) May 9, 2024
@elijahbenizzy elijahbenizzy marked this pull request as ready for review May 9, 2024 22:33
@elijahbenizzy elijahbenizzy self-requested a review May 9, 2024 22:34
Copy link
Contributor

@elijahbenizzy elijahbenizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it

@elijahbenizzy elijahbenizzy merged commit 26cfcd2 into main May 9, 2024
8 checks passed
@elijahbenizzy elijahbenizzy deleted the fix_windows_install branch May 9, 2024 22:34
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.

None yet

2 participants