launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #21484
[Merge] lp:~cjwatson/launchpad/snap-build-job-repr into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/snap-build-job-repr into lp:launchpad.
Commit message:
Give SnapBuildJob a more useful __repr__.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/snap-build-job-repr/+merge/322699
This makes it easier to find things in celery logs.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/snap-build-job-repr into lp:launchpad.
=== modified file 'lib/lp/snappy/model/snapbuildjob.py'
--- lib/lp/snappy/model/snapbuildjob.py 2017-04-03 14:43:22 +0000
+++ lib/lp/snappy/model/snapbuildjob.py 2017-04-18 16:37:44 +0000
@@ -124,7 +124,10 @@
def __repr__(self):
"""An informative representation of the job."""
- return "<%s for %s>" % (self.__class__.__name__, self.snapbuild.title)
+ snap = self.snapbuild.snap
+ return "<%s for ~%s/+snap/%s/+build/%d>" % (
+ self.__class__.__name__, snap.owner.name, snap.name,
+ self.snapbuild.id)
@classmethod
def get(cls, job_id):
=== modified file 'lib/lp/snappy/tests/test_snapbuildjob.py'
--- lib/lp/snappy/tests/test_snapbuildjob.py 2017-04-03 14:43:22 +0000
+++ lib/lp/snappy/tests/test_snapbuildjob.py 2017-04-18 16:37:44 +0000
@@ -98,7 +98,9 @@
snapbuild = self.factory.makeSnapBuild()
job = SnapStoreUploadJob.create(snapbuild)
self.assertEqual(
- "<SnapStoreUploadJob for %s>" % snapbuild.title, repr(job))
+ "<SnapStoreUploadJob for ~%s/+snap/%s/+build/%d>" % (
+ snapbuild.snap.owner.name, snapbuild.snap.name, snapbuild.id),
+ repr(job))
def makeSnapBuild(self, **kwargs):
# Make a build with a builder and a webhook.
Follow ups