[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#751808: forcemerge should not care about the order of blocking bugs



I ran into this today with:

| > forcemerge 861174 825980
| Bug #861174 [wnpp] ITP: elpa-elpy -- Emacs Python Development Environment
| Bug #825980 [wnpp] RFP: elpy -- Emacs Lisp Python environment
| 825980 was blocked by: 875906 870705
| 825980 was not blocking any bugs.
| Added blocking bug(s) of 825980: 861242
| Owner recorded as Nicholas D Steeves <nsteeves@gmail.com>.
| Bug #825980 [wnpp] RFP: elpy -- Emacs Lisp Python environment
| Unable to complete merge on previous attempt; trying again (retry: 2)
| Bug #825980 [wnpp] RFP: elpy -- Emacs Lisp Python environment
| Unable to complete merge on previous attempt; trying again (retry: 3)
| Bug #825980 [wnpp] RFP: elpy -- Emacs Lisp Python environment
| After four attempts, the following changes were unable to be made:
| blockedby of #825980 is '861242 875906 870705' not '870705 875906 861242'
| Failed to forcibly merge 861174: Unable to modify bugs so they could be merged.

and, with inspiration from Mattia's report, solved it by un-
blocking, then merging, then blocking again.

I tried to come up with a test case (cf. attachment), but
that does not trigger the bug.

Did-not-read-the-source-question: In bugs.debian.org, is the
authoritative "Blocked-By" information kept in something
like /tmp/*/db-h/*/*.summary as well?  Looking at data from
bugs-mirror, there are lots of bugs where the list is not
sorted:

| […]
| ./09/646309.summary:Blocked-By: 671277 661665
| ./08/857108.summary:Blocked-By: 872286 872282
| ./08/805308.summary:Blocked-By: 694137 844009 780694 844079 805415 826560 844014 844075 805411 844072 805413 774567
| ./08/795208.summary:Blocked-By: 790690 767969
| ./08/646308.summary:Blocked-By: 671277 661665
| ./07/873407.summary:Blocked-By: 873428 873427
| […]

Debbugs::Status::read_bug() has code sorting mergedwith:

| […]
|     # mergedwith occasionally is sorted badly. Fix it to always be sorted by <=>
|     # and not include this bug
|     if (defined $data{mergedwith} and
|        $data{mergedwith}) {
|         $data{mergedwith} =
|             join(' ',
|                  grep { $_ != $data{bug_num}}
|                  sort { $a <=> $b }
|                  split / /, $data{mergedwith}
|                 );
|     }
| […]

If random order for "Blocked-By:" entries in *.summary files
could be the cause of this bug, I think adding similar code
for blockedby would fix it.
diff --git a/t/12_merge.t b/t/12_merge.t
index c654359..dd40db9 100644
--- a/t/12_merge.t
+++ b/t/12_merge.t
@@ -1,6 +1,6 @@
 # -*- mode: cperl;-*-
 
-use Test::More tests => 35;
+use Test::More tests => 38;
 
 use warnings;
 use strict;
@@ -141,7 +141,7 @@ send_message(to => 'control@bugs.something',
 			],
 	     body => <<'EOF') or fail 'message to control@bugs.something failed';
 debug 10
-clone 2 -1 -2 -3 -4 -5 -6
+clone 2 -1 -2 -3 -4 -5 -6 -7 -8
 retitle 2 foo
 owner 2 bar@baz.com
 submitter 2 fleb@bleh.com
@@ -158,6 +158,10 @@ fixed -4 1.2-3
 found -4 1.2-1
 found -5 1.2-5
 fixed -5 1.2-6
+block -7 by -1
+block -7 by -2
+block -8 by -2
+block -8 by -1
 thanks
 EOF
 	;
@@ -193,6 +197,12 @@ test_control_commands(forcemerge   => {command => 'forcemerge',
 				       status_value => '8',
 				       bug => '7',
 				      },
+		      merge        => {command => 'merge',
+				       value   => '9 10',
+				       status_key => 'mergedwith',
+				       status_value => '10',
+				       bug => '9',
+				      },
 		     );
 
 

Reply to: