Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set galaxy to old-galaxy for community tools and tests. #1911

Merged
merged 4 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion galaxy_ng/app/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
log = logging.getLogger(__name__)


DEFAULT_UPSTREAM = 'https://galaxy.ansible.com'
DEFAULT_UPSTREAM = 'https://old-galaxy.ansible.com'

SKIPLIST = [
'larrymou9',
Expand Down
8 changes: 4 additions & 4 deletions galaxy_ng/app/utils/galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down Expand Up @@ -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}')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion galaxy_ng/tests/integration/cli/test_community_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading