Merge lp://staging/~chad.smith/lp2kanban/multitask-multibranch-bugs into lp://staging/lp2kanban

Proposed by Chad Smith
Status: Merged
Approved by: Chad Smith
Approved revision: 140
Merged at revision: 135
Proposed branch: lp://staging/~chad.smith/lp2kanban/multitask-multibranch-bugs
Merge into: lp://staging/lp2kanban
Diff against target: 184 lines (+51/-38)
3 files modified
Makefile (+8/-5)
src/lp2kanban/bugs2cards.py (+12/-9)
src/lp2kanban/tests/test_bugs2cards.py (+31/-24)
To merge this branch: bzr merge lp://staging/~chad.smith/lp2kanban/multitask-multibranch-bugs
Reviewer Review Type Date Requested Status
Adam Collard (community) Approve
Benji York (community) Approve
Review via email: mp+291317@code.staging.launchpad.net

Commit message

(Multi-branch bugs) bugs which have multiple branches linked to them in LP will only be considered DONE if all linked branches are approved or merged.
Multi-task bugs: only take bug status of primary project task. Ignore bug task status of non-primary tasks (series releases) unless those tasks are owned by our team in projects which we don't manage. Example: MAAS bugs with a sub task owned by a landscaper.

Description of the change

Change the behavior of lp2kanban regarding multi-branch bugs and multi-task bugs.

(Multi-branch bugs) bugs which have multiple branches linked to them in LP.
  - bug is now considered DONE only if all linked branches are approved or merged
  - If any linked branch or MP is Work in progress, review, or rejected the LKK card will remain in CODING state and the external branch link for the card will be set to the branch of highest rank (closest to completion, like 'In review' status).

(Multi-task bugs) Bugs which have multiple targets defined, such as landscape/trunk versus landscape/16.03 (example lp:1566923)
  - lp2kanban now ignores status of the non-project bug tasks (like landscape/16.03) for bugs in projects that our board tracks. The bug card status will reflect only the "main" project task status
  - lp2kanban will continue to track sub task status for our board's engineers on projects not tracked by our board

This is best explained with a some of examples:

Bug 111: two branches linked in LP
   linked-branch-1: Merged
   linked-branch-2: Ready for review

Bug 222: two tasks for trunk and a milestone release 16.03
    task1: targets (trunk): Fix Committed
    task2: targets (16.03): In progress

MAAS Bug 333: two tasks one for primary task against maas but a second task set for Landscape
    task1: targets (maas): Fix Committed
    task2: targets (landscape:owner Adam): In progress

-- Current LKK --
- bug card #111 is moved to Ready for QA::TODO lane because linked-branch-1 is in FINAL_STATUS Merged
- Bug card #222 is moved to $squad::Doing because one of the tasks has an 'in progress' status which is ranked lower than Fix Committed
Bug card #333 is moved to $squad::Doing because a task in another project has one of our board members on it, so we collect the status from that specific sub task

-- LKK after this branch --
- bug card #111 is moved to $squad::Review because one of the linked branches is in progress at the reviewing status
- bug card #222 is moved to Fix Committed because the main landscape project target is Fix Committed and non-project task status is ignored
- bug card #333: same behavior as #333 above

To test:

# Either make this project
make configs
make credentials
make
make check
./bin/py ./src/lp2kanban/bugs2cards.py -c configs/sync.ini -b "Landscape 2016"

# Or Hijack jenkins kanban sync job and point the Repository URL to lp:~chad.smith/lp2kanban/multitask-multibranch-bugs instead of lp:lp2kanban

https://ci.lscape.net/job/kanban-sync/configure

# Or stop the jenkins kanban-sync job and patch the existing checkout (which is refreshed each run anyway)
ssh <email address hidden>; sudo -u jenkins bash; cd /var/lib/jenkins/workspaces/kanban-sync; bzr merge lp:~chad.smith/lp2kanban/multitask-multibranch-bugs; ./bin/py -c configs/sync.ini -b "Landscape 2016"

To post a comment you must log in.
136. By Chad Smith

rename unit test

Revision history for this message
Benji York (benji) wrote :

This branch looks good. It took me a little thinking to understand the intended behavior when there are multiple branches, but once I understood it, it seems like a good way to handle things.

The container I was testing in didn't have a dependency which caused an obscure error, so I propose changing the Makefile a bit to check for the dependency.

The "tags" target doesn't work either, so I propose changing it.

There were also some PHONY targets not listed as such.

Here is the diff: https://pastebin.canonical.com/153801/

review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :

> This branch looks good. It took me a little thinking to understand the
> intended behavior when there are multiple branches, but once I understood it,
> it seems like a good way to handle things.
>
> The container I was testing in didn't have a dependency which caused an
> obscure error, so I propose changing the Makefile a bit to check for the
> dependency.
>
> The "tags" target doesn't work either, so I propose changing it.
>
> There were also some PHONY targets not listed as such.
>
> Here is the diff: https://pastebin.canonical.com/153801/

Thanks for the review and patch. I'll apply the patch with a '@' to only echo the 'missing dependency' information upon failure and hide the check it does during success.

Revision history for this message
Chad Smith (chad.smith) wrote :

I figure if we hit other dependency issues besides xdg-open, we can create a ./dev/ubuntu-deps at that point to deal with multiple dev dependencies

137. By Chad Smith

apply Makefile patch to alert to missing xdg-open dependency

Revision history for this message
Adam Collard (adam-collard) wrote :

Minor nits inline below, +1

review: Approve
138. By Chad Smith

credentials shouldn't be a .PHONY make target as it generates a physical file named credentials

139. By Chad Smith

revert changes intended for followup branch

140. By Chad Smith

drop redundant logic from compound conditional

Revision history for this message
Chad Smith (chad.smith) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: