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

Inconsistent behavior between [p]repo add and other commands #6371

Open
Flame442 opened this issue May 4, 2024 · 3 comments
Open

Inconsistent behavior between [p]repo add and other commands #6371

Flame442 opened this issue May 4, 2024 · 3 comments
Labels
Category: Cogs - Downloader This is related to the Downloader cog. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.

Comments

@Flame442
Copy link
Member

Flame442 commented May 4, 2024

What Red version are you using?

3.5.9

Cog name

Downloader

Command name

repo

What happened?

When running [p]repo add, if the name used is the same as an already installed repo but with different casing, the bot says a repo with that name already exists. When running [p]repo del, the correct casing must be used, or the bot will say a repo with that name does not exist. It is confusing that a repo can be stated to exist with one command, but not exist with another. Similar case-sensitive parsing happens with [p]cog install, and likely other commands.

How can we reproduce this error?

  1. [p]repo add test https://github.com/Flame442/FlameCogs
  2. [p]repo add TEST https://github.com/Flame442/FlameCogs -> already exists
  3. [p]repo del TEST https://github.com/Flame442/FlameCogs -> does not exist

Anything else?

Downloader stores repos in folders that should be interpreted case insensitively. The Repo converter should be updated to be able to match an existing repo regardless of the specific casing used.

[p]repo add eventually reaches this function, which checks if the path exists case insensitively, rather than just if the repo exists in ._repos.

def _existing_git_repo(self) -> Tuple[bool, Path]:
git_path = self.folder_path / ".git"
return git_path.exists(), git_path

@Flame442 Flame442 added Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. Category: Cogs - Downloader This is related to the Downloader cog. labels May 4, 2024
@github-actions github-actions bot added the Status: Needs Triage This has not been labeled or discussed for handling yet. label May 4, 2024
@Zephyrkul
Copy link
Contributor

Are you running on Windows? [p]repo add with different cases works fine on my Linux install - maybe you're running into a case of Windows utilizing a case-insensitive filesystem?

@Flame442
Copy link
Member Author

Flame442 commented May 4, 2024

It may be a windows specific issue due to differences in how paths are resolved, but the UX in that case should probably still be improved.

@Kowlin
Copy link
Member

Kowlin commented Jul 18, 2024

Honestly, I'm all for just forcefully lowering all repository names behind the scenes.

@Flame442 Flame442 added Status: Accepted We want this and removed Status: Needs Triage This has not been labeled or discussed for handling yet. labels Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Cogs - Downloader This is related to the Downloader cog. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

No branches or pull requests

3 participants