Merge ~pelpsi/launchpad:refactor-requestProxyToken-function into launchpad:master

Proposed by Simone Pelosi
Status: Rejected
Rejected by: Simone Pelosi
Proposed branch: ~pelpsi/launchpad:refactor-requestProxyToken-function
Merge into: launchpad:master
Diff against target: 31 lines (+3/-15)
1 file modified
lib/lp/buildmaster/builderproxy.py (+3/-15)
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+462143@code.launchpad.net

Commit message

Refactor requestProxyToken function to be aligned with requestFetchServiceSession

To post a comment you must log in.

Unmerged commits

4b31602... by Simone Pelosi

Refactor _requestProxyToken to follow _requestFetchServiceSession

Succeeded
[SUCCEEDED] docs:0 (build)
[SUCCEEDED] lint:0 (build)
[SUCCEEDED] mypy:0 (build)
13 of 3 results
61d3f6b... by Simone Pelosi

Address comments

Succeeded
[SUCCEEDED] docs:0 (build)
[SUCCEEDED] lint:0 (build)
[SUCCEEDED] mypy:0 (build)
13 of 3 results
bba9eaf... by Simone Pelosi

Address comments

Succeeded
[SUCCEEDED] docs:0 (build)
[SUCCEEDED] lint:0 (build)
[SUCCEEDED] mypy:0 (build)
13 of 3 results
0b7b101... by Simone Pelosi

Add test with Fetch Service flag off

7f7c0e0... by Simone Pelosi

Add policy parameter to API

b8af27b... by Simone Pelosi

Clean code

074d121... by Simone Pelosi

Add fetch service session API

Update BuilderProxyMixin class to switch between
Fetch Service and classic Builder Proxy depending on
use_fetch_service flag.
Add test suite for Fetch Service and fetchservice.py mock class
for API.
Add Fetch Service API information on schema-lazr.conf.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/buildmaster/builderproxy.py b/lib/lp/buildmaster/builderproxy.py
2index 1ac121f..a1d475b 100644
3--- a/lib/lp/buildmaster/builderproxy.py
4+++ b/lib/lp/buildmaster/builderproxy.py
5@@ -84,23 +84,11 @@ class BuilderProxyMixin:
6
7 @defer.inlineCallbacks
8 def _requestProxyToken(self):
9- admin_username = _get_proxy_config(
10+ admin_username = _get_value_from_config(
11 "builder_proxy_auth_api_admin_username"
12 )
13- if not admin_username:
14- raise CannotBuild(
15- "builder_proxy_auth_api_admin_username is not configured."
16- )
17- secret = _get_proxy_config("builder_proxy_auth_api_admin_secret")
18- if not secret:
19- raise CannotBuild(
20- "builder_proxy_auth_api_admin_secret is not configured."
21- )
22- url = _get_proxy_config("builder_proxy_auth_api_endpoint")
23- if not secret:
24- raise CannotBuild(
25- "builder_proxy_auth_api_endpoint is not configured."
26- )
27+ secret = _get_value_from_config("builder_proxy_auth_api_admin_secret")
28+ url = _get_value_from_config("builder_proxy_auth_api_endpoint")
29 timestamp = int(time.time())
30 proxy_username = "{build_id}-{timestamp}".format(
31 build_id=self.build.build_cookie, timestamp=timestamp

Subscribers

People subscribed via source and target branches

to status/vote changes: