Train should mark it's branches as merged.

Bug #1533363 reported by Robert Bruce Park on 2016-01-12
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CI Train [cu2d]
Fix Released
Undecided
Robert Bruce Park

Bug Description

Lots of these branches just hang around forever:

https://code.launchpad.net/~ci-train-bot

Would be nice if they were marked as 'Merged' after being pushed to their respective trunks.

dobey proposes also deleting them at merge&clean time. That's an option to consider, I assumed they had forensic value to keeping them around but I could be wrong.

description: updated
Changed in cupstream2distro:
assignee: nobody → Robert Bruce Park (robru)
description: updated
Robert Bruce Park (robru) wrote :

Might make more sense to do it from here where we have access to the merge objects:

http://bazaar.launchpad.net/~cupstream2distro-maintainers/cupstream2distro/trunk/view/head:/citrain/recipes/merge.py#L249

Robert Bruce Park (robru) wrote :

Something like:

branch = lp.load(self.lp_branch)
branch.lifecycle_status = 'Merged'
branch.lp_save()

Robert Bruce Park (robru) wrote :

Ok I just rolled out a branch that does this for future merges, but it still would be nice to write something that goes through the enormous backlog and marks them all as merged. Not sure how to distinguish between in-use branches and merged ones though. Probably would need some 'bzr missing' magic.

Also uncertain is whether or not lp automatically marks the branches back to 'Development' when we push new commits to them. If not it'll get confusing when we push to 'Merged' branches and they'll be hidden from you.

Changed in cupstream2distro:
status: New → In Progress
Robert Bruce Park (robru) wrote :

Ok I wrote a little script for this to mark all branches as Abandoned:

python3 - <<EOF
from cupstream2distro.launchpadmanager import lp
for branch in lp.me.getBranches(status='Development'):
    print(branch)
    branch.lifecycle_status = 'Abandoned'
    branch.lp_save()
EOF

For some reason it didn't get all 800 branches on the first run so I had to run it a few times but as of right now the train has no branches in 'Development' status any longer. I confirmed in staging that new builds will mark the branches back to 'Development' even if they were already marked 'Abandoned', so for right now if you're looking for a branch from an active silo you'll have to tell lp to show you branches with "any status" (instead of any active status). All future builds will show up correctly and be marked as merged when the silo merges.

Changed in cupstream2distro:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers