diff --git a/britney.conf b/britney.conf index 1fc1399..d87b87f 100644 --- a/britney.conf +++ b/britney.conf @@ -113,6 +113,7 @@ ADT_SWIFT_REGION = # result logs ADT_PRIVATE_SHARED = ADT_PRIVATE_URL = https://autopkgtest.ubuntu.com/private-results/ +ADT_PRIVATE_RETRY = # Base URL for autopkgtest site, used for links in the excuses ADT_CI_URL = https://autopkgtest.ubuntu.com/ ADT_HUGE = 20 diff --git a/britney.conf.template b/britney.conf.template index d46877e..f662aa4 100644 --- a/britney.conf.template +++ b/britney.conf.template @@ -135,6 +135,7 @@ ADT_SWIFT_REGION = # result logs ADT_PRIVATE_SHARED = ADT_PRIVATE_URL = +ADT_PRIVATE_RETRY = # Base URL for autopkgtest site, used for links in the excuses ADT_CI_URL = https://example.com/ # Enable the huge queue for packages that trigger vast amounts of tests to not diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 5751523..c80adf1 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -492,10 +492,22 @@ class AutopkgtestPolicy(BasePolicy): if status == 'REGRESSION': if self.options.adt_retry_url_mech == 'run_id': retry_url = self.options.adt_ci_url + 'api/v1/retry/' + run_id + elif self.options.adt_private_retry: + # if a custom retry url mechanism has been given, + # use that - but instead of passing PPAs with + # sensitive credentials, we pass additional context + # that will help the backend identify what env + # needs to be used + retry_url = self.options.adt_private_retry + \ + urllib.parse.urlencode([('release', self.options.series), + ('arch', arch), + ('package', testsrc), + ('trigger', trigger), + ('context', self.swift_container)]) elif not any('@' in ppa for ppa in self.options.adt_ppas): - # private PPAs currently should not display a retry - # button until we can guarantee that the secrets - # will not leak + # otherwise private PPAs currently should not + # display a retry button as we can not guarantee + # that the secrets will not leak retry_url = self.options.adt_ci_url + 'request.cgi?' + \ urllib.parse.urlencode([('release', self.options.series), ('arch', arch), diff --git a/tests/__init__.py b/tests/__init__.py index 64a960c..f174652 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -401,7 +401,8 @@ ADT_SWIFT_AUTH_URL = ADT_SWIFT_TENANT = ADT_SWIFT_REGION = ADT_PRIVATE_SHARED = -ADT_PRIVATE_URL = +ADT_PRIVATE_URL = +ADT_PRIVATE_RETRY = ADT_CI_URL = https://autopkgtest.ubuntu.com/ ADT_HUGE = 20 ADT_SHOW_IRRELEVANT = no