Merge lp:~cjwatson/launchpad-buildd/marshal-build-request-fields into lp:launchpad-buildd

Proposed by Colin Watson
Status: Merged
Merged at revision: 376
Proposed branch: lp:~cjwatson/launchpad-buildd/marshal-build-request-fields
Merge into: lp:launchpad-buildd
Diff against target: 141 lines (+61/-9)
3 files modified
debian/changelog (+7/-0)
lpbuildd/snap.py (+8/-0)
lpbuildd/tests/test_snap.py (+46/-9)
To merge this branch: bzr merge lp:~cjwatson/launchpad-buildd/marshal-build-request-fields
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+367094@code.launchpad.net

Commit message

lpbuildd.snap: Pass build_request_id and build_request_timestamp through to the backend.

Description of the change

Otherwise the changes to lpbuildd.target.build_snap don't do much as they never see the relevant parameters.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2019-04-26 13:25:07 +0000
3+++ debian/changelog 2019-05-08 10:33:31 +0000
4@@ -1,3 +1,10 @@
5+launchpad-buildd (172) UNRELEASED; urgency=medium
6+
7+ * lpbuildd.snap: Pass build_request_id and build_request_timestamp through
8+ to the backend.
9+
10+ -- Colin Watson <cjwatson@ubuntu.com> Wed, 08 May 2019 11:31:10 +0100
11+
12 launchpad-buildd (171) xenial; urgency=medium
13
14 [ Matias Bordese ]
15
16=== modified file 'lpbuildd/snap.py'
17--- lpbuildd/snap.py 2019-03-12 16:09:00 +0000
18+++ lpbuildd/snap.py 2019-05-08 10:33:31 +0000
19@@ -258,6 +258,9 @@
20 """Initiate a build with a given set of files and chroot."""
21 self.name = extra_args["name"]
22 self.channels = extra_args.get("channels", {})
23+ self.build_request_id = extra_args.get("build_request_id")
24+ self.build_request_timestamp = extra_args.get(
25+ "build_request_timestamp")
26 self.build_url = extra_args.get("build_url")
27 self.branch = extra_args.get("branch")
28 self.git_repository = extra_args.get("git_repository")
29@@ -337,6 +340,11 @@
30 "Channels requested for unknown snaps: %s" %
31 " ".join(sorted(unknown_snaps)),
32 file=sys.stderr)
33+ if self.build_request_id:
34+ args.extend(["--build-request-id", str(self.build_request_id)])
35+ if self.build_request_timestamp:
36+ args.extend(
37+ ["--build-request-timestamp", self.build_request_timestamp])
38 if self.build_url:
39 args.extend(["--build-url", self.build_url])
40 args.extend(self.startProxy())
41
42=== modified file 'lpbuildd/tests/test_snap.py'
43--- lpbuildd/tests/test_snap.py 2019-03-12 16:42:45 +0000
44+++ lpbuildd/tests/test_snap.py 2019-05-08 10:33:31 +0000
45@@ -78,8 +78,6 @@
46 "series": "xenial",
47 "arch_tag": "i386",
48 "name": "test-snap",
49- "git_repository": "https://git.launchpad.dev/~example/+git/snap",
50- "git_path": "master",
51 }
52 if args is not None:
53 extra_args.update(args)
54@@ -98,8 +96,6 @@
55 expected_command = [
56 "sharepath/bin/in-target", "in-target", "buildsnap",
57 "--backend=lxd", "--series=xenial", "--arch=i386", self.buildid,
58- "--git-repository", "https://git.launchpad.dev/~example/+git/snap",
59- "--git-path", "master",
60 ]
61 if options is not None:
62 expected_command.extend(options)
63@@ -122,7 +118,21 @@
64 @defer.inlineCallbacks
65 def test_iterate(self):
66 # The build manager iterates a normal build from start to finish.
67- yield self.startBuild()
68+ args = {
69+ "build_request_id": 13,
70+ "build_request_timestamp": "2018-04-13T14:50:02Z",
71+ "build_url": "https://launchpad.example/build",
72+ "git_repository": "https://git.launchpad.dev/~example/+git/snap",
73+ "git_path": "master",
74+ }
75+ expected_options = [
76+ "--build-request-id", "13",
77+ "--build-request-timestamp", "2018-04-13T14:50:02Z",
78+ "--build-url", "https://launchpad.example/build",
79+ "--git-repository", "https://git.launchpad.dev/~example/+git/snap",
80+ "--git-path", "master",
81+ ]
82+ yield self.startBuild(args, expected_options)
83
84 log_path = os.path.join(self.buildmanager._cachepath, "buildlog")
85 with open(log_path, "w") as log:
86@@ -162,7 +172,15 @@
87 def test_iterate_with_manifest(self):
88 # The build manager iterates a build that uploads a manifest from
89 # start to finish.
90- yield self.startBuild()
91+ args = {
92+ "git_repository": "https://git.launchpad.dev/~example/+git/snap",
93+ "git_path": "master",
94+ }
95+ expected_options = [
96+ "--git-repository", "https://git.launchpad.dev/~example/+git/snap",
97+ "--git-path", "master",
98+ ]
99+ yield self.startBuild(args, expected_options)
100
101 log_path = os.path.join(self.buildmanager._cachepath, "buildlog")
102 with open(log_path, "w") as log:
103@@ -205,8 +223,17 @@
104 def test_iterate_with_build_source_tarball(self):
105 # The build manager iterates a build that uploads a source tarball
106 # from start to finish.
107- yield self.startBuild(
108- {"build_source_tarball": True}, ["--build-source-tarball"])
109+ args = {
110+ "git_repository": "https://git.launchpad.dev/~example/+git/snap",
111+ "git_path": "master",
112+ "build_source_tarball": True,
113+ }
114+ expected_options = [
115+ "--git-repository", "https://git.launchpad.dev/~example/+git/snap",
116+ "--git-path", "master",
117+ "--build-source-tarball",
118+ ]
119+ yield self.startBuild(args, expected_options)
120
121 log_path = os.path.join(self.buildmanager._cachepath, "buildlog")
122 with open(log_path, "w") as log:
123@@ -248,7 +275,17 @@
124 @defer.inlineCallbacks
125 def test_iterate_private(self):
126 # The build manager iterates a private build from start to finish.
127- yield self.startBuild({"private": True}, ["--private"])
128+ args = {
129+ "git_repository": "https://git.launchpad.dev/~example/+git/snap",
130+ "git_path": "master",
131+ "private": True,
132+ }
133+ expected_options = [
134+ "--git-repository", "https://git.launchpad.dev/~example/+git/snap",
135+ "--git-path", "master",
136+ "--private",
137+ ]
138+ yield self.startBuild(args, expected_options)
139
140 log_path = os.path.join(self.buildmanager._cachepath, "buildlog")
141 with open(log_path, "w") as log:

Subscribers

People subscribed via source and target branches

to all changes: