プロジェクト

全般

プロフィール

Vote #70144

完了

Circular relations

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

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

100%

予定工数:
category_id:
2
version_id:
35
issue_org_id:
8616
author_id:
34603
assigned_to_id:
1188
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
27
ステータス-->[Closed]

説明

I think I found a bug in redmine, correct me if I'm wrong.

3 issues: 1, 2, 3

two cases:

1 blocked_by 2,3

2 blocks 1, blocked_by 3
3 blocks 1,2

1 blocks 3, blocked_by 2

2 blocks 1, blocked_by 3
3 blocks 2, blocked_by 1

In second case we have an obvious circular dependency. 1 blocks 3, 3 block 2 and 2 block 2, so we can't close any ticket, but redmine allows me to create this relations.

First case - there isn't any circular relations. My steps in this case:

create all tickets

create relation 1 blocked_by 2

create relation 2 blocked_by 3

create relation 1 blocked_by 3 => get an error

BUT
I'm still allowed to create relation 3 blocks 1, which is equivalent to relation 1 blocked_by 3

ruby 1.8.7 (2010-06-23) patchlevel 299
rails 2.3.11 (using bitnami redmine stack: http://bitnami.org/stack/redmine)


journals

Confirmed on demo site.

Also, after closing one of the 3 issues, its status is still set to New and the new statuses allowed for all of the 3 are the status usually allowed when the issue is closed (and no error message).

Looks like db corruption.
--------------------------------------------------------------------------------
For "2" : confirmed and wrote a test for it. It's because reverse relations (such as "blocked by") are reversed to their corresponding relation (in this case "blocks") in a @before_save@ callback, which is called *after* validations. The problem is it seems relations should not be reversed if validations failed, there's a specific test for this (@test_follows_relation_should_not_be_reversed_if_validation_fails@). I'll have a deeper look at it, then at "1" too.
--------------------------------------------------------------------------------
The problem comes from r3191 but there isn't any related ticket. The attached test only ensures relations are not reversed if not valid, without saying why they shouldn't. So I committed a minimal fix in r6124.
--------------------------------------------------------------------------------
The fix is merged for next minor release. I didn't read the 1st case carefully, it should be fixed too. Please re-open if it's not the case, and thanks for reporting.
--------------------------------------------------------------------------------
Indeed, seems fixed, all went fine.
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリIssues_2 にセット
  • 対象バージョン1.2.1_35 にセット

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

いいね!0
いいね!0