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

Support renaming packages #47

Closed
Seldaek opened this issue Oct 16, 2011 · 31 comments
Closed

Support renaming packages #47

Seldaek opened this issue Oct 16, 2011 · 31 comments
Labels

Comments

@Seldaek
Copy link
Member

Seldaek commented Oct 16, 2011

The procedure for renaming packages should be as such:
- Update your composer.json with "name": "new/name" and "replace": {"old/name": "self.version"}
- Press a button on Packagist if you're maintainer, and it will rename if those two preconditions are met.

EDIT: Current solution/procedure:

If you just want to update the github/repo URL

  • Do the rename on github or wherever
  • Edit the package URL on packagist, no need to change the package name for this

If you really really want to rename a package

  • Update the name in composer.json on the master branch or whatever the default branch is
  • Resubmit the package to packagist using the new name
  • Mark the old package as "Abandoned" on packagist, and use the new name in the form so that people get pointed to it when they install with the old name
  • And no you can't keep your download stats
@njh
Copy link

njh commented Jan 13, 2013

+1

@smasty
Copy link

smasty commented Jan 13, 2013

Will this be available in the near future?

@Seldaek
Copy link
Member Author

Seldaek commented Jan 13, 2013

Not unless someone does it, and even then I am not sure it's a good idea. You really should think twice before publishing, and in the worst case you can always delete the package and republish under a new name. Facilitating renames means people will think less, and the amount of renames/chaos will be higher than it should.

@njh
Copy link

njh commented Jan 13, 2013

I have renamed njh/easyrdf to easyrdf/easyrdf but I am keeping the sources on GitHub at njh/easyrdf.

But I don't seem to be able to delete njh/easyrdf from packagist.org.

@Seldaek
Copy link
Member Author

Seldaek commented Jan 13, 2013

@njh I deleted it for you.

@kl3ryk
Copy link

kl3ryk commented Aug 24, 2013

👍

@AD7six
Copy link

AD7six commented Jan 28, 2014

👍 to enabling anything to rename a package. It should be a rare occurrence, why not simply add the package-name field to the/packages/author/package/edit? screen? Possibly with a restriction that you can only rename a repository n (1?) times, or once per <long time> ?

Also related: #378 #163

@Taluu
Copy link

Taluu commented Jun 6, 2014

Any news on this (with the mentionned manipulation, using replace) ? I'd need to replace taluu/totem with wisembly/totem. For now, I created a new package, but feel free to delete it or do whatever you want.

Thanks.

@tedivm
Copy link

tedivm commented Jun 7, 2014

I've recently moved some of my larger projects out of my personal Github account and to a new Organization. I would also like to change the vendor name of those projects to that new organization name.

What's the best way to handle that? I've already "moved" the repositories, rather than forking them, so that they have the same watchers and stargazers. I would also like the download history from Packagist kept, and of course for people using the old vendor names and versions to still be able to have their applications function.

@Seldaek
Copy link
Member Author

Seldaek commented Jun 7, 2014

The problem is since we fixed the replace hijack issues doing clean renames is pretty much impossible. With @rdohms PR for #192 it will become possible to deprecate and nudge users to the new package, but that means the two packages must coexist, pointing to the same repo. This creates two problems:

  • the download count will be lost, but I don't really think that's a bad thing, there should be maintainer pain for causing all your users pain by renaming something.
  • the current github hook handler only updates one repo at a time, so we need to make it skip deprecated repos or handle multiple repos if many packages exist with the same repo url.

@tedivm
Copy link

tedivm commented Jun 7, 2014

Is there no way to have an "alias" in packagist? A simple lookup table, check it before looking for projects, if there is an alias then redirect.

If this is done then there is no user pain that you're referring too. If a user doesn't make the change then the redirect will occur and they'll download the appropriate version.

@aik099
Copy link

aik099 commented Jul 4, 2014

I also started project in my own account on GitHub and then moved to an organization account. Back then, when I started it I never thought that it will be as big (changing GitHub repo url worked for me). Now to I also need to change package name on Packagist. However what will happen if somebody is still accessing package with old name?

Theoretically syntax proposed by @Seldaek in task description should already do the trick, since whoever will ask for old package name will be suggested to update their composer.json.

@aik099
Copy link

aik099 commented Jul 4, 2014

According to #225 the renaming is possible. Then I don't get what this task is all about.

@tedivm
Copy link

tedivm commented Jul 4, 2014

That's not the same as renaming, that's erasing and putting new ones up. Anyone who was pointed at the original package name is going to have to change it and all download counts are lost.

@dereuromark
Copy link

👍
Currently it is quite the challenge.

@Seldaek
Copy link
Member Author

Seldaek commented Jul 23, 2014

Now that it's possible to abandon packages, I'd recommend dropping this feature altogether. Since we changed the way replace works it's not really possible to do a soft-rename anymore. Deprecating and nudging people to the new name is the better way IMO. Although the best way is ultimately to stop renaming packages altogether.

I'm closing already but if someone has good counter arguments it can obviously be reopened. /cc @naderman

@Seldaek Seldaek closed this as completed Jul 23, 2014
@dereuromark
Copy link

Abandon != Rename
A rename with such a abandon/delete + create resets the statistics as you pointed out.
For me Abandon = Dead

I like the idea of @AD7six

why not simply add the package-name field to the/packages/author/package/edit? screen? Possibly with a restriction that you can only rename a repository n (1?) times, or once per ?

But far worse is that it doesn't work the way it has been proposed.

It is a rare event, but it needs to be working when necessary. Currently one is "helpless" - as even the hard-delete button is not available :(

@jasny
Copy link

jasny commented Aug 8, 2014

@Seldaek A suggestion: After renaming a repository on GitHub, pull and pushes to the old location still work (by redirect) and going to the project page redirects me to the new location.

I think this would be an ideal strategy for packagist as well. Don't list the package under the old name and redirect where the old name is used.

It would be ideal if composer would issue a notice if the user is using a renamed (or abandoned) package.

@aik099
Copy link

aik099 commented Aug 8, 2014

It would be ideal if composer would issue a notice if the user is using a renamed (or abandoned) package.

👍 , right now error returned by Composer is the same if the old package never existed.

@TRPB
Copy link

TRPB commented Aug 13, 2015

I'm also interested in doing this. I want to rename [user][package] to [organisation][package]. Could this be as simple as:

  1. Transfer the repo on github
  2. Create a repo with the old name
  3. Add a composer.json to the old repo name that just has "require": { "newPackageName": "*"}

Obviously you'd lose the download count and technically have two packages, but presumably this would mean anyone who tried to run composer install where the old package was being referenced would not even be aware it's been renamed?

@Seldaek
Copy link
Member Author

Seldaek commented Aug 13, 2015

If all you want is move repos around on github, do it and then edit the repo URLs on packagist and all is well. You don't have to rename the packages in composer.json to do this.

If you really want to rename them, then do the above, but then on top of that rename in composer.json, and re-submit the URL on packagist, and mark the old name one as "Abandoned" on packagist, and point to the new one. That's the smoothest transition possible for everyone.

@TRPB
Copy link

TRPB commented Aug 13, 2015

Thanks for the speedy response, makes sense :)

@barryvdh
Copy link
Sponsor

So to be clear, renaming a package can only be done by resubmitting a github repo with a different name, and deprecating the old one? Only downside is losing stats and double listing?

And for moving github repos, you can manually change the location?

@Seldaek
Copy link
Member Author

Seldaek commented Feb 27, 2016 via email

@nadar
Copy link
Contributor

nadar commented Mar 8, 2016

In case of resubmitting the package, the GitHub Service for packagist must be removed and readded, otherwise auto-update will not work for the newly submitted package.

@gsouf
Copy link

gsouf commented Mar 31, 2016

No way to delete abandoned package?
In my case, had a WIP, and before publishing it with a stable I released the name was not good, it creates an useless abandoned package in the vendor name.

@aik099
Copy link

aik099 commented Mar 31, 2016

@gsouf , you can delete abandoned package if it has small download count. Not sure about exact number maybe it's 40 downloads or less.

@gsouf
Copy link

gsouf commented Mar 31, 2016

It looks like having more than 1000 makes it not eligible to deletion!

@tuupola
Copy link

tuupola commented May 6, 2016

The OCD in me does not feel good about having double listing and abandoned package under vendor name. Allowing to rename a package and aliasing the old name to the new name in the same way as GitHub does with repositories would keep vendor namespaces clean.

@TomasVotruba
Copy link

How to rename package nowadays? Is there some solution apart deleting and uploading a new one?

@Seldaek
Copy link
Member Author

Seldaek commented Jan 11, 2017

Current solution/procedure:

If you just want to update the github/repo URL

  • Do the rename on github or wherever
  • Edit the package URL on packagist, no need to change the package name for this

If you really really want to rename a package

  • Update the name in composer.json on the master branch or whatever the default branch is
  • Resubmitting the package to packagist using the new name
  • Mark the old package as "Abandoned" on packagist, and use the new name in the form so that people get pointed to it when they install with the old name
  • And no you can't keep your download stats

@composer composer locked and limited conversation to collaborators Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.