Merge lp:~gz/hydrazine/hide_unmerged_prerequisites_703057 into lp:hydrazine

Proposed by Martin Packman
Status: Merged
Approved by: Martin Pool
Approved revision: 93
Merged at revision: 96
Proposed branch: lp:~gz/hydrazine/hide_unmerged_prerequisites_703057
Merge into: lp:hydrazine
Diff against target: 54 lines (+25/-5)
1 file modified
feed-pqm (+25/-5)
To merge this branch: bzr merge lp:~gz/hydrazine/hide_unmerged_prerequisites_703057
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+78736@code.launchpad.net

Description of the change

Stops presenting approved merge proposals to be sent for landing if they have prerequisite branches that have not yet been merged.

For instance, currently this simple branch looks like it's ready to be landed:

<https://code.launchpad.net/~jameinel/bzr/2.1-categorize-requests-819604/+merge/78708>

But in fact depends on a much bigger branch that has yet to be reviewed:

<https://code.launchpad.net/~jameinel/bzr/2.1-client-reconnect-819604/+merge/78597>

Perhaps some kind of override should be added as well? I've occasionally in the past sent a branch to land immediately followed by another one that depended on it. However, it's probably better in general to actually see if the first one succeeds first, and with 30 minute run time these days that's less of a hassle to do.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/8/2011 11:44 PM, Martin Packman wrote:
> Martin Packman has proposed merging
> lp:~gz/hydrazine/hide_unmerged_prerequisites_703057 into
> lp:hydrazine.
>
> Requested reviews: hydrazine-core (hydrazine-core) Related bugs:
> Bug #703057 in Hydrazine: "feed-pqm suggests approved mp's with
> unapproved prerequisites"
> https://bugs.launchpad.net/hydrazine/+bug/703057
>
> For more details, see:
> https://code.launchpad.net/~gz/hydrazine/hide_unmerged_prerequisites_703057/+merge/78736
>
> Stops presenting approved merge proposals to be sent for landing
> if they have prerequisite branches that have not yet been merged.
>
> For instance, currently this simple branch looks like it's ready to
> be landed:
>
> <https://code.launchpad.net/~jameinel/bzr/2.1-categorize-requests-819604/+merge/78708>
>
> But in fact depends on a much bigger branch that has yet to be
> reviewed:
>
> <https://code.launchpad.net/~jameinel/bzr/2.1-client-reconnect-819604/+merge/78597>
>
> Perhaps some kind of override should be added as well? I've
> occasionally in the past sent a branch to land immediately followed
> by another one that depended on it. However, it's probably better
> in general to actually see if the first one succeeds first, and
> with 30 minute run time these days that's less of a hassle to do.

I think this is reasonable.
 review: approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6Q1PcACgkQJdeBCYSNAAN12ACgo1d0wYjI7Q9JjKoVmFAMJ+lf
3XwAn3uLUdtOEeILgZYXuHt2bYx70a8B
=s/g8
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'feed-pqm'
2--- feed-pqm 2011-06-02 10:40:25 +0000
3+++ feed-pqm 2011-10-08 21:43:24 +0000
4@@ -90,6 +90,9 @@
5 print ' %12s: %s' % ('message', mp.commit_message)
6 print ' %12s: %s' % ('source', mp.source_branch.bzr_identity)
7 print ' %12s: %s' % ('target', mp.target_branch.bzr_identity)
8+ prereq_branch = mp.prerequisite_branch
9+ if prereq_branch is not None:
10+ print ' %12s: %s' % ('prereq', prereq_branch.bzr_identity)
11 print ' %12s: %s' % ('status', mp.queue_status)
12 show_datetime('created', mp.date_created)
13 show_datetime('reviewed', mp.date_reviewed)
14@@ -173,6 +176,26 @@
15 return True
16
17
18+def iter_mergable_proposals(project, include_queued=False):
19+ """Iterate over merge proposals for `project` that are ready to be landed
20+
21+ If `show_queued` is set, proposals using launchpad queue tracking which
22+ are already due to be landed are also shown. This doesn't matter for merge
23+ commands sent by email instead.
24+
25+ Proposals that have unmerged prerequiste branches will not be offered for
26+ merging to prevent accidentally landing unreviewed code.
27+ """
28+ find_status = ['Approved']
29+ if include_queued:
30+ find_status.append('Queued')
31+ print 'Looking for %r mps in %s' % (find_status, project)
32+ for mp in project.getMergeProposals(status=find_status):
33+ prereq = mp.prerequisite_branch
34+ if not prereq or prereq.lifecycle_status == 'Merged':
35+ yield mp
36+
37+
38 def main(argv):
39 parser = optparse.OptionParser('%prog [options] PROJECT\n\n'
40 ' PROJECT is the launchpad project to inspect (eg bzr)')
41@@ -187,11 +210,8 @@
42 launchpad = hydrazine.create_session()
43 project = launchpad.projects[project]
44 i = 0
45- find_status = ['Approved']
46- if opts.queued:
47- find_status.append('Queued')
48- print 'Looking for %s mps in %s' % (find_status, project)
49- all_mps = list(project.getMergeProposals(status=find_status))
50+ all_mps = list(iter_mergable_proposals(project,
51+ include_queued=opts.queued))
52 while len(all_mps):
53 mp = all_mps[i]
54 show_mp(mp)

Subscribers

People subscribed via source and target branches

to all changes: