Project

General

Profile

Actions

Feature #34981

open

Allow to change a project identifier

Added by Go MAEDA almost 3 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Project settings
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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")

Files

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

Updated by Go MAEDA almost 3 years ago

  • Description updated (diff)
Actions #2

Updated by Holger Just almost 3 years 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.

Actions #3

Updated by Bernhard Rohloff almost 3 years 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

Actions #4

Updated by Pavel Rosický almost 3 years 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

Actions #5

Updated by Yuuki NARA almost 3 years 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

Actions #6

Updated by Pavel Rosický almost 3 years 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...

Actions #7

Updated by Pavel Rosický almost 3 years ago

here's the patch for testing

Actions #8

Updated by Mischa The Evil over 2 years ago

I think that changing this behavior is rather a bad idea.

Go MAEDA wrote:

[...]

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.

This applies not only to links from outside Redmine. It also invalidates (internal) cross-project Redmine links (#7409, r4758).

Bernhard Rohloff wrote:

The concept of separate project name and identifier is a useless construct which irritates the user more than it helps him.

I disagree. Given that Redmine is inherently a multiple-project tool, it is a pretty useful and logical concept. How would you implement multiple-project support (with e.g. the cross-project Redmine links feature) otherwise?

Pavel Rosický wrote:

I have a POC patch with this feature ...

I think it is a rather large and complicated amount of code to maintain for such a relatively small change and it still breaks the cross-project Redmine links nonetheless (see e.g. http://projects.andriylesyuk.com/issues/2014 for a fix for just one particular kind of Redmine links [project:identifier]).

Given all the considerations above plus the points already mentioned by Holger in note-2, I'm coming to the conclusion that it's a (very) bad idea to implement support for allowing users to change project identifiers. As such I'd oppose this proposal very strongly.

Actions #9

Updated by Pavel Rosický over 2 years ago

it still breaks the cross-project Redmine links - as I said, I didn't test all cases, this could be fixed.

but I also have to agree that it's too complicated for such a simple feature...

Actions

Also available in: Atom PDF