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
1diff --git a/lib/lp/oci/interfaces/ocirecipe.py b/lib/lp/oci/interfaces/ocirecipe.py
2index c469886..ea14d04 100644
3--- a/lib/lp/oci/interfaces/ocirecipe.py
4+++ b/lib/lp/oci/interfaces/ocirecipe.py
5@@ -164,11 +164,11 @@ class IOCIRecipeBuildRequest(Interface):
6 error_message = exported(TextLine(
7 title=_("Error message"), required=False, readonly=True))
8
9- builds = exported(CollectionField(
10+ builds = CollectionField(
11 title=_("Builds produced by this request"),
12 # Really IOCIRecipeBuild, patched in lp.oci.interfaces.webservice.
13 value_type=Reference(schema=Interface),
14- required=True, readonly=True))
15+ required=True, readonly=True)
16
17
18 class IOCIRecipeView(Interface):
19diff --git a/lib/lp/oci/tests/test_ocirecipe.py b/lib/lp/oci/tests/test_ocirecipe.py
20index 965096b..42e854a 100644
21--- a/lib/lp/oci/tests/test_ocirecipe.py
22+++ b/lib/lp/oci/tests/test_ocirecipe.py
23@@ -977,17 +977,4 @@ class TestOCIRecipeAsyncWebservice(TestCaseWithFactory):
24 date_requested=Equals(fmt_date(build_request.date_requested)),
25 date_finished=Equals(fmt_date(build_request.date_finished)),
26 error_message=Equals(build_request.error_message),
27- builds_collection_link=Equals(build_request_url + '/builds')
28 )))
29-
30- builds = self.webservice.get(
31- ws_build_request["builds_collection_link"]).jsonBody()["entries"]
32- with person_logged_in(self.person):
33- self.assertThat(builds, MatchesSetwise(*[
34- ContainsDict({
35- "buildstate": Equals("Needs building"),
36- "title": Equals(
37- "%s build of %s" % (
38- arch_series.processor.name, api_url(oci_recipe)))
39- })
40- for arch_series in distro_arch_series]))