← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:weaken-built-using into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:weaken-built-using into launchpad:master.

Commit message:
Ignore unparsable Built-Using for now

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/383121

We intend for this to fail eventually, but we have some adjustments to make before it's fully workable, so temporarily ignore this exception.  This is no worse than the previous state where Built-Using was added to user_defined_fields (as it still is) but otherwise ignored.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:weaken-built-using into launchpad:master.
diff --git a/lib/lp/soyuz/model/binarypackagebuild.py b/lib/lp/soyuz/model/binarypackagebuild.py
index 470a8f2..0551b82 100644
--- a/lib/lp/soyuz/model/binarypackagebuild.py
+++ b/lib/lp/soyuz/model/binarypackagebuild.py
@@ -107,6 +107,7 @@ from lp.soyuz.interfaces.binarypackagebuild import (
     )
 from lp.soyuz.interfaces.binarysourcereference import (
     IBinarySourceReferenceSet,
+    UnparsableBuiltUsing,
     )
 from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries
 from lp.soyuz.interfaces.packageset import IPackagesetSet
@@ -683,8 +684,14 @@ class BinaryPackageBuild(PackageBuildMixin, SQLBase):
             debug_package=debug_package,
             user_defined_fields=user_defined_fields, homepage=homepage)
         if built_using:
-            getUtility(IBinarySourceReferenceSet).createFromRelationship(
-                bpr, built_using, BinarySourceReferenceType.BUILT_USING)
+            try:
+                getUtility(IBinarySourceReferenceSet).createFromRelationship(
+                    bpr, built_using, BinarySourceReferenceType.BUILT_USING)
+            except UnparsableBuiltUsing:
+                # XXX cjwatson 2020-04-29: We intend for this to fail the
+                # upload eventually, but still have some details to sort
+                # out, so ignore it for now.
+                pass
         return bpr
 
     def estimateDuration(self):