launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #19335
[Merge] lp:~wgrant/launchpad/recipe-title-series into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/recipe-title-series into lp:launchpad.
Commit message:
Include distroseries details in SourcePackageRecipeBuild.title.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1491336 in Launchpad itself: "Make it easier to distinguish between recipe builds of the same branch"
https://bugs.launchpad.net/launchpad/+bug/1491336
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/recipe-title-series/+merge/270792
Include distroseries details in SourcePackageRecipeBuild.title.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/recipe-title-series into lp:launchpad.
=== modified file 'lib/lp/code/browser/tests/test_tales.py'
--- lib/lp/code/browser/tests/test_tales.py 2015-06-03 11:20:28 +0000
+++ lib/lp/code/browser/tests/test_tales.py 2015-09-11 10:09:28 +0000
@@ -15,6 +15,7 @@
from lp.services.webapp.publisher import canonical_url
from lp.testing import (
+ admin_logged_in,
login,
person_logged_in,
test_tales,
@@ -220,28 +221,40 @@
def test_link(self):
eric = self.factory.makePerson(name='eric')
ppa = self.factory.makeArchive(owner=eric, name='ppa')
+ distroseries = self.factory.makeDistroSeries(
+ distribution=ppa.distribution, name='shiny')
+ with admin_logged_in():
+ distroseries.nominatedarchindep = (
+ self.factory.makeDistroArchSeries(distroseries=distroseries))
build = self.factory.makeSourcePackageRecipeBuild(
- archive=ppa)
+ archive=ppa, distroseries=distroseries)
adapter = queryAdapter(build, IPathAdapter, 'fmt')
self.assertThat(
adapter.link(None),
Equals(
- '<a href="%s">%s recipe build</a> [~eric/ubuntu/ppa]'
+ '<a href="%s">%s recipe build in ubuntu shiny</a> '
+ '[~eric/ubuntu/ppa]'
% (canonical_url(build, path_only_if_possible=True),
build.recipe.base_branch.unique_name)))
def test_link_no_recipe(self):
eric = self.factory.makePerson(name='eric')
ppa = self.factory.makeArchive(owner=eric, name='ppa')
+ distroseries = self.factory.makeDistroSeries(
+ distribution=ppa.distribution, name='shiny')
+ with admin_logged_in():
+ distroseries.nominatedarchindep = (
+ self.factory.makeDistroArchSeries(distroseries=distroseries))
build = self.factory.makeSourcePackageRecipeBuild(
- archive=ppa)
+ archive=ppa, distroseries=distroseries)
with person_logged_in(build.recipe.owner):
build.recipe.destroySelf()
adapter = queryAdapter(build, IPathAdapter, 'fmt')
self.assertThat(
adapter.link(None),
Equals(
- '<a href="%s">build for deleted recipe</a> [~eric/ubuntu/ppa]'
+ '<a href="%s">deleted recipe build in ubuntu shiny</a> '
+ '[~eric/ubuntu/ppa]'
% (canonical_url(build, path_only_if_possible=True), )))
def test_link_no_permission(self):
=== modified file 'lib/lp/code/model/sourcepackagerecipebuild.py'
--- lib/lp/code/model/sourcepackagerecipebuild.py 2015-07-08 16:05:11 +0000
+++ lib/lp/code/model/sourcepackagerecipebuild.py 2015-09-11 10:09:28 +0000
@@ -177,10 +177,11 @@
@property
def title(self):
if self.recipe is None:
- return 'build for deleted recipe'
+ branch_name = 'deleted'
else:
branch_name = self.recipe.base_branch.unique_name
- return '%s recipe build' % branch_name
+ return '%s recipe build in %s %s' % (
+ branch_name, self.distribution.name, self.distroseries.name)
def __init__(self, build_farm_job, distroseries, recipe, requester,
archive, pocket, date_created):
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2015-05-13 08:27:03 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2015-09-11 10:09:28 +0000
@@ -111,7 +111,9 @@
# A recipe build's title currently consists of the base
# branch's unique name.
spb = self.makeSourcePackageRecipeBuild()
- title = "%s recipe build" % spb.recipe.base_branch.unique_name
+ title = "%s recipe build in %s %s" % (
+ spb.recipe.base_branch.unique_name, spb.distribution.name,
+ spb.distroseries.name)
self.assertEqual(spb.title, title)
def test_distribution(self):
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt'
--- lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2015-02-22 23:02:28 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2015-09-11 10:09:28 +0000
@@ -527,16 +527,20 @@
... owner=cprov, product=product, name='mybranch')
>>> recipe = factory.makeSourcePackageRecipe(
... owner=cprov, name=u'myrecipe', branches=[branch])
+ >>> distroseries = factory.makeDistroSeries(
+ ... distribution=cprov.archive.distribution, name='shiny')
+ >>> removeSecurityProxy(distroseries).nominatedarchindep = (
+ ... factory.makeDistroArchSeries(distroseries=distroseries))
>>> ppa_source.sourcepackagerelease.source_package_recipe_build = (
... factory.makeSourcePackageRecipeBuild(recipe=recipe,
- ... archive=cprov.archive))
+ ... archive=cprov.archive, distroseries=distroseries))
>>> logout()
>>> anon_browser.open(ppa_build_url)
>>> print extract_text(find_tag_by_id(anon_browser.contents, 'details'))
Build details
...
Source package recipe build:
- ~cprov/product/mybranch recipe build [~cprov/ubuntu/ppa]
+ ~cprov/product/mybranch recipe build in ubuntu shiny [~cprov/ubuntu/ppa]
...
>>> print anon_browser.getLink('~cprov/product/mybranch recipe build').url
Follow ups