Should error out if a branch's prerequisite isn't in the list of MPs

Bug #1540860 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bileto
Fix Released
Medium
Robert Bruce Park

Bug Description

The train does seem to have some knowledge of prerequisites (when sorting branches to land), but it doesn't check whether a prerequisite MP is in the list of MPs.

This may lead (ugh, *did* lead ;/) to a case where the train "misses" a commit in the sense that both the prerequisite and the "top" branch get merged in one commit.

Even worse, the prerequisite MP might not even be approved yet (although that's rare, how could the top branch be approved and not its prerequisite, if it's included in the top branch anyway), and the train will happily merge.

Revision history for this message
Michał Sawicz (saviq) wrote :

It probably needs to check if the prerequisite has new commits that are not on trunk, in case it was merged before already.

Revision history for this message
Robert Bruce Park (robru) wrote :

It's not really clear to me why this is an issue. If you forget to add your prerequisite, the branch that has the prerequisite will still contain all the same code, so your built binary will still have all the same stuff you need. I guess you'll just be missing the changelog entry for the change that exists in the prerequisite branch?

Anyway I guess it wouldn't be hard to add an error if a prerequisite is undefined, the code that does the sorting could check for that:

http://bazaar.launchpad.net/+branch/cupstream2distro/view/head:/citrain/recipes/merge.py#L50

Should be easy to confirm the prereqs are all present.

Changed in cupstream2distro:
importance: Undecided → Wishlist
Revision history for this message
Michał Sawicz (saviq) wrote :

Well, I wouldn't be so sure. The problem is that adding a prerequisite doesn't mean you necessarily follow it as it changes. The train also does not merge the prerequisite unless it's explicit in the MP list.

Scenario:
- branchA is at revision 2
- branchB is at revision 3
- branchB merges branchA at revision 2 and gets it as prerequisite
- branchA is pushed to revision 5
- branchB is merged

You're left with just 2 revisions from branchA merged along with branchB. So not only is your history messed up, but also you merged branchB without the complete prerequisite.

Revision history for this message
Robert Bruce Park (robru) wrote :

So you have pre-requisite branches that still undergo development? I never considered that before, I tend to think of prereqs as being a linear thing, like you fix one bug, submit an MP, and then before that MP is merged you start working on a second bug, but instead of starting over from scratch you start at the tip of the previous MP, and so on.

Changed in cupstream2distro:
importance: Wishlist → Medium
Revision history for this message
Michał Sawicz (saviq) wrote :

Well, yeah, that's the theory, the practice, though, is that more than one person works in the same area of code on two different things, and conflict. So you have a prerequisite early to avoid having to resolve the conflicts at the end, when they might grow out of hand.

affects: cupstream2distro → bileto
Revision history for this message
Robert Bruce Park (robru) wrote :

Ok, the new MP sorting code made it a lot easier to detect this case. Bileto now prints a WARNING if it finds prerequisites that are not listed in the ticket. It's not clear to me that this should necessarily be a fatal error, we can debate that, but at least now you can read the log and discover the problem.

Changed in bileto:
status: New → Fix Released
assignee: nobody → Robert Bruce Park (robru)
Revision history for this message
Robert Bruce Park (robru) wrote :

(it's printed also in the status logs so you don't need to run a build to see this info)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.