Merge ~pappacena/launchpad:fix-ocirecipebuild-api-export into launchpad:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 4f9351aacce700fa0cc08da5fc0b6d6d92ef1be3
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:fix-ocirecipebuild-api-export
Merge into: launchpad:master
Diff against target: 40 lines (+2/-15)
2 files modified
lib/lp/oci/interfaces/ocirecipe.py (+2/-2)
lib/lp/oci/tests/test_ocirecipe.py (+0/-13)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+383028@code.launchpad.net

Commit message

Disabling the export of IOCIRecipeBuildRequest.builds on the API.

We need to discuss how this OCIRecipeBuilds will be exported on the webservice, and the exporting of IOCIRecipeBuildRequest.builds is breaking the app server startup.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

Self-approving to fix the build.

I'll open a follow-up MP with a proper fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/oci/interfaces/ocirecipe.py b/lib/lp/oci/interfaces/ocirecipe.py
index c469886..ea14d04 100644
--- a/lib/lp/oci/interfaces/ocirecipe.py
+++ b/lib/lp/oci/interfaces/ocirecipe.py
@@ -164,11 +164,11 @@ class IOCIRecipeBuildRequest(Interface):
164 error_message = exported(TextLine(164 error_message = exported(TextLine(
165 title=_("Error message"), required=False, readonly=True))165 title=_("Error message"), required=False, readonly=True))
166166
167 builds = exported(CollectionField(167 builds = CollectionField(
168 title=_("Builds produced by this request"),168 title=_("Builds produced by this request"),
169 # Really IOCIRecipeBuild, patched in lp.oci.interfaces.webservice.169 # Really IOCIRecipeBuild, patched in lp.oci.interfaces.webservice.
170 value_type=Reference(schema=Interface),170 value_type=Reference(schema=Interface),
171 required=True, readonly=True))171 required=True, readonly=True)
172172
173173
174class IOCIRecipeView(Interface):174class IOCIRecipeView(Interface):
diff --git a/lib/lp/oci/tests/test_ocirecipe.py b/lib/lp/oci/tests/test_ocirecipe.py
index 965096b..42e854a 100644
--- a/lib/lp/oci/tests/test_ocirecipe.py
+++ b/lib/lp/oci/tests/test_ocirecipe.py
@@ -977,17 +977,4 @@ class TestOCIRecipeAsyncWebservice(TestCaseWithFactory):
977 date_requested=Equals(fmt_date(build_request.date_requested)),977 date_requested=Equals(fmt_date(build_request.date_requested)),
978 date_finished=Equals(fmt_date(build_request.date_finished)),978 date_finished=Equals(fmt_date(build_request.date_finished)),
979 error_message=Equals(build_request.error_message),979 error_message=Equals(build_request.error_message),
980 builds_collection_link=Equals(build_request_url + '/builds')
981 )))980 )))
982
983 builds = self.webservice.get(
984 ws_build_request["builds_collection_link"]).jsonBody()["entries"]
985 with person_logged_in(self.person):
986 self.assertThat(builds, MatchesSetwise(*[
987 ContainsDict({
988 "buildstate": Equals("Needs building"),
989 "title": Equals(
990 "%s build of %s" % (
991 arch_series.processor.name, api_url(oci_recipe)))
992 })
993 for arch_series in distro_arch_series]))