Merge lp://qastaging/~brian-murray/launchpad/595124 into lp://qastaging/launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 11108 | ||||
Proposed branch: | lp://qastaging/~brian-murray/launchpad/595124 | ||||
Merge into: | lp://qastaging/launchpad | ||||
Diff against target: |
443 lines (+164/-41) 12 files modified
lib/lp/bugs/browser/bugtask.py (+7/-4) lib/lp/bugs/configure.zcml (+2/-1) lib/lp/bugs/doc/bug.txt (+6/-6) lib/lp/bugs/doc/bugtask-expiration.txt (+30/-7) lib/lp/bugs/interfaces/bug.py (+18/-2) lib/lp/bugs/model/bug.py (+36/-9) lib/lp/bugs/model/bugtask.py (+1/-1) lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt (+16/-6) lib/lp/bugs/stories/webservice/xx-bug.txt (+42/-0) lib/lp/bugs/templates/bug-listing-expirable.pt (+3/-3) lib/lp/bugs/templates/bugtask-index.pt (+1/-1) lib/lp/bugs/tests/bug.py (+2/-1) |
||||
To merge this branch: | bzr merge lp://qastaging/~brian-murray/launchpad/595124 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leonard Richardson (community) | Approve | ||
Review via email: mp+28543@code.qastaging.launchpad.net |
Commit message
unexport IBug.can_expire which is confusing instead create and export IBug.isExpirable() which can use a custom number of days.
Description of the change
A bug report's can_expire attribute has lead to some confusion as it shows if a bug may expire not whether or not it should expire. To remove any confusion I've modified can_expire to call findExpirableTasks with days_old equal to config.
This also changes the results displayed at +expirable-bugs so that only bugs that are expirable will show up not ones that match the criteria and have a days_old of less than 60. Deryck and I discussed this and are in agreement that this makes the most sense. However, individual bug pages will still display "will be marked for expiration in XYZ days" as isExpirable is called with days_old=0.
I've also created IBug.isExpirable() which accepts a quantity of days as an argument we can call findExpirableTasks with a different quantity of days_old - for example 0. This is also exported in the API as it may be useful for a project that wanted a different expiration period than the default or if a package maintainer wanted to be particularly aggressive in expiring bugs.
Tests include:
bin/test -cvvt xx-bug.txt -t bugtask-
This all looks good except for one minor point: you are changing the behavior of the web service's can_expire attribute in a backwards- incompatible way. Bugs that used to have can_expire=False will now have can_expire=True without the bugs themselves changing.
I personally don't think the change is big enough to warrant backwards- compatibility, but here's how to do it if Francis disagrees.
Declare two attributes in IBug, can_expire (which uses your current implementation) and can_expire_beta:
can_expire = exported(Bool(...), ('devel', dict(exported= True),
'beta' , dict(exported= False)) )
can_expire_beta = exported(Bool(...), exported_ as='can_ expire' ,
('devel' , dict(exported= False))
This will make can_expire_beta show up as 'can_expire' in 'beta' and '1.0', but will replace it with can_expire in 'devel'.
I may not have the syntax right; refer to lazr.restful src/lazr/ restful/ examples/ multiversion/ resource. py and src/lazr/ restful/ docs/multiversi on.txt for help.