| |
@@ -453,28 +453,34 @@
|
| |
def test_protected_unsupported_branch(self, mock_requests):
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {
|
| |
- "name": "F34",
|
| |
- "long_name": "Fedora 34",
|
| |
- "version": "34",
|
| |
- "id_prefix": "FEDORA",
|
| |
- "branch": "f34",
|
| |
- "dist_tag": "f34",
|
| |
- "stable_tag": "f34-updates",
|
| |
- "testing_tag": "f34-updates-testing",
|
| |
- "candidate_tag": "f34-updates-candidate",
|
| |
- "pending_signing_tag": "f34-signing-pending",
|
| |
- "pending_testing_tag": "f34-updates-testing-pending",
|
| |
- "pending_stable_tag": "f34-updates-pending",
|
| |
- "override_tag": "f34-override",
|
| |
- "mail_template": "fedora_errata_template",
|
| |
- "state": "archived",
|
| |
- "composed_by_bodhi": True,
|
| |
- "create_automatic_updates": False,
|
| |
- "package_manager": "dnf",
|
| |
- "testing_repository": "updates-testing",
|
| |
- "eol": None,
|
| |
- }
|
| |
+ res.json.side_effect = (
|
| |
+ {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ },
|
| |
+ {
|
| |
+ "name": "F34",
|
| |
+ "long_name": "Fedora 34",
|
| |
+ "version": "34",
|
| |
+ "id_prefix": "FEDORA",
|
| |
+ "branch": "f34",
|
| |
+ "dist_tag": "f34",
|
| |
+ "stable_tag": "f34-updates",
|
| |
+ "testing_tag": "f34-updates-testing",
|
| |
+ "candidate_tag": "f34-updates-candidate",
|
| |
+ "pending_signing_tag": "f34-signing-pending",
|
| |
+ "pending_testing_tag": "f34-updates-testing-pending",
|
| |
+ "pending_stable_tag": "f34-updates-pending",
|
| |
+ "override_tag": "f34-override",
|
| |
+ "mail_template": "fedora_errata_template",
|
| |
+ "state": "archived",
|
| |
+ "composed_by_bodhi": True,
|
| |
+ "create_automatic_updates": False,
|
| |
+ "package_manager": "dnf",
|
| |
+ "testing_repository": "updates-testing",
|
| |
+ "eol": None,
|
| |
+ },
|
| |
+ )
|
| |
mock_requests.get.return_value = res
|
| |
project = self.create_namespaced_project("rpms", "test")
|
| |
|
| |
@@ -483,7 +489,7 @@
|
| |
self.session,
|
| |
project=project,
|
| |
username="pingou",
|
| |
- refname="refs/heads/f26",
|
| |
+ refname="refs/heads/f34",
|
| |
pull_request=None,
|
| |
repodir=None,
|
| |
repotype="main",
|
| |
@@ -494,7 +500,7 @@
|
| |
)
|
| |
|
| |
self.expect_info_msg(
|
| |
- "Branch refs/heads/f26 is unsupported. Cannot push to a disabled branch (maybe eol?)."
|
| |
+ "Branch refs/heads/f34 is unsupported. Cannot push to a disabled branch (maybe eol?)."
|
| |
)
|
| |
|
| |
@patch("dist_git_auth.requests")
|
| |
@@ -503,26 +509,31 @@
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
res.json.return_value = {
|
| |
- "name": "F39",
|
| |
- "long_name": "Fedora 39",
|
| |
- "version": "39",
|
| |
- "id_prefix": "FEDORA",
|
| |
- "branch": "f39",
|
| |
- "dist_tag": "f39",
|
| |
- "stable_tag": "f39-updates",
|
| |
- "testing_tag": "f39-updates-testing",
|
| |
- "candidate_tag": "f39-updates-candidate",
|
| |
- "pending_signing_tag": "f39-signing-pending",
|
| |
- "pending_testing_tag": "f39-updates-testing-pending",
|
| |
- "pending_stable_tag": "f39-updates-pending",
|
| |
- "override_tag": "f39-override",
|
| |
- "mail_template": "fedora_errata_template",
|
| |
- "state": "current",
|
| |
- "composed_by_bodhi": True,
|
| |
- "create_automatic_updates": False,
|
| |
- "package_manager": "dnf",
|
| |
- "testing_repository": "updates-testing",
|
| |
- "eol": "2024-11-12",
|
| |
+ "pages": 1,
|
| |
+ "releases": [
|
| |
+ {
|
| |
+ "name": "F39",
|
| |
+ "long_name": "Fedora 39",
|
| |
+ "version": "39",
|
| |
+ "id_prefix": "FEDORA",
|
| |
+ "branch": "f39",
|
| |
+ "dist_tag": "f39",
|
| |
+ "stable_tag": "f39-updates",
|
| |
+ "testing_tag": "f39-updates-testing",
|
| |
+ "candidate_tag": "f39-updates-candidate",
|
| |
+ "pending_signing_tag": "f39-signing-pending",
|
| |
+ "pending_testing_tag": "f39-updates-testing-pending",
|
| |
+ "pending_stable_tag": "f39-updates-pending",
|
| |
+ "override_tag": "f39-override",
|
| |
+ "mail_template": "fedora_errata_template",
|
| |
+ "state": "current",
|
| |
+ "composed_by_bodhi": True,
|
| |
+ "create_automatic_updates": False,
|
| |
+ "package_manager": "dnf",
|
| |
+ "testing_repository": "updates-testing",
|
| |
+ "eol": "2024-11-12",
|
| |
+ },
|
| |
+ ],
|
| |
}
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
@@ -531,7 +542,7 @@
|
| |
self.session,
|
| |
project=project,
|
| |
username="pingou",
|
| |
- refname="refs/heads/f27",
|
| |
+ refname="refs/heads/f39",
|
| |
pull_request=None,
|
| |
repodir=None,
|
| |
repotype="main",
|
| |
@@ -541,7 +552,7 @@
|
| |
)
|
| |
)
|
| |
|
| |
- self.expect_info_msg("Branch refs/heads/f27 is supported")
|
| |
+ self.expect_info_msg("Branch refs/heads/f39 is supported")
|
| |
|
| |
@patch("dist_git_auth.requests")
|
| |
def test_protected_supported_branch_non_committer(self, mock_requests):
|
| |
@@ -549,26 +560,31 @@
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
res.json.return_value = {
|
| |
- "name": "F39",
|
| |
- "long_name": "Fedora 39",
|
| |
- "version": "39",
|
| |
- "id_prefix": "FEDORA",
|
| |
- "branch": "f39",
|
| |
- "dist_tag": "f39",
|
| |
- "stable_tag": "f39-updates",
|
| |
- "testing_tag": "f39-updates-testing",
|
| |
- "candidate_tag": "f39-updates-candidate",
|
| |
- "pending_signing_tag": "f39-signing-pending",
|
| |
- "pending_testing_tag": "f39-updates-testing-pending",
|
| |
- "pending_stable_tag": "f39-updates-pending",
|
| |
- "override_tag": "f39-override",
|
| |
- "mail_template": "fedora_errata_template",
|
| |
- "state": "current",
|
| |
- "composed_by_bodhi": True,
|
| |
- "create_automatic_updates": False,
|
| |
- "package_manager": "dnf",
|
| |
- "testing_repository": "updates-testing",
|
| |
- "eol": "2024-11-12",
|
| |
+ "pages": 1,
|
| |
+ "releases": [
|
| |
+ {
|
| |
+ "name": "F39",
|
| |
+ "long_name": "Fedora 39",
|
| |
+ "version": "39",
|
| |
+ "id_prefix": "FEDORA",
|
| |
+ "branch": "f39",
|
| |
+ "dist_tag": "f39",
|
| |
+ "stable_tag": "f39-updates",
|
| |
+ "testing_tag": "f39-updates-testing",
|
| |
+ "candidate_tag": "f39-updates-candidate",
|
| |
+ "pending_signing_tag": "f39-signing-pending",
|
| |
+ "pending_testing_tag": "f39-updates-testing-pending",
|
| |
+ "pending_stable_tag": "f39-updates-pending",
|
| |
+ "override_tag": "f39-override",
|
| |
+ "mail_template": "fedora_errata_template",
|
| |
+ "state": "current",
|
| |
+ "composed_by_bodhi": True,
|
| |
+ "create_automatic_updates": False,
|
| |
+ "package_manager": "dnf",
|
| |
+ "testing_repository": "updates-testing",
|
| |
+ "eol": "2024-11-12",
|
| |
+ },
|
| |
+ ],
|
| |
}
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
@@ -577,7 +593,109 @@
|
| |
self.session,
|
| |
project=project,
|
| |
username="foo",
|
| |
- refname="refs/heads/f27",
|
| |
+ refname="refs/heads/f39",
|
| |
+ pull_request=None,
|
| |
+ repodir=None,
|
| |
+ repotype="main",
|
| |
+ revfrom=None,
|
| |
+ revto=None,
|
| |
+ is_internal=False,
|
| |
+ )
|
| |
+ )
|
| |
+
|
| |
+ self.expect_info_msg("Branch refs/heads/f39 is supported")
|
| |
+
|
| |
+ @patch("dist_git_auth.requests")
|
| |
+ def test_protected_supported_branch_epel_minor(self, mock_requests):
|
| |
+ project = self.create_namespaced_project("rpms", "test")
|
| |
+ res = Mock()
|
| |
+ res.ok = True
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [
|
| |
+ {
|
| |
+ "name": "EPEL-10.1",
|
| |
+ "long_name": "Fedora EPEL 10.1",
|
| |
+ "version": "10.1",
|
| |
+ "id_prefix": "FEDORA-EPEL",
|
| |
+ "branch": "epel10.1",
|
| |
+ "dist_tag": "epel10.1",
|
| |
+ "stable_tag": "epel10.1",
|
| |
+ "testing_tag": "epel10.1-testing",
|
| |
+ "candidate_tag": "epel10.1-testing-candidate",
|
| |
+ "pending_signing_tag": "epel10.1-signing-pending",
|
| |
+ "pending_testing_tag": "epel10.1-testing-pending",
|
| |
+ "pending_stable_tag": "epel10.1-pending",
|
| |
+ "override_tag": "epel10.1-override",
|
| |
+ "mail_template": "fedora_epel_legacy_errata_template",
|
| |
+ "state": "current",
|
| |
+ "composed_by_bodhi": True,
|
| |
+ "create_automatic_updates": False,
|
| |
+ "package_manager": "unspecified",
|
| |
+ "testing_repository": None,
|
| |
+ "eol": None,
|
| |
+ },
|
| |
+ ],
|
| |
+ }
|
| |
+ mock_requests.get.return_value = res
|
| |
+
|
| |
+ self.assertFalse(
|
| |
+ self.dga.check_acl(
|
| |
+ self.session,
|
| |
+ project=project,
|
| |
+ username="foo",
|
| |
+ refname="refs/heads/epel10.1",
|
| |
+ pull_request=None,
|
| |
+ repodir=None,
|
| |
+ repotype="main",
|
| |
+ revfrom=None,
|
| |
+ revto=None,
|
| |
+ is_internal=False,
|
| |
+ )
|
| |
+ )
|
| |
+
|
| |
+ self.expect_info_msg("Branch refs/heads/epel10.1 is supported")
|
| |
+
|
| |
+ @patch("dist_git_auth.requests")
|
| |
+ def test_protected_supported_branch_epel(self, mock_requests):
|
| |
+ project = self.create_namespaced_project("rpms", "test")
|
| |
+ res = Mock()
|
| |
+ res.ok = True
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [
|
| |
+ {
|
| |
+ "name": "EPEL-10.0",
|
| |
+ "long_name": "Fedora EPEL 10.0",
|
| |
+ "version": "10.0",
|
| |
+ "id_prefix": "FEDORA-EPEL",
|
| |
+ "branch": "epel10",
|
| |
+ "dist_tag": "epel10.0",
|
| |
+ "stable_tag": "epel10.0",
|
| |
+ "testing_tag": "epel10.0-testing",
|
| |
+ "candidate_tag": "epel10.0-testing-candidate",
|
| |
+ "pending_signing_tag": "epel10.0-signing-pending",
|
| |
+ "pending_testing_tag": "epel10.0-testing-pending",
|
| |
+ "pending_stable_tag": "epel10.0-pending",
|
| |
+ "override_tag": "epel10.0-override",
|
| |
+ "mail_template": "fedora_epel_legacy_errata_template",
|
| |
+ "state": "current",
|
| |
+ "composed_by_bodhi": True,
|
| |
+ "create_automatic_updates": False,
|
| |
+ "package_manager": "unspecified",
|
| |
+ "testing_repository": None,
|
| |
+ "eol": None,
|
| |
+ },
|
| |
+ ],
|
| |
+ }
|
| |
+ mock_requests.get.return_value = res
|
| |
+
|
| |
+ self.assertFalse(
|
| |
+ self.dga.check_acl(
|
| |
+ self.session,
|
| |
+ project=project,
|
| |
+ username="foo",
|
| |
+ refname="refs/heads/epel10",
|
| |
pull_request=None,
|
| |
repodir=None,
|
| |
repotype="main",
|
| |
@@ -587,14 +705,17 @@
|
| |
)
|
| |
)
|
| |
|
| |
- self.expect_info_msg("Branch refs/heads/f27 is supported")
|
| |
+ self.expect_info_msg("Branch refs/heads/epel10 is supported")
|
| |
|
| |
@patch("dist_git_auth.requests")
|
| |
def test_protected_unspecified_branch_blacklisted(self, mock_requests):
|
| |
project = self.create_namespaced_project("rpms", "test")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertFalse(
|
| |
@@ -630,7 +751,10 @@
|
| |
project = self.create_namespaced_project("rpms", "test")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertTrue(
|
| |
@@ -655,7 +779,10 @@
|
| |
project = self.create_namespaced_project("rpms", "test")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertFalse(
|
| |
@@ -712,7 +839,10 @@
|
| |
project = get_project(self.session, name="test", namespace="rpms")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertFalse(
|
| |
@@ -738,7 +868,10 @@
|
| |
project = get_project(self.session, name="test", namespace="rpms")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertTrue(
|
| |
@@ -880,7 +1013,10 @@
|
| |
project = self.create_namespaced_project("rpms", "test")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertFalse(
|
| |
@@ -905,7 +1041,10 @@
|
| |
project = self.create_namespaced_project("rpms", "test")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertFalse(
|
| |
@@ -964,7 +1103,10 @@
|
| |
project = get_project(self.session, name="test", namespace="rpms")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertFalse(
|
| |
@@ -1020,7 +1162,10 @@
|
| |
project = get_project(self.session, name="cockpit", namespace="container")
|
| |
res = Mock()
|
| |
res.ok = True
|
| |
- res.json.return_value = {}
|
| |
+ res.json.return_value = {
|
| |
+ "pages": 1,
|
| |
+ "releases": [],
|
| |
+ }
|
| |
mock_requests.get.return_value = res
|
| |
|
| |
self.assertTrue(
|
| |
The important parts of this pull request are in the last commit. The commits before that are mainly for getting the tests in order so that the real changes in the last commit are more trustworthy. Please see the individual commit messages for more details.
I do want to emphasize that without this we are blocked from pushing to any epel10 branches.
https://pagure.io/releng/issue/12236