← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] ~andersson123/autopkgtest-cloud:release-team-can-trigger-new-tests into autopkgtest-cloud:master

 

Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:release-team-can-trigger-new-tests into autopkgtest-cloud:master.

Requested reviews:
  Canonical's Ubuntu QA (canonical-ubuntu-qa)

For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/455637
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:release-team-can-trigger-new-tests into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-web/webcontrol/request/submit.py b/charms/focal/autopkgtest-web/webcontrol/request/submit.py
index 837d67e..46500ca 100644
--- a/charms/focal/autopkgtest-web/webcontrol/request/submit.py
+++ b/charms/focal/autopkgtest-web/webcontrol/request/submit.py
@@ -43,6 +43,12 @@ ALLOWED_TEAMS = [
     "canonical-foundations",
     "canonical-ubuntu-qa",
 ]
+
+ALLOWED_TEAMS_NEW_PACKAGES = [
+    "ubuntu-release",
+    "canonical-ubuntu-qa",
+]
+
 # not teams
 ALLOWED_USERS_PERPACKAGE = {"snapcraft": ["snappy-m-o"]}
 
@@ -142,12 +148,13 @@ class Submit:
         for ppa in ppas:
             if not self.is_valid_ppa(ppa):
                 raise NotFound("ppa", ppa)
-        if not ppas and not self.is_valid_package_with_results(
-            release, arch, package
-        ):
-            raise NotFound(
-                "package", package, "does not have any test results"
-            )
+        if not self.in_allowed_team(requester, ALLOWED_TEAMS_NEW_PACKAGES):
+            if not ppas and not self.is_valid_package_with_results(
+                release, arch, package
+            ):
+                raise NotFound(
+                    "package", package, "does not have any test results"
+                )
 
         if "migration-reference/0" in triggers:
             if len(triggers) != 1: