Feature #34981

Allow to change a project identifier

Added by Go MAEDA 18 days ago. Updated 14 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Project settings
Target version:-
Resolution:

Description

Currently, it is not possible to change the identifier of a project. However, you may want to change the project identifier if, for example, you come up with a better identifier later, or if the purpose of the project changes.

The problem with changing the project identifier is that the identifier is used as part of URLs, so links from outside Redmine will be invalid.

However, if a person who manages the project (means a member who has "Edit project" permission) understands and accepts the disadvantages of changing a project identifier, I think there is no problem to allow changing it. In fact, I am sometimes asked by customers how to change a project identifier.

My suggestions:
  • Allow to change a project identifier in /projects/<identifier>/settings page
  • For Display a warning below the Identifier field on the form (eg: "Changing the identifier will change the URL of this project and may break links using the URL")

identifiers.diff Magnifier (25.9 KB) Pavel Rosický, 2021-04-03 15:13

History

#1 Updated by Go MAEDA 18 days ago

  • Description updated (diff)

#2 Updated by Holger Just 18 days ago

Many repository integrations (including the bundled Redmine.pm and reposman.rb) assume that the repository on the file system is named after the project identifier. These integrations will likely break if the project identifier can be changed, or might even cause vulnerabilities which might allow unintended repositories to be accessible.

#3 Updated by Bernhard Rohloff 18 days ago

The concept of separate project name and identifier is a useless construct which irritates the user more than it helps him.
I would rather prefer to put more effort in helping the user to find the right identifier for their project. In my opinion if the identifier would be a plain hash and I would have convenient tools (search, autocomplete etc.) at hand that hide its existence, this wouldn't be an issue I would have to think about. Like for example the

#4 Updated by Pavel Rosický 18 days ago

The problem with changing the project identifier is that the identifier is used as part of URLs, so links from outside Redmine will be invalid.

https://gitlab.com/gitlab-org/gitlab-foss has a very similar feature.
1/ a project identifier cannot be reused (this mitigates potential security vulnerabilities)
2/ it is allowed to change the identifier
3/ however the old URL is still valid and there's a warning that the project has been moved to a different location

IMO it's the right approach how to deal with this problem, but of course, it's more complex than the original proposal

#5 Updated by Yuuki NARA 17 days ago

+1

I think this feature is needed.

The identifier change itself can simply be done in SQL.
I've done it dozens of times in the past.

sample SQL script

update projects set identifier='unofficial-cooking' where id=12345;

I published an article to the same effect in Japanese.
https://translate.google.com/translate?sl=auto&tl=en&u=https://redmine.tokyo/issues/727

#6 Updated by Pavel Rosický 14 days ago

I have a POC patch with this feature and I have a few questions:
1/ based on https://github.com/paginagmbh/redmine_project_alias_2 there's an ability to freeze the identifier, so it cannot be renamed. What do you think about this feature?
2/ what should happen to identifiers if we delete the project?
3/ as Holger Just suggested this change will break Redmine.pm and reposman.rb, he's right, but it's the same as if someone removes the project and creates a different one with the same identifier. This is possible even now...

#7 Updated by Pavel Rosický 14 days ago

here's the patch for testing

Also available in: Atom PDF