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

ansible-galaxy collection search #77064

Draft
wants to merge 3 commits into
base: devel
Choose a base branch
from
Draft

Conversation

bcoca
Copy link
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
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!

@@ -238,6 +238,7 @@ def init_parser(self):
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
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
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

lib/ansible/cli/galaxy.py Show resolved Hide resolved
# 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
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
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
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.13 feature This issue/PR relates to a feature request. 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. 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