プロジェクト

全般

プロフィール

Vote #76128

完了

Non-default identifier-less git repositories are undeletable

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Administration_8
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
8
version_id:
91
issue_org_id:
19260
author_id:
3866
assigned_to_id:
1
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
84
ステータス-->[Closed]

説明

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.


journals

--------------------------------------------------------------------------------
Patch applied in r14050, thanks.
--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
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 version:2.6.3 was released.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリAdministration_8 にセット
  • 対象バージョン2.6.3_91 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0