Merge lp:~rockstar/launchpad/lil-recipe-bugs into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Paul Hummer
Approved revision: no longer in the source branch.
Merged at revision: 11871
Proposed branch: lp:~rockstar/launchpad/lil-recipe-bugs
Merge into: lp:launchpad
Prerequisite: lp:~thumper/launchpad/recipe-help
Diff against target: 339 lines (+257/-3) (has conflicts)
5 files modified
lib/lp/blueprints/interfaces/specification.py (+9/-0)
lib/lp/bugs/tests/test_bugtask_search.py (+205/-0)
lib/lp/code/browser/sourcepackagerecipe.py (+8/-2)
lib/lp/code/help/related-recipes.html (+33/-0)
lib/lp/code/interfaces/sourcepackagerecipe.py (+2/-1)
Text conflict in lib/lp/blueprints/interfaces/specification.py
Text conflict in lib/lp/bugs/tests/test_bugtask_search.py
Text conflict in lib/lp/code/help/related-recipes.html
To merge this branch: bzr merge lp:~rockstar/launchpad/lil-recipe-bugs
Reviewer Review Type Date Requested Status
Deryck Hodge (community) code Approve
Review via email: mp+40143@code.launchpad.net

Commit message

Fix many recipe bugs.

Description of the change

This branch fixes a couple of little recipe bugs that were marked high. These changes are the kind that don't really have tests to go along with them.

To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

