Defect #19400

Possibility of having 2 (or more) repositories with empty identifier

Added by Toshi MARUYAMA about 3 years ago. Updated almost 3 years ago.

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

0%

Category:SCM
Target version:2.6.4
Resolution:Fixed Affected version:2.6.3

Description

#19260#note-4

This patch (r14050) 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)

Configuration - test - Redmine.png (58.8 KB) Nicolas Rodriguez, 2015-03-17 01:16

Associated revisions

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

Don't allow 2 repositories with blank identifier (#19400).

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

Don't validate the repository when updating/clearing extra info (#19400).

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

Fixed that 2 repositories can be created with blank/nil identifier (#19400).

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

Fixed tests failures (#19400).

History

#1 Updated by Toshi MARUYAMA about 3 years ago

  • Target version changed from 2.6.3 to 2.6.4

#2 Updated by Nicolas Rodriguez about 3 years ago

Maybe I should precise the context : I'm the maintainer of Redmine Git Hosting plugin and this patch brings the side effect describe above.

I dug this issue and the decision about repository identifier presence is not very clear.
This comment of jpl let me think that only one repository per project can have empty identifier.
Can you confirm (or not) that it's the case?

I've put a screenshot of the issue in attachment.

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

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

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

  • Subject changed from possibility of having 2 (or more) repositories with empty identifier to Possibility of having 2 (or more) repositories with empty identifier
  • Status changed from Resolved to Closed
  • Affected version set to 2.6.3

#5 Updated by Nicolas Rodriguez about 3 years ago

Hi!

Thanks for your patch! But I think there still an issue... I test Redmine Git Hosting plugin with Travis (as you do) and one the test is still failing : https://travis-ci.org/jbox-web/redmine_git_hosting.

As you can see I test Redmine Git Hosting with Redmine 2.6.2/3.0.0 (from tarball) and 2.6-stable/3.0-stable (from SVN) and both stable branch are broken. (from plugin point of view).

It's about identifier uniqueness.

Here the test :

before do
  @repository_1 = create_git_repository(project: @project_child, is_default: true) # Create a repo in database with no identifier
end

describe "Test uniqueness" do
  context "when blank identifier is already taken by a repository" do
    it { expect(build_git_repository(project: @project_child, identifier: '')).to be_invalid } # This one fails
  end

  context "when set as default and blank identifier is already taken by a repository" do
    it { expect(build_git_repository(project: @project_child, identifier: '', is_default: true)).to be_invalid } # This one pass
  end

....

It seems that depending on the "default status" of a repository you can still create 2 repositories with blank identifier.

#6 Updated by Toshi MARUYAMA about 3 years ago

  • Status changed from Closed to Reopened

#7 Updated by Jean-Philippe Lang almost 3 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF