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

Add support to install collections from git repositories #69154

Merged
merged 19 commits into from May 29, 2020

Conversation

s-hertel
Copy link
Contributor

@s-hertel s-hertel commented Apr 24, 2020

SUMMARY

Fixes #61680

This adds support for installing collections from git repositories. Use the format git+URI,version (or git@URI,version to use ssh authentication) instead of a collection name. The version is optional and should be a git tree-ish instead of a collection artifact version. The version defaults to HEAD.

A repo can contain multiple or an individual collection. You can append #/path/to/collection/ to the URI to install collections from a particular directory in the repository.

This also adds a new type option for collection requirements files (which may be one of 'galaxy', 'file', 'url', or 'git' to override implicitly determining the type from the name field).

collections:
  - name: git@github.com:my_org/private_collections.git#/path/to/collection,devel
  - name: https://github.com/ansible-collections/amazon.aws.git
    type: git
    version: 8102847014fd6e7a3233df9ea998ef4677b99248
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ansible-galaxy

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.10 This issue/PR affects Ansible v2.10 docs This issue/PR relates to or includes documentation. docsite This issue/PR relates to the documentation website. feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 24, 2020
@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Apr 24, 2020
@ansibot

This comment has been minimized.

@s-hertel s-hertel changed the title [WIP] Add support to install collections from git repositories Add support to install collections from git repositories May 6, 2020
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. labels May 6, 2020
@jctanner jctanner requested a review from jborean93 May 11, 2020 18:49
@s-hertel
Copy link
Contributor Author

cc @geerlingguy (since I can't request your review)

@mattclay mattclay added this to In Progress: Dev places card in this column when they are *ACTIVELY* working on it. Use WIP on PRs that are not yet complete in ansible-base 2.10 May 11, 2020
Copy link
Contributor

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

Looks good, just a few docs questions and some behaviour around subdir checks

lib/ansible/galaxy/collection.py Outdated Show resolved Hide resolved
lib/ansible/galaxy/collection.py Outdated Show resolved Hide resolved
lib/ansible/utils/galaxy.py Show resolved Hide resolved
lib/ansible/galaxy/collection.py Outdated Show resolved Hide resolved
lib/ansible/galaxy/collection.py Outdated Show resolved Hide resolved
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 11, 2020
@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label May 13, 2020
@s-hertel s-hertel moved this from In Progress: Dev places card in this column when they are *ACTIVELY* working on it. Use WIP on PRs that are not yet complete to Needs Review: Code seems done but needs someone else to review it in ansible-base 2.10 May 14, 2020
@s-hertel s-hertel requested a review from jborean93 May 14, 2020 15:37
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed ci_verified Changes made in this PR are causing tests to fail. labels May 14, 2020
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 27, 2020
Comment on lines +22 to +23
- "'namespace_1.collection_1' in installed_collections.stdout"
- "'namespace_2.collection_2' in installed_collections.stdout"
Copy link
Member

Choose a reason for hiding this comment

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

Pro tip: you can often get rid of escaping when using YAML blocks:

Suggested change
- "'namespace_1.collection_1' in installed_collections.stdout"
- "'namespace_2.collection_2' in installed_collections.stdout"
- >-
'namespace_1.collection_1' in installed_collections.stdout
- >-
'namespace_2.collection_2' in installed_collections.stdout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I like the escaping better than the extra lines though in this case.

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels May 27, 2020
@ansibot

This comment has been minimized.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 27, 2020
@webknjaz
Copy link
Member

That linter error should probably be suppressed because this module runs on the controller AFAIU

@ansibot ansibot added the test This PR relates to tests. label May 28, 2020
@s-hertel s-hertel merged commit e40889e into ansible:devel May 29, 2020
ansible-base 2.10 automation moved this from Needs Review: Code seems done but needs someone else to review it to Done: Only PM, RM, or Eng Manager use this colum. Means Tests, documentation, everything is done. May 29, 2020
@ansible ansible locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 docs This issue/PR relates to or includes documentation. docsite This issue/PR relates to the documentation website. feature This issue/PR relates to a feature request. has_issue needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
No open projects
ansible-base 2.10
  
Done: Only PM, RM, or Eng Manager use...
Development

Successfully merging this pull request may close these issues.

Support specifying collections in git repositories in requirements.yml
10 participants