<deryck> rockstar, "this the archive where the package" should be "this *is* the archive where the package" ?
<rockstar> deryck, fixeded.
<deryck> rockstar, r=me then
<rockstar> This is why we get reviews, even for little branches...

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/blueprints/interfaces/specification.py'
--- lib/lp/blueprints/interfaces/specification.py 2010-11-04 03:34:54 +0000
+++ lib/lp/blueprints/interfaces/specification.py 2010-11-05 17:57:18 +0000
@@ -37,6 +37,7 @@
37from canonical.launchpad import _37from canonical.launchpad import _
38from canonical.launchpad.interfaces.validation import valid_webref38from canonical.launchpad.interfaces.validation import valid_webref
39from canonical.launchpad.validators import LaunchpadValidationError39from canonical.launchpad.validators import LaunchpadValidationError
40<<<<<<< TREE
40from lp.blueprints.enums import (41from lp.blueprints.enums import (
41 SpecificationDefinitionStatus,42 SpecificationDefinitionStatus,
42 SpecificationGoalStatus,43 SpecificationGoalStatus,
@@ -44,6 +45,14 @@
44 SpecificationLifecycleStatus,45 SpecificationLifecycleStatus,
45 SpecificationPriority,46 SpecificationPriority,
46 )47 )
48=======
49from lp.blueprints.enums import (
50 SpecificationDefinitionStatus,
51 SpecificationGoalStatus,
52 SpecificationImplementationStatus,
53 SpecificationPriority,
54 )
55>>>>>>> MERGE-SOURCE
47from lp.blueprints.interfaces.specificationtarget import IHasSpecifications56from lp.blueprints.interfaces.specificationtarget import IHasSpecifications
48from lp.blueprints.interfaces.sprint import ISprint57from lp.blueprints.interfaces.sprint import ISprint
49from lp.code.interfaces.branchlink import IHasLinkedBranches58from lp.code.interfaces.branchlink import IHasLinkedBranches
5059
=== modified file 'lib/lp/bugs/tests/test_bugtask_search.py'
--- lib/lp/bugs/tests/test_bugtask_search.py 2010-11-04 15:53:15 +0000
+++ lib/lp/bugs/tests/test_bugtask_search.py 2010-11-05 17:57:18 +0000
@@ -486,6 +486,204 @@
486 params = self.getBugTaskSearchParams(user=None, has_cve=True)486 params = self.getBugTaskSearchParams(user=None, has_cve=True)
487 self.assertSearchFinds(params, self.bugtasks[:1])487 self.assertSearchFinds(params, self.bugtasks[:1])
488488
489 def setUpFullTextSearchTests(self):
490 # Set text fields indexed by Bug.fti, BugTask.fti or
491 # MessageChunk.fti to values we can search for.
492 for bugtask, number in zip(self.bugtasks, ('one', 'two', 'three')):
493 commenter = self.bugtasks[0].bug.owner
494 with person_logged_in(commenter):
495 bugtask.statusexplanation = 'status explanation %s' % number
496 bugtask.bug.title = 'bug title %s' % number
497 bugtask.bug.newMessage(
498 owner=commenter, content='comment %s' % number)
499
500 def test_fulltext_search(self):
501 # Full text searches find text indexed by Bug.fti...
502 self.setUpFullTextSearchTests()
503 params = self.getBugTaskSearchParams(
504 user=None, searchtext='one title')
505 search_result = self.runSearch(params)
506 expected = self.resultValuesForBugtasks(self.bugtasks[:1])
507 self.assertEqual(expected, search_result)
508 # ... by BugTask.fti ...
509 params = self.getBugTaskSearchParams(
510 user=None, searchtext='two explanation')
511 search_result = self.runSearch(params)
512 expected = self.resultValuesForBugtasks(self.bugtasks[1:2])
513 self.assertEqual(expected, search_result)
514 # ...and by MessageChunk.fti
515 params = self.getBugTaskSearchParams(
516 user=None, searchtext='three comment')
517 search_result = self.runSearch(params)
518 expected = self.resultValuesForBugtasks(self.bugtasks[2:3])
519 self.assertEqual(expected, search_result)
520
521 def test_fast_fulltext_search(self):
522 # Fast full text searches find text indexed by Bug.fti...
523 self.setUpFullTextSearchTests()
524 params = self.getBugTaskSearchParams(
525 user=None, fast_searchtext='one title')
526 search_result = self.runSearch(params)
527 expected = self.resultValuesForBugtasks(self.bugtasks[:1])
528 self.assertEqual(expected, search_result)
529 # ... but not text indexed by BugTask.fti ...
530 params = self.getBugTaskSearchParams(
531 user=None, fast_searchtext='two explanation')
532 search_result = self.runSearch(params)
533 self.assertEqual([], search_result)
534 # ..or by MessageChunk.fti
535 params = self.getBugTaskSearchParams(
536 user=None, fast_searchtext='three comment')
537 search_result = self.runSearch(params)
538 self.assertEqual([], search_result)
539
540 def test_has_no_upstream_bugtask(self):
541 # Search results can be limited to bugtasks of bugs that do
542 # not have a related upstream task.
543 #
544 # All bugs created in makeBugTasks() have at least one
545 # bug task for a product: The default bug task created
546 # by lp.testing.factory.Factory.makeBug() if neither a
547 # product nor a distribution is specified. For distribution
548 # related tests we need another bug which does not have
549 # an upstream (aka product) bug task, otherwise the set of
550 # bugtasks returned for a search for has_no_upstream_bugtask
551 # would always be empty.
552 if (IDistribution.providedBy(self.searchtarget) or
553 IDistroSeries.providedBy(self.searchtarget) or
554 ISourcePackage.providedBy(self.searchtarget) or
555 IDistributionSourcePackage.providedBy(self.searchtarget)):
556 if IDistribution.providedBy(self.searchtarget):
557 bug = self.factory.makeBug(distribution=self.searchtarget)
558 expected = self.resultValuesForBugtasks([bug.default_bugtask])
559 else:
560 bug = self.factory.makeBug(
561 distribution=self.searchtarget.distribution)
562 bugtask = self.factory.makeBugTask(
563 bug=bug, target=self.searchtarget)
564 expected = self.resultValuesForBugtasks([bugtask])
565 else:
566 # Bugs without distribution related bugtasks have always at
567 # least one product related bugtask, hence a
568 # has_no_upstream_bugtask search will always return an
569 # empty result set.
570 expected = []
571 params = self.getBugTaskSearchParams(
572 user=None, has_no_upstream_bugtask=True)
573 search_result = self.runSearch(params)
574 self.assertEqual(expected, search_result)
575
576 def changeStatusOfBugTaskForOtherProduct(self, bugtask, new_status):
577 # Change the status of another bugtask of the same bug to the
578 # given status.
579 bug = bugtask.bug
580 for other_task in bug.bugtasks:
581 other_target = other_task.target
582 if other_task != bugtask and IProduct.providedBy(other_target):
583 with person_logged_in(other_target.owner):
584 other_task.transitionToStatus(
585 new_status, other_target.owner)
586 return
587 self.fail(
588 'No bug task found for a product that is not the target of '
589 'the main test bugtask.')
590
591 def test_upstream_status(self):
592 # Search results can be filtered by the status of an upstream
593 # bug task.
594 #
595 # The bug task status of the default test data has only bug tasks
596 # with status NEW for the "other" product, hence all bug tasks
597 # will be returned in a search for bugs that are open upstream.
598 params = self.getBugTaskSearchParams(user=None, open_upstream=True)
599 search_result = self.runSearch(params)
600 expected = self.resultValuesForBugtasks(self.bugtasks)
601 self.assertEqual(expected, search_result)
602 # A search for tasks resolved upstream does not yield any bugtask.
603 params = self.getBugTaskSearchParams(
604 user=None, resolved_upstream=True)
605 search_result = self.runSearch(params)
606 self.assertEqual([], search_result)
607 # But if we set upstream bug tasks to "fix committed" or "fix
608 # released", the related bug tasks for our test target appear in
609 # the search result.
610 self.changeStatusOfBugTaskForOtherProduct(
611 self.bugtasks[0], BugTaskStatus.FIXCOMMITTED)
612 self.changeStatusOfBugTaskForOtherProduct(
613 self.bugtasks[1], BugTaskStatus.FIXRELEASED)
614 search_result = self.runSearch(params)
615 expected = self.resultValuesForBugtasks(self.bugtasks[:2])
616 self.assertEqual(expected, search_result)
617 # A search for bug tasks open upstream now returns only one
618 # test task.
619 params = self.getBugTaskSearchParams(user=None, open_upstream=True)
620 search_result = self.runSearch(params)
621 expected = self.resultValuesForBugtasks(self.bugtasks[2:])
622
623 def test_tags(self):
624 # Search results can be limited to bugs having given tags.
625 with person_logged_in(self.owner):
626 self.bugtasks[0].bug.tags = ['tag1', 'tag2']
627 self.bugtasks[1].bug.tags = ['tag1', 'tag3']
628 params = self.getBugTaskSearchParams(
629 user=None, tag=any('tag2', 'tag3'))
630 search_result = self.runSearch(params)
631 expected = self.resultValuesForBugtasks(self.bugtasks[:2])
632 self.assertEqual(expected, search_result)
633
634 params = self.getBugTaskSearchParams(
635 user=None, tag=all('tag2', 'tag3'))
636 search_result = self.runSearch(params)
637 self.assertEqual([], search_result)
638
639 params = self.getBugTaskSearchParams(
640 user=None, tag=all('tag1', 'tag3'))
641 search_result = self.runSearch(params)
642 expected = self.resultValuesForBugtasks(self.bugtasks[1:2])
643 self.assertEqual(expected, search_result)
644
645 params = self.getBugTaskSearchParams(
646 user=None, tag=all('tag1', '-tag3'))
647 search_result = self.runSearch(params)
648 expected = self.resultValuesForBugtasks(self.bugtasks[:1])
649 self.assertEqual(expected, search_result)
650
651 params = self.getBugTaskSearchParams(
652 user=None, tag=all('-tag1'))
653 search_result = self.runSearch(params)
654 expected = self.resultValuesForBugtasks(self.bugtasks[2:])
655 self.assertEqual(expected, search_result)
656
657 params = self.getBugTaskSearchParams(
658 user=None, tag=all('*'))
659 search_result = self.runSearch(params)
660 expected = self.resultValuesForBugtasks(self.bugtasks[:2])
661 self.assertEqual(expected, search_result)
662
663 params = self.getBugTaskSearchParams(
664 user=None, tag=all('-*'))
665 search_result = self.runSearch(params)
666 expected = self.resultValuesForBugtasks(self.bugtasks[2:])
667 self.assertEqual(expected, search_result)
668
669 def test_date_closed(self):
670 # Search results can be filtered by the date_closed time
671 # of a bugtask.
672 with person_logged_in(self.owner):
673 self.bugtasks[2].transitionToStatus(
674 BugTaskStatus.FIXRELEASED, self.owner)
675 utc_now = datetime.now(pytz.timezone('UTC'))
676 self.assertTrue(utc_now >= self.bugtasks[2].date_closed)
677 params = self.getBugTaskSearchParams(
678 user=None, date_closed=greater_than(utc_now-timedelta(days=1)))
679 search_result = self.runSearch(params)
680 expected = self.resultValuesForBugtasks(self.bugtasks[2:])
681 self.assertEqual(expected, search_result)
682 params = self.getBugTaskSearchParams(
683 user=None, date_closed=greater_than(utc_now+timedelta(days=1)))
684 search_result = self.runSearch(params)
685 self.assertEqual([], search_result)
686
489687
490class ProductAndDistributionTests:688class ProductAndDistributionTests:
491 """Tests which are useful for distributions and products."""689 """Tests which are useful for distributions and products."""
@@ -503,8 +701,15 @@
503 with person_logged_in(self.owner):701 with person_logged_in(self.owner):
504 self.bugtasks[0].bug.addNomination(nominator, series1)702 self.bugtasks[0].bug.addNomination(nominator, series1)
505 self.bugtasks[1].bug.addNomination(nominator, series2)703 self.bugtasks[1].bug.addNomination(nominator, series2)
704<<<<<<< TREE
506 params = self.getBugTaskSearchParams(user=None, nominated_for=series1)705 params = self.getBugTaskSearchParams(user=None, nominated_for=series1)
507 self.assertSearchFinds(params, self.bugtasks[:1])706 self.assertSearchFinds(params, self.bugtasks[:1])
707=======
708 params = self.getBugTaskSearchParams(user=None, nominated_for=series1)
709 search_result = self.runSearch(params)
710 expected = self.resultValuesForBugtasks(self.bugtasks[:1])
711 self.assertEqual(expected, search_result)
712>>>>>>> MERGE-SOURCE
508713
509714
510class BugTargetTestBase:715class BugTargetTestBase:
511716
=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
--- lib/lp/code/browser/sourcepackagerecipe.py 2010-10-29 00:07:20 +0000
+++ lib/lp/code/browser/sourcepackagerecipe.py 2010-11-05 17:57:18 +0000
@@ -274,10 +274,16 @@
274 'build_daily',274 'build_daily',
275 ])275 ])
276 daily_build_archive = Choice(vocabulary='TargetPPAs',276 daily_build_archive = Choice(vocabulary='TargetPPAs',
277 title=u'Daily build archive')277 title=u'Daily build archive',
278 description=(
279 u'If built daily, this is the archive where the package '
280 u'will be uploaded.'))
278 distros = List(281 distros = List(
279 Choice(vocabulary='BuildableDistroSeries'),282 Choice(vocabulary='BuildableDistroSeries'),
280 title=u'Default Distribution series')283 title=u'Default distribution series',
284 description=(
285 u'If built daily, these are the distribution versions that '
286 u'the recipe will be built for.'))
281 recipe_text = Text(287 recipe_text = Text(
282 title=u'Recipe text', required=True,288 title=u'Recipe text', required=True,
283 description=u'The text of the recipe.')289 description=u'The text of the recipe.')
284290
=== modified file 'lib/lp/code/help/related-recipes.html'
--- lib/lp/code/help/related-recipes.html 2010-11-04 22:50:52 +0000
+++ lib/lp/code/help/related-recipes.html 2010-11-05 17:57:18 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1<html>2<html>
2 <head>3 <head>
3 <title>Related source package recipes</title>4 <title>Related source package recipes</title>
@@ -36,3 +37,35 @@
3637
37 </body>38 </body>
38</html>39</html>
40=======
41<html>
42 <head>
43 <title>Related source package recipes</title>
44 <link rel="stylesheet" type="text/css"
45 href="/+icing/yui/cssreset/reset.css" />
46 <link rel="stylesheet" type="text/css"
47 href="/+icing/yui/cssfonts/fonts.css" />
48 <link rel="stylesheet" type="text/css"
49 href="/+icing/yui/cssbase/base.css" />
50 </head>
51 <body>
52 <h1>Related source package recipes</h1>
53
54 <p>
55 You can ask Launchpad to make an automatic daily build
56 of the code in this branch and place the resultant package(s)
57 in your chosen PPA. (<a href="https://help.launchpad.net/Packaging/SourceBuilds" target="_blank">Read more</a>)
58 </p>
59
60 <p>A "recipe" is a description of the steps bzr-builder should take to
61 construct a source package from the various bzr branches. Its format
62 specifies:</p>
63 <ul class="bulleted">
64 <li>where to use the code from (trunk branch, beta branch, etc.), where to get the packaging from (separate branch? ubuntu branch?)</li>
65 <li>the correct package version (so users will still be able to upgrade to the stable version of the distro once it gets released)</li>
66 <li>what to modify to make the source build properly</li>
67 </ul>
68
69 </body>
70</html>
71>>>>>>> MERGE-SOURCE
3972
=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
--- lib/lp/code/interfaces/sourcepackagerecipe.py 2010-11-05 07:43:04 +0000
+++ lib/lp/code/interfaces/sourcepackagerecipe.py 2010-11-05 17:57:18 +0000
@@ -55,6 +55,7 @@
55from lp.registry.interfaces.role import IHasOwner55from lp.registry.interfaces.role import IHasOwner
56from lp.services import features56from lp.services import features
57from lp.services.fields import (57from lp.services.fields import (
58 Description,
58 PersonChoice,59 PersonChoice,
59 PublicPersonChoice,60 PublicPersonChoice,
60 )61 )
@@ -179,7 +180,7 @@
179 constraint=name_validator,180 constraint=name_validator,
180 description=_("The name of this recipe.")))181 description=_("The name of this recipe.")))
181182
182 description = Text(183 description = Description(
183 title=_('Description'), required=True,184 title=_('Description'), required=True,
184 description=_('A short description of the recipe.'))185 description=_('A short description of the recipe.'))
185186