From f4de6976e84f7c6f717af82baa1c6634494dad11 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Mon, 2 Oct 2023 10:59:46 -0400 Subject: [PATCH 1/4] Set galaxy to old-galaxy for community tools and tests. No-Issue Signed-off-by: James Tanner --- galaxy_ng/app/api/v1/serializers.py | 2 +- galaxy_ng/app/utils/galaxy.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/galaxy_ng/app/api/v1/serializers.py b/galaxy_ng/app/api/v1/serializers.py index 37ac43d292..829999c91d 100644 --- a/galaxy_ng/app/api/v1/serializers.py +++ b/galaxy_ng/app/api/v1/serializers.py @@ -399,7 +399,7 @@ class LegacySyncSerializer(serializers.Serializer): baseurl = serializers.CharField( required=False, - default='https://galaxy.ansible.com/api/v1/roles/' + default='https://old-galaxy.ansible.com/api/v1/roles/' ) github_user = serializers.CharField(required=False) role_name = serializers.CharField(required=False) diff --git a/galaxy_ng/app/utils/galaxy.py b/galaxy_ng/app/utils/galaxy.py index 404dee5d0c..aee34f489e 100644 --- a/galaxy_ng/app/utils/galaxy.py +++ b/galaxy_ng/app/utils/galaxy.py @@ -82,7 +82,7 @@ def find_namespace(baseurl=None, name=None, id=None): logger.info(f'baseurl1: {baseurl}') if baseurl is None or not baseurl: - baseurl = 'https://galaxy.ansible.com' + baseurl = 'https://old-galaxy.ansible.com' baseurl += '/api/v1/namespaces' logger.info(f'baseurl2: {baseurl}') @@ -151,7 +151,7 @@ def upstream_namespace_iterator( """Abstracts the pagination of v2 collections into a generator with error handling.""" logger.info(f'baseurl1: {baseurl}') if baseurl is None or not baseurl: - baseurl = 'https://galaxy.ansible.com/api/v1/namespaces' + baseurl = 'https://old-galaxy.ansible.com/api/v1/namespaces' if not baseurl.rstrip().endswith('/api/v1/namespaces'): baseurl = baseurl.rstrip() + '/api/v1/namespaces' logger.info(f'baseurl2: {baseurl}') @@ -228,7 +228,7 @@ def upstream_collection_iterator( """Abstracts the pagination of v2 collections into a generator with error handling.""" logger.info(f'baseurl1: {baseurl}') if baseurl is None or not baseurl: - baseurl = 'https://galaxy.ansible.com/api/v2/collections' + baseurl = 'https://old-galaxy.ansible.com/api/v2/collections' logger.info(f'baseurl2: {baseurl}') # normalize the upstream url @@ -411,7 +411,7 @@ def upstream_role_iterator( """Abstracts the pagination of v1 roles into a generator with error handling.""" logger.info(f'baseurl1: {baseurl}') if baseurl is None or not baseurl: - baseurl = 'https://galaxy.ansible.com/api/v1/roles' + baseurl = 'https://old-galaxy.ansible.com/api/v1/roles' logger.info(f'baseurl2: {baseurl}') # normalize the upstream url From 9967f991dbb0138cc0d66a38489cd63725668a11 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Mon, 2 Oct 2023 11:14:39 -0400 Subject: [PATCH 2/4] Add a stub test. No-Issue Signed-off-by: James Tanner --- .../integration/community/test_community_namespace_rbac.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/galaxy_ng/tests/integration/community/test_community_namespace_rbac.py b/galaxy_ng/tests/integration/community/test_community_namespace_rbac.py index 331ea58d29..d41e9b41ce 100644 --- a/galaxy_ng/tests/integration/community/test_community_namespace_rbac.py +++ b/galaxy_ng/tests/integration/community/test_community_namespace_rbac.py @@ -474,3 +474,9 @@ def test_social_user_sync_with_changed_login(ansible_config): @pytest.mark.deployment_community def test_rbac_utils_get_owned_v3_namespaces(ansible_config): pass + + +@pytest.mark.skip(reason='this should be unit tested') +@pytest.mark.deployment_community +def test_community_tools_urls(ansible_config): + pass From b22693b33841de732eb20ee2a4d9ac295c50acf9 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Mon, 2 Oct 2023 11:40:54 -0400 Subject: [PATCH 3/4] Missed one. No-Issue Signed-off-by: James Tanner --- .../app/management/commands/sync-collection-download-counts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy_ng/app/management/commands/sync-collection-download-counts.py b/galaxy_ng/app/management/commands/sync-collection-download-counts.py index 20b3593caf..521dcafada 100644 --- a/galaxy_ng/app/management/commands/sync-collection-download-counts.py +++ b/galaxy_ng/app/management/commands/sync-collection-download-counts.py @@ -13,7 +13,7 @@ log = logging.getLogger(__name__) -DEFAULT_UPSTREAM = 'https://galaxy.ansible.com' +DEFAULT_UPSTREAM = 'https://old-galaxy.ansible.com' SKIPLIST = [ 'larrymou9', From 03a7cc8082822bbad7260a81d2091ae94278ceef Mon Sep 17 00:00:00 2001 From: James Tanner Date: Mon, 2 Oct 2023 12:31:41 -0400 Subject: [PATCH 4/4] One more. No-Issue Signed-off-by: James Tanner --- galaxy_ng/tests/integration/cli/test_community_sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy_ng/tests/integration/cli/test_community_sync.py b/galaxy_ng/tests/integration/cli/test_community_sync.py index 611566b69c..413df0586c 100644 --- a/galaxy_ng/tests/integration/cli/test_community_sync.py +++ b/galaxy_ng/tests/integration/cli/test_community_sync.py @@ -25,7 +25,7 @@ def test_community_collection_download_count_sync(ansible_config): # pick an upstream collection at random that does not exist locally ... sync_collection = None - base_url = 'https://galaxy.ansible.com' + base_url = 'https://old-galaxy.ansible.com' next_url = base_url + '/api/v2/collections/' while next_url: rr = requests.get(next_url)