Generated directory paths can still have colons
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start at _generate_path_from_repo_url and reproduce the git@git.dev.box.net:Productivity/ClusterRunnerHealthCheck.git example on a Windows-compatible path. Trace how the parsed URL parts form repo_directory and repo_name, then verify that the resulting generated directory path contains no illegal colons.
Written by the indexing model from the issue text.
Description
I noticed in _generate_path_from_repo_url we remove the colons from the netloc, however we don't try to remove colons anywhere else like from path, which makes something like
urlparse('git@git.dev.box.net:Productivity/ClusterRunnerHealthCheck.git')
# ParseResult(scheme='', netloc='', path='git@git.dev.box.net:Productivity/ClusterRunnerHealthCheck.git', params='', query='', fragment='')
create a repo directory like
~/.clusterrunner/repos/master/git@git.dev.box.net:Productivity/ClusterRunnerHealthCheck
Since Windows doesn't like colons in directory paths, we could just do all the illegal character removing at the end instead of trying to hit each piece as we create the path.
Something like:
@staticmethod
def _generate_path_from_repo_url(base_sys_path, url):
# ...
return Git._clean_path_url(os.path.join(repo_directory, repo_name))
@staticmethod
def _clean_path_url(url):
illegal_chars = [':', '-'] # any characters that we don't want in a directory path
clean_url = ''.join(c for c in url if c not in illegal_chars)
return clean_url
- Dominant language
- Python
- Stars
- 184
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from box/ClusterRunner
-
bug minor
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
box/ClusterRunner#336 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
box/ClusterRunner#150 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
box/ClusterRunner#457 · 2 comments ·
-
major
Difficulty 5/5 Over a week Newbie friendliness 25/100
box/ClusterRunner#433 · 4 comments · 48 reactions ·
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
box/ClusterRunner#411 · 1 comment ·
All issues in box/ClusterRunner
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100