Defect #19260

Non-default identifier-less git repositories are undeletable

Added by Felix Schäfer about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Administration
Target version:2.6.3
Resolution:Fixed Affected version:2.5.2

Description

Git repositories without an identifier that are not default (because another repository in the project has been promoted as default) are not deletable. This was tested on 2.3 and 2.5, but the code seems to still be in use in current trunk.

This is due to http://www.redmine.org/projects/redmine/repository/entry/branches/2.6-stable/app/models/repository.rb#L41 preventing successful saving in http://www.redmine.org/projects/redmine/repository/entry/branches/2.6-stable/app/models/repository/git.rb#L254 and makes the before_destroy in repository.rb fail.

I'm not quite sure what the intent of the validation was, I guess to enforce that if there is a repository with no identifier it is the default, but it seems possible to work around that after the creation of the identifier-less repository.

Attached is a patch with a failing test, the test passes with the validation removed, and removing the validation causes no other tests to fail.

repo_identifiers.diff Magnifier (2.09 KB) Felix Schäfer, 2015-03-03 18:15

Associated revisions

Revision 14050
Added by Jean-Philippe Lang about 3 years ago

Fixed that non-default identifier-less git repositories are undeletable (#19260).

Patch by Felix Schäfer.

History

#1 Updated by Toshi MARUYAMA about 3 years ago

  • Target version set to 2.6.3

#2 Updated by Jean-Philippe Lang about 3 years ago

  • Subject changed from non-default identifier-less git repositories are undeletable to Non-default identifier-less git repositories are undeletable
  • Description updated (diff)
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Patch applied in r14050, thanks.

#3 Updated by Jean-Philippe Lang about 3 years ago

  • Status changed from Resolved to Closed

Merged.

#4 Updated by Nicolas Rodriguez about 3 years ago

Hi!

This patch introduces the possibility of having 2 (or more) repositories with empty identifier.
Is this something intendend?

Maybe a self.save(validate: false) in clear_extra_info_of_changesets would have done the job too? (specially if the repository is about to be deleted)

Thanks,

Nicolas

#5 Updated by Toshi MARUYAMA about 3 years ago

Nicolas Rodriguez wrote:

Hi!

This patch introduces the possibility of having 2 (or more) repositories with empty identifier.
Is this something intendend?

Maybe a self.save(validate: false) in clear_extra_info_of_changesets would have done the job too? (specially if the repository is about to be deleted)

Thanks,

Nicolas

I have created #19400, because 2.6.3 was released.

#6 Updated by Nicolas Rodriguez about 3 years ago

  • File Configuration - test - Redmine.png added

#7 Updated by Toshi MARUYAMA about 3 years ago

  • File deleted (Configuration - test - Redmine.png)

Also available in: Atom PDF