Skip to content

ansible-galaxy collection search#77064

Draft
bcoca wants to merge 3 commits into
ansible:develfrom
bcoca:collsearch
Draft

ansible-galaxy collection search#77064
bcoca wants to merge 3 commits into
ansible:develfrom
bcoca:collsearch

Conversation

@bcoca
Copy link
Copy Markdown
Member

@bcoca bcoca commented Feb 18, 2022

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ansible-galaxy

@ansibot ansibot added affects_2.13 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 18, 2022
@bcoca bcoca changed the title Collsearch ansible-galaxy collection search Feb 21, 2022
Copy link
Copy Markdown
Contributor

@s-hertel s-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice addition!

Comment thread lib/ansible/cli/galaxy.py
self.add_install_options(collection_parser, parents=[common, force, cache_options])
self.add_list_options(collection_parser, parents=[common, collections_path])
self.add_verify_options(collection_parser, parents=[common, collections_path])
self.add_search_options(collection_parser, parents=[common])
Copy link
Copy Markdown
Contributor

@s-hertel s-hertel Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the options show up with ansible-galaxy collection search --help right now but filtering by author (github username)/platform doesn't work for collections I think. add_search_options could add a --namespace option + not add --author/--platform for collections.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to find the name of the parameters that work before i can add them, right now i just found one that works , mostly by accident

Comment thread lib/ansible/cli/galaxy.py
Comment thread lib/ansible/galaxy/api.py
# https://galaxy.ansible.com/search?keywords=<term>&order_by=-relevance&deprecated=false&type=collection&page=1
# api_path = self.available_api_versions.get('v3', self.available_api_versions.get('v2'))
# url_paths = [self.api_server, api_path, 'collections', '/?search=%s' % term]
url_paths = ['https://galaxy.ansible.com', 'api', 'internal', 'ui', 'search', '/?type=collection&deprecated=false&keywords=%s' % term]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use self.api_server instead:

Suggested change
url_paths = ['https://galaxy.ansible.com', 'api', 'internal', 'ui', 'search', '/?type=collection&deprecated=false&keywords=%s' % term]
url_paths = [self.api_server, 'internal', 'ui', 'search', '/?type=collection&deprecated=false&keywords=%s' % term]

Unless it's hardcoded because it doesn't work with v3?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nor v2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't v2 community galaxy collections? v1 is roles

But noticed the conversation about internal/ui not being a supported, so it doesn't really matter.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for roles we still use the v1, i tried equivalent v2 and v3 but could not find, will resolve with help of galaxy team

@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Feb 22, 2022
@bcoca bcoca changed the title ansible-galaxy collection search [wip] ansible-galaxy collection search Feb 23, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 3, 2022
@bcoca bcoca changed the title [wip] ansible-galaxy collection search ansible-galaxy collection search Jul 15, 2022
@bcoca bcoca marked this pull request as draft July 15, 2022 21:59
@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Jul 15, 2022
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Aug 24, 2022
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Sep 30, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 8, 2022
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Nov 1, 2022
@ansibot ansibot removed the has_issue label Jul 12, 2023
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Oct 24, 2023
@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Jan 28, 2025
@ansibot ansibot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Mar 19, 2025
@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_pr This PR has not been pushed to for more than one year. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Mar 19, 2025
@ansibot
Copy link
Copy Markdown
Contributor

ansibot commented Mar 19, 2025

The test ansible-test sanity --test pylint [explain] failed with 3 errors:

lib/ansible/cli/galaxy.py:1754:11: undefined-variable: Undefined variable 'count'
lib/ansible/cli/galaxy.py:1755:82: undefined-variable: Undefined variable 'count'
lib/ansible/cli/galaxy.py:1757:64: undefined-variable: Undefined variable 'count'

click here for bot help

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 2, 2025
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 9, 2025
@ansibot
Copy link
Copy Markdown
Contributor

ansibot commented Jul 9, 2025

The test ansible-test sanity --test pylint [explain] failed with 3 errors:

lib/ansible/cli/galaxy.py:1756:11: undefined-variable: Undefined variable 'count'
lib/ansible/cli/galaxy.py:1757:82: undefined-variable: Undefined variable 'count'
lib/ansible/cli/galaxy.py:1759:64: undefined-variable: Undefined variable 'count'

click here for bot help

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 23, 2025
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 14, 2026
@ansibot
Copy link
Copy Markdown
Contributor

ansibot commented Mar 14, 2026

The test ansible-test sanity --test pylint [explain] failed with 3 errors:

lib/ansible/cli/galaxy.py:1758:11: undefined-variable: Undefined variable 'count'
lib/ansible/cli/galaxy.py:1759:82: undefined-variable: Undefined variable 'count'
lib/ansible/cli/galaxy.py:1761:64: undefined-variable: Undefined variable 'count'

click here for bot help

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects_2.13 ci_verified Changes made in this PR are causing tests to fail. feature This issue/PR relates to a feature request. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team. WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants