Make repo names case-insensitive #6750

Manually merged
Jackenmen merged 0 commits from Jackenmen/make_repo_names_case_insensitive into V3/develop 2026-11-21 16:10:17 +01:00
Jackenmen commented 2026-05-16 01:44:23 +02:00 (Migrated from github.com)

Description of the changes

This PR makes repo names in Downloader case-insensitive. This involves:

  • making sure that the name of the repo is lowercase everywhere relevant (at API boundaries)
  • adding a migration that updates all repos to use lowercase names, resolving any conflicts that may occur
    • RepoManager's Config is completely replaced by a config with a new identifier and its repos folder is completely replaced by a new (repos.v2) folder - this allows us to create a mapping of old names to new names and then perform a rename in any order without overriding any existing data

Testing of this PR's changes should involve:

  • testing the migration, in particular:
    • name conflict handling (i.e. add 2 repos with names name and NAME and try performing a migration)
      • note for testers: while I'd generally only expect this to be possible on Linux/macOS file systems, it might be possible to test this on Windows too by creating an empty directory as case-sensitive and then creating an instance with that dir as data path, see: https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity#modify-case-sensitivity; might require WSL feature to be enabled though
      • It would be good to test that Downloader prefers not changing existing names, i.e. with 3 repos named name, NAME, and name-2, I'd only expect NAME to be renamed to name-3, leaving name-2 as is
    • handling of repo names that were taken from installed cogs are have since been removed
    • exiting the migration mid-run (probably by just adding a line raising an exception in some strategic place in the repo manager migration)
    • checking that the config JSONs don't have extraneous data left after the migration and that data that is there is in the correct format post-migration
  • checking that all commands correctly work when passing an uppercase name for a repo, i.e. JackCogs should always manage to find a repo named jackcogs

Fixes #6371, fixes #6631, blocked by #6741

Have the changes in this PR been tested?

No

### Description of the changes This PR makes repo names in Downloader case-insensitive. This involves: - making sure that the name of the repo is lowercase everywhere relevant (at API boundaries) - adding a migration that updates all repos to use lowercase names, resolving any conflicts that may occur - `RepoManager`'s Config is completely replaced by a config with a new identifier and its repos folder is completely replaced by a new (`repos.v2`) folder - this allows us to create a mapping of old names to new names and then perform a rename in any order without overriding any existing data Testing of this PR's changes should involve: - testing the migration, in particular: - name conflict handling (i.e. add 2 repos with names `name` and `NAME` and try performing a migration) - note for testers: while I'd generally only expect this to be possible on Linux/macOS file systems, it might be possible to test this on Windows too by creating an empty directory as case-sensitive and then creating an instance with that dir as data path, see: https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity#modify-case-sensitivity; might require WSL feature to be enabled though - It would be good to test that Downloader prefers not changing existing names, i.e. with 3 repos named `name`, `NAME`, and `name-2`, I'd only expect `NAME` to be renamed to `name-3`, leaving `name-2` as is - handling of repo names that were taken from installed cogs are have since been removed - exiting the migration mid-run (probably by just adding a line raising an exception in some strategic place in the repo manager migration) - checking that the config JSONs don't have extraneous data left after the migration and that data that is there is in the correct format post-migration - checking that all commands correctly work when passing an uppercase name for a repo, i.e. `JackCogs` should always manage to find a repo named `jackcogs` Fixes #6371, fixes #6631, blocked by #6741 ### Have the changes in this PR been tested? No
Mrcoolgamer11 manually merged commit d610cd605f into V3/develop 2026-11-21 16:10:17 +01:00
Sign in to join this conversation.
No reviewers
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
1 participant
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!6750
No description provided.