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

Closed
opened 2024-05-04 07:15:37 +02:00 by Flame442 · 4 comments
Flame442 commented 2024-05-04 07:15:37 +02:00 (Migrated from github.com)

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.
github.com/Cog-Creators/Red-DiscordBot@975c0007fe/redbot/cogs/downloader/repo_manager.py (L187-L189)

### 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`. https://github.com/Cog-Creators/Red-DiscordBot/blob/975c0007fe3da1f0607799c3672a2f57c32a6e8e/redbot/cogs/downloader/repo_manager.py#L187-L189
Zephyrkul commented 2024-05-04 19:18:59 +02:00 (Migrated from github.com)

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?

Are you running on Windows? `[p]repo add` with different cases [works fine](https://discord.com/channels/133049272517001216/718148684629540905/1236366102297051146) on my Linux install - maybe you're running into a case of Windows utilizing a case-insensitive filesystem?
Flame442 commented 2024-05-04 19:30:43 +02:00 (Migrated from github.com)

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.

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 commented 2024-07-18 22:53:16 +02:00 (Migrated from github.com)

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

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

Fixed by #6750, which has been merged into V3/develop.

Fixed by #6750, which has been merged into V3/develop.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#6371
No description provided.