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

If author changes case of already indexed module, change case of all permissions #250

Open
neilb opened this issue Jul 27, 2017 · 7 comments
Labels
indexer How we index uploads

Comments

@neilb
Copy link
Collaborator

neilb commented Jul 27, 2017

If you release a module Foo::Bar, then you'll get first-come on it, and then no-one else can release it, and they can't release Foo::bar or any other case variant of it either.

But if you release Foo::bar, then you'll end up with first-come on that as well, and that's the variant that will appear in the CPAN Index. This can result in different people having permissions on case-variants of the same namespace (for example, you transfer the first-come on Foo::Bar
to someone, but forget about Foo::bar; now two different people have first-come on effectively the same namespace).

I propose that we change PAUSE's behaviour so there can only ever beone case-variant of a namespace listed in 02packages.details.txt and 06perms.txt. People should be allowed to change their mind on the case of their package name, so we should update all permissions to the latest name.

The rest of this illustrates the behaviour I think PAUSE should have.

Let's say ANDK releases module Fruit::banana, and some time later he gives co-maint to RSAVAGE. So now we look at 06perms.txt

% grep -i fruit::banana 06perms.txt
Fruit::banana,ANDK,f
Fruit::banana,RSAVAGE,c

ANDK then notices that all the other fruits on CPAN are capitalised, so he releases a new version of his dist, with Fruit::Banana. PAUSE checks whether he has indexing permissions, which he does, and then notices that the case has changed. All existing permissions are switched to the new name:

% grep -i fruit::banana 06perms.txt
Fruit::Banana,ANDK,f
Fruit::Banana,RSAVAGE,c

RSAVAGE points out to ANDK that all the modules in Vegetable:: are lowercase, and people are starting to follow that convention, so with ANDK's blessing, RSAVAGE does a release which switches the name back to Fruit::banana. Again, PAUSE checks whether he has indexing permissions, which he does, and then notices that the case has changed. Even though he "only" has co-maint, as a result all permissions are again updated:

% grep -i fruit::banana 06perms.txt
Fruit::banana,ANDK,f
Fruit::banana,RSAVAGE,c

This has been discussed with the PAUSE admins, and @andk agreed we should go ahead with this, unless anyone can think of a reason why this is a bad idea?

Additional thought:
If someone does a release that has a module Foo::Bar, and it has a cuckoo package of Foo::bar
(it has happened more than once), then PAUSE should just pick one of them and assign permissions on that. We should let the author know that this is a bad idea, but still let their release be indexed.

@andk
Copy link
Owner

andk commented Dec 29, 2017

Additional data point: LNATION uploaded both ACME-AsciiEmoji-0.01.tar.gz and Acme-AsciiEmoji-0.02.tar.gz and then kept the case in the next versions. But none of these followup-uploads got indexed. The mails he got either did not arrive or were not understood. The status message he got was really poor. Just "Not indexed because of case mismatch."

@neilb
Copy link
Collaborator Author

neilb commented Mar 29, 2018

@andk - any chance this could be on your PTS todo list? :-)

@rjbs
Copy link
Collaborator

rjbs commented Apr 20, 2018

I'll give this a look… tomorrow?

@rjbs
Copy link
Collaborator

rjbs commented Apr 22, 2018

If a distribution contains both Foo::Bar and FOO::BAR, we will:

  • pick the variant in a hardcoded list, if listed
  • pick the one that matches a pmfile in the dist, if possible
  • pick one in a deterministic order

…in that order.

@karenetheridge
Copy link
Contributor

karenetheridge commented Apr 22, 2018

between options 2 and 3, how about: pick the one that matches an entry in 02packages and/or 06perms?

@rjbs
Copy link
Collaborator

rjbs commented Apr 22, 2018

If a distribution contains both Foo::Bar and FOO::BAR, we will:

  • pick the one already indexed
  • pick the one that matches a pmfile in the dist, if possible
  • pick one in a deterministic order

… in that order.

(The hardcoded list is no longer expected to be needed, after examining known cases.)

@rjbs rjbs added the indexer How we index uploads label Apr 27, 2019
@rjbs
Copy link
Collaborator

rjbs commented Apr 28, 2023

In previous years we said "mostly, don't do this."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
indexer How we index uploads
Projects
None yet
Development

No branches or pull requests

4 participants