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

Allow Cog Creators to override the repository name present in Index installation commands #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SeaswimmerTheFsh
Copy link
Contributor

@SeaswimmerTheFsh SeaswimmerTheFsh commented May 23, 2024

This PR allows for Cog Creator to specify the name key in their repository's info.json file, to override the name retrieved from the repository's URL. This changes the repository install command listed underneath cog descriptions on the Index.
For example, the repository install command for https://coastalcommits.com/Sea/Cogs on the Index would change from:
repo add cogs https://coastalcommits.com/Sea/Cogs to repo add SeaCogs https://coastalcommits.com/Sea/Cogs.

I've compiled a list of repositories that would be affected by this change below (small changes like capitalization differences or a missing/present - won't be listed here):

…ent, instead of always using the repository's actual url name
@Flame442
Copy link
Member

Flame442 commented May 23, 2024

As I said in discord, I don't think the name key is a good idea, due to the number of repos it would affect, especially considering your research has found many cases of broken behavior if this were to be done. Downloader only accepts A-z, numbers, underscores, hyphens, and dots for the repo name, and most of the repos that have a name key currently are breaking at least one of those rules.

Additionally, capitalization changes are important, as on operating systems with case sensitive filepaths, two distinct capitalizations are distinct repo installations (see #6371). Someone who previously installed a cog from a repo attempting to follow the instructions on the index for a new cog would need to use the previously used name/capitalization or spend time determining the name that was used previously (which is what the autofilled name attempts to avoid them needing to do).

@Flame442 Flame442 added the Type: Index enhancement New feature or request label May 23, 2024
@SeaswimmerTheFsh
Copy link
Contributor Author

SeaswimmerTheFsh commented May 23, 2024

Yeah, if Downloader doesn't accept spaces or other special characters, this change would be quite problematic lol - could use a different info.json key I suppose, index_name maybe? And fair enough on the capitalization thing, I was unaware of that.

@Twentysix26
Copy link
Member

I don't think using the repo info.json's "name" field is a good solution as historically (in v2) it was supposed to be a human friendly repo name. In v3 it's been unused, albeit still present in the documentation.
Also, this PR as it is would break user expectations, because index consumers expect the "name" field to simply be the repo's actual name and for it to be a name with no invalid characters, as it's been the case for the past three years.

Personally, still a -1 even with a different field, because I think repositories should be named meaningfully in the first place :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Index enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants