[Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad-buildd/snap-proxy-allow-build into lp:launchpad-buildd

2016-11-04 Thread Colin Watson
Colin Watson has proposed merging 
lp:~cjwatson/launchpad-buildd/snap-proxy-allow-build into lp:launchpad-buildd.

Commit message:
buildsnap: Grant access to the proxy during the build phase as well as during 
the pull phase.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/snap-proxy-allow-build/+merge/310050

As discussed at the devices sprint.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~cjwatson/launchpad-buildd/snap-proxy-allow-build into lp:launchpad-buildd.
=== modified file 'buildsnap'
--- buildsnap	2016-09-16 10:43:09 +
+++ buildsnap	2016-11-04 10:53:13 +
@@ -136,8 +136,12 @@
 def build(self):
 """Run all build, stage and snap phases."""
 print("Running build phase...")
+env = {}
+if self.options.proxy_url:
+env["http_proxy"] = self.options.proxy_url
+env["https_proxy"] = self.options.proxy_url
 self.run_build_command(
-["snapcraft"], path=os.path.join("/build", self.name))
+["snapcraft"], path=os.path.join("/build", self.name), env=env)
 
 def revoke_token(self):
 """Revoke builder proxy token."""

=== modified file 'debian/changelog'
--- debian/changelog	2016-09-16 16:40:39 +
+++ debian/changelog	2016-11-04 10:53:13 +
@@ -1,3 +1,10 @@
+launchpad-buildd (141) UNRELEASED; urgency=medium
+
+  * buildsnap: Grant access to the proxy during the build phase as well as
+during the pull phase.
+
+ -- Colin Watson   Fri, 04 Nov 2016 10:47:41 +
+
 launchpad-buildd (140) trusty; urgency=medium
 
   * buildsnap: Catch urllib2.URLError as well as urllib2.HTTPError when

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/notify-changed-by-field into lp:launchpad

2016-11-04 Thread noreply
The proposal to merge lp:~cjwatson/launchpad/notify-changed-by-field into 
lp:launchpad has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/notify-changed-by-field/+merge/308587
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/snap-notify-team-permissions into lp:launchpad

2016-11-04 Thread Colin Watson
Colin Watson has proposed merging 
lp:~cjwatson/launchpad/snap-notify-team-permissions into lp:launchpad.

Commit message:
Fix snap store upload job failure notifications to handle the case where the 
requester is a team.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1638588 in Launchpad itself: "Snap store upload job notifications fail 
when snap build requester is a team"
  https://bugs.launchpad.net/launchpad/+bug/1638588

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/snap-notify-team-permissions/+merge/310049
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~cjwatson/launchpad/snap-notify-team-permissions into lp:launchpad.
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2016-10-05 10:22:10 +
+++ database/schema/security.cfg	2016-11-04 10:37:47 +
@@ -2572,6 +2572,7 @@
 [snap-build-job]
 type=user
 groups=script
+public.account  = SELECT
 public.archive  = SELECT
 public.builder  = SELECT
 public.distribution = SELECT
@@ -2588,3 +2589,4 @@
 public.snapbuildjob = SELECT, UPDATE
 public.snapfile = SELECT
 public.snappyseries = SELECT
+public.teammembership   = SELECT

=== modified file 'lib/lp/snappy/tests/test_snapbuildjob.py'
--- lib/lp/snappy/tests/test_snapbuildjob.py	2016-10-16 22:04:39 +
+++ lib/lp/snappy/tests/test_snapbuildjob.py	2016-11-04 10:37:47 +
@@ -133,8 +133,10 @@
 def test_run_unauthorized_notifies(self):
 # A run that gets 401 from the store sends mail.
 requester = self.factory.makePerson(name="requester")
+requester_team = self.factory.makeTeam(
+owner=requester, name="requester-team", members=[requester])
 snapbuild = self.factory.makeSnapBuild(
-requester=requester, name="test-snap", owner=requester,
+requester=requester_team, name="test-snap", owner=requester_team,
 builder=self.factory.makeBuilder())
 self.assertContentEqual([], snapbuild.store_upload_jobs)
 job = SnapStoreUploadJob.create(snapbuild)
@@ -159,25 +161,30 @@
 subject = notification["Subject"].replace("\n ", " ")
 self.assertEqual("Store authorization failed for test-snap", subject)
 self.assertEqual(
-"Requester", notification["X-Launchpad-Message-Rationale"])
+"Requester @requester-team",
+notification["X-Launchpad-Message-Rationale"])
 self.assertEqual(
-requester.name, notification["X-Launchpad-Message-For"])
+requester_team.name, notification["X-Launchpad-Message-For"])
 self.assertEqual(
 "snap-build-upload-unauthorized",
 notification["X-Launchpad-Notification-Type"])
 body, footer = notification.get_payload(decode=True).split("\n-- \n")
 self.assertIn(
-"http://launchpad.dev/~requester/+snap/test-snap/+authorize;, body)
+"http://launchpad.dev/~requester-team/+snap/test-snap/+authorize;,
+body)
 self.assertEqual(
-"http://launchpad.dev/~requester/+snap/test-snap/+build/%d\n;
-"You are the requester of the build.\n" % snapbuild.id, footer)
+"http://launchpad.dev/~requester-team/+snap/test-snap/+build/%d\n;
+"Your team Requester Team is the requester of the build.\n" %
+snapbuild.id, footer)
 
 def test_run_upload_failure_notifies(self):
 # A run that gets some other upload failure from the store sends
 # mail.
 requester = self.factory.makePerson(name="requester")
+requester_team = self.factory.makeTeam(
+owner=requester, name="requester-team", members=[requester])
 snapbuild = self.factory.makeSnapBuild(
-requester=requester, name="test-snap", owner=requester,
+requester=requester_team, name="test-snap", owner=requester_team,
 builder=self.factory.makeBuilder())
 self.assertContentEqual([], snapbuild.store_upload_jobs)
 job = SnapStoreUploadJob.create(snapbuild)
@@ -201,20 +208,22 @@
 subject = notification["Subject"].replace("\n ", " ")
 self.assertEqual("Store upload failed for test-snap", subject)
 self.assertEqual(
-"Requester", notification["X-Launchpad-Message-Rationale"])
+"Requester @requester-team",
+notification["X-Launchpad-Message-Rationale"])
 self.assertEqual(
-requester.name, notification["X-Launchpad-Message-For"])
+requester_team.name, notification["X-Launchpad-Message-For"])
 self.assertEqual(
 "snap-build-upload-failed",
 notification["X-Launchpad-Notification-Type"])
 body, footer =