launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #22220
[Merge] lp:~cjwatson/launchpad/dispatch-build-url into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/dispatch-build-url into lp:launchpad.
Commit message:
Dispatch build URL to all build types.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/dispatch-build-url/+merge/340249
This will be useful for some upcoming work in snap builds, but it's also generally useful for improved logging: after this lands, I plan to land a launchpad-buildd change to emit the build URL near the top of the build log, which will fix the long-standing annoyance that it's difficult to get from a build log back to the build.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/dispatch-build-url into lp:launchpad.
=== modified file 'lib/lp/code/model/recipebuilder.py'
--- lib/lp/code/model/recipebuilder.py 2017-07-26 13:21:25 +0000
+++ lib/lp/code/model/recipebuilder.py 2018-03-01 22:17:02 +0000
@@ -24,6 +24,7 @@
ISourcePackageRecipeBuild,
)
from lp.services.config import config
+from lp.services.webapp import canonical_url
from lp.soyuz.adapters.archivedependencies import (
get_primary_current_component,
get_sources_list_for_building,
@@ -74,6 +75,7 @@
tools_source=config.builddmaster.bzr_builder_sources_list,
logger=logger))
args['archive_private'] = self.build.archive.private
+ args['build_url'] = canonical_url(self.build)
# XXX cjwatson 2017-07-26: This duplicates "series", which is common
# to all build types; this name for it is deprecated and should be
# removed once launchpad-buildd no longer requires it.
=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
--- lib/lp/code/model/tests/test_recipebuilder.py 2018-02-14 11:13:47 +0000
+++ lib/lp/code/model/tests/test_recipebuilder.py 2018-03-01 22:17:02 +0000
@@ -44,6 +44,7 @@
from lp.registry.interfaces.series import SeriesStatus
from lp.services.config import config
from lp.services.log.logger import BufferLogger
+from lp.services.webapp import canonical_url
from lp.soyuz.adapters.archivedependencies import (
get_sources_list_for_building,
)
@@ -181,20 +182,22 @@
0, "deb http://foo %s main" % job.build.distroseries.name)
args = yield job._extraBuildArgs(distroarchseries)
self.assertEqual({
+ 'arch_tag': 'i386',
'archive_private': False,
- 'arch_tag': 'i386',
+ 'archive_purpose': 'PPA',
+ 'archives': expected_archives,
'author_email': 'requester@xxxxxxxxxx',
- 'series': job.build.distroseries.name,
- 'suite': 'mydistro',
'author_name': 'Joe User',
- 'archive_purpose': 'PPA',
+ 'build_url': canonical_url(job.build),
+ 'distroseries_name': job.build.distroseries.name,
'ogrecomponent': 'universe',
'recipe_text':
- '# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}\n'
- 'lp://dev/~joe/someapp/pkg\n',
- 'archives': expected_archives,
+ '# bzr-builder format 0.3 '
+ 'deb-version {debupstream}-0~{revno}\n'
+ 'lp://dev/~joe/someapp/pkg\n',
+ 'series': job.build.distroseries.name,
+ 'suite': 'mydistro',
'trusted_keys': expected_trusted_keys,
- 'distroseries_name': job.build.distroseries.name,
}, args)
@defer.inlineCallbacks
@@ -274,20 +277,22 @@
logger = BufferLogger()
extra_args = yield job._extraBuildArgs(distroarchseries, logger)
self.assertEqual({
+ 'arch_tag': 'i386',
'archive_private': False,
- 'arch_tag': 'i386',
+ 'archive_purpose': 'PPA',
+ 'archives': expected_archives,
'author_email': 'requester@xxxxxxxxxx',
- 'series': job.build.distroseries.name,
- 'suite': 'mydistro',
'author_name': 'Joe User',
- 'archive_purpose': 'PPA',
+ 'build_url': canonical_url(job.build),
+ 'distroseries_name': job.build.distroseries.name,
'ogrecomponent': 'universe',
'recipe_text':
- '# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}\n'
- 'lp://dev/~joe/someapp/pkg\n',
- 'archives': expected_archives,
+ '# bzr-builder format 0.3 '
+ 'deb-version {debupstream}-0~{revno}\n'
+ 'lp://dev/~joe/someapp/pkg\n',
+ 'series': job.build.distroseries.name,
+ 'suite': 'mydistro',
'trusted_keys': expected_trusted_keys,
- 'distroseries_name': job.build.distroseries.name,
}, extra_args)
self.assertIn(
"Exception processing build tools sources.list entry:",
@@ -315,22 +320,23 @@
job.build, distroarchseries, None))
extra_args = yield job._extraBuildArgs(distroarchseries)
self.assertEqual({
+ 'arch_tag': 'i386',
'archive_private': False,
- 'arch_tag': 'i386',
+ 'archive_purpose': 'PPA',
+ 'archives': expected_archives,
'author_email': 'requester@xxxxxxxxxx',
- 'series': job.build.distroseries.name,
- 'suite': 'mydistro',
'author_name': 'Joe User',
- 'archive_purpose': 'PPA',
+ 'build_url': canonical_url(job.build),
+ 'distroseries_name': job.build.distroseries.name,
+ 'git': True,
'ogrecomponent': 'universe',
'recipe_text':
'# git-build-recipe format 0.4 deb-version '
'{debupstream}-0~{revtime}\n'
'lp:~joe/someapp/+git/pkg packaging\n',
- 'archives': expected_archives,
+ 'series': job.build.distroseries.name,
+ 'suite': 'mydistro',
'trusted_keys': expected_trusted_keys,
- 'distroseries_name': job.build.distroseries.name,
- 'git': True,
}, extra_args)
@defer.inlineCallbacks
=== modified file 'lib/lp/snappy/model/snapbuildbehaviour.py'
--- lib/lp/snappy/model/snapbuildbehaviour.py 2017-07-25 18:01:04 +0000
+++ lib/lp/snappy/model/snapbuildbehaviour.py 2018-03-01 22:17:02 +0000
@@ -29,6 +29,7 @@
)
from lp.registry.interfaces.series import SeriesStatus
from lp.services.config import config
+from lp.services.webapp import canonical_url
from lp.snappy.interfaces.snap import SnapBuildArchiveOwnerMismatch
from lp.snappy.interfaces.snapbuild import ISnapBuild
from lp.soyuz.adapters.archivedependencies import (
@@ -107,6 +108,7 @@
tools_fingerprint=config.snappy.tools_fingerprint,
logger=logger))
args["archive_private"] = build.archive.private
+ args["build_url"] = canonical_url(build)
if build.snap.branch is not None:
args["branch"] = build.snap.branch.bzr_identity
elif build.snap.git_ref is not None:
=== modified file 'lib/lp/snappy/tests/test_snapbuildbehaviour.py'
--- lib/lp/snappy/tests/test_snapbuildbehaviour.py 2017-12-19 17:22:44 +0000
+++ lib/lp/snappy/tests/test_snapbuildbehaviour.py 2018-03-01 22:17:02 +0000
@@ -55,6 +55,7 @@
from lp.registry.interfaces.series import SeriesStatus
from lp.services.config import config
from lp.services.log.logger import BufferLogger
+from lp.services.webapp import canonical_url
from lp.snappy.interfaces.snap import SnapBuildArchiveOwnerMismatch
from lp.snappy.model.snapbuildbehaviour import SnapBuildBehaviour
from lp.soyuz.adapters.archivedependencies import (
@@ -276,6 +277,7 @@
"archives": expected_archives,
"arch_tag": "i386",
"branch": branch.bzr_identity,
+ "build_url": canonical_url(job.build),
"name": "test-snap",
"proxy_url": self.proxy_url,
"revocation_endpoint": self.revocation_endpoint,
@@ -297,6 +299,7 @@
"archive_private": False,
"archives": expected_archives,
"arch_tag": "i386",
+ "build_url": canonical_url(job.build),
"git_repository": ref.repository.git_https_url,
"git_path": ref.name,
"name": "test-snap",
@@ -321,6 +324,7 @@
"archive_private": False,
"archives": expected_archives,
"arch_tag": "i386",
+ "build_url": canonical_url(job.build),
"git_repository": ref.repository.git_https_url,
"name": "test-snap",
"proxy_url": self.proxy_url,
@@ -345,6 +349,7 @@
"archive_private": False,
"archives": expected_archives,
"arch_tag": "i386",
+ "build_url": canonical_url(job.build),
"git_repository": url,
"git_path": "master",
"name": "test-snap",
@@ -369,6 +374,7 @@
"archive_private": False,
"archives": expected_archives,
"arch_tag": "i386",
+ "build_url": canonical_url(job.build),
"git_repository": url,
"name": "test-snap",
"proxy_url": self.proxy_url,
=== modified file 'lib/lp/soyuz/model/binarypackagebuildbehaviour.py'
--- lib/lp/soyuz/model/binarypackagebuildbehaviour.py 2017-07-26 13:21:25 +0000
+++ lib/lp/soyuz/model/binarypackagebuildbehaviour.py 2018-03-01 22:17:02 +0000
@@ -20,7 +20,10 @@
BuildFarmJobBehaviourBase,
)
from lp.registry.interfaces.pocket import PackagePublishingPocket
-from lp.services.webapp import urlappend
+from lp.services.webapp import (
+ canonical_url,
+ urlappend,
+ )
from lp.soyuz.adapters.archivedependencies import (
get_primary_current_component,
get_sources_list_for_building,
@@ -169,6 +172,7 @@
yield get_sources_list_for_building(
build, das, build.source_package_release.name, logger=logger))
args['archive_private'] = build.archive.private
+ args['build_url'] = canonical_url(build)
args['build_debug_symbols'] = build.archive.build_debug_symbols
defer.returnValue(args)
=== modified file 'lib/lp/soyuz/model/livefsbuildbehaviour.py'
--- lib/lp/soyuz/model/livefsbuildbehaviour.py 2017-04-29 23:51:28 +0000
+++ lib/lp/soyuz/model/livefsbuildbehaviour.py 2018-03-01 22:17:02 +0000
@@ -24,6 +24,7 @@
BuildFarmJobBehaviourBase,
)
from lp.registry.interfaces.series import SeriesStatus
+from lp.services.webapp import canonical_url
from lp.soyuz.adapters.archivedependencies import (
get_sources_list_for_building,
)
@@ -94,6 +95,7 @@
yield get_sources_list_for_building(
build, build.distro_arch_series, None, logger=logger))
args["archive_private"] = build.archive.private
+ args["build_url"] = canonical_url(build)
defer.returnValue(args)
@defer.inlineCallbacks
=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py'
--- lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py 2018-02-14 11:13:47 +0000
+++ lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py 2018-03-01 22:17:02 +0000
@@ -58,6 +58,7 @@
from lp.services.config import config
from lp.services.librarian.interfaces import ILibraryFileAliasSet
from lp.services.log.logger import BufferLogger
+from lp.services.webapp import canonical_url
from lp.soyuz.adapters.archivedependencies import (
get_sources_list_for_building,
)
@@ -140,8 +141,9 @@
'archive_purpose': archive_purpose.name,
'archives': archives,
'build_debug_symbols': archive.build_debug_symbols,
+ 'build_url': canonical_url(build),
+ 'distribution': das.distroseries.distribution.name,
'ogrecomponent': component,
- 'distribution': das.distroseries.distribution.name,
'series': ds_name,
'suite': suite,
'trusted_keys': trusted_keys,
=== modified file 'lib/lp/soyuz/tests/test_livefsbuildbehaviour.py'
--- lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2018-02-14 11:13:47 +0000
+++ lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2018-03-01 22:17:02 +0000
@@ -42,6 +42,7 @@
from lp.registry.interfaces.series import SeriesStatus
from lp.services.features.testing import FeatureFixture
from lp.services.log.logger import BufferLogger
+from lp.services.webapp import canonical_url
from lp.soyuz.adapters.archivedependencies import (
get_sources_list_for_building,
)
@@ -196,6 +197,7 @@
"archive_private": False,
"archives": expected_archives,
"arch_tag": "i386",
+ "build_url": canonical_url(job.build),
"datestamp": "20140425-103800",
"pocket": "release",
"project": "distro",
Follow ups