This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
[WIP] refactoring of install action for '--requirements' and 'download' #270
Open
alikins
wants to merge
17
commits into
ansible:devel
Choose a base branch
from
alikins:install_update_fetch_tests
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get the list of Reqs in the cli, and pass into install_repository_specs_loops() 'editable' and 'namespace_override' are only needed for creating the Requirement() objects, so dont pass into loop
install_repositories_matching_repository_specs() was no inaccurate as well as still being too long, so change it.
ie, one InstalledRepositoryDatabase() instead of a new instance in each helper method. The IRDB class is stateless, but using the same ref makes unit testing easier. Update unit tests for better coverage of action.install
kinda sorta emulate a dep solving iteration
Move requirements_from_strings() from ansible_galaxy.actions.install to ansible_galaxy.requirements with from_requirements_dict Reorder the methods in ansible_galaxy.actions.install based on order of execution instead of the other style which we'll call... aleatoric? Add test_requirements unit tests
There is no longer the separate concept of 'dependencies' (install time) and 'requirements' (run time... and install time). There are only 'dependencies' now. Which we call 'requirements' almost everywhere inside the code because reasons. But for the moment, at least consistently call them by the wrong name everywhere, so they can all be changed at the same time.
The ansible_galaxy_cli code now calls ansible_galaxy.actions.install.run() instead of install_whatever_loop() as before. Plan is to move other actions to similar api. A run() that more or less takes the cli args (strings). And a suitably named method in the action module that shows a more pythonic signature. For example, here run() takes a list of strings for requirement_spec_strings, while install_requirements_loop() takes a list of Requirement() objects. Also, run() returns only a return code suitable for sys.exit(), while the more pythonic method will return a results dict with a 'status' and an 'errors' list.
b385388
to
fda5f7e
Compare
Out of ansible_galaxy.install and into repository_spec so it is easier to share.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
This is mostly refactoring and fixes and better testing to install action and related
modules in preparation for 'download' subcommand and ''--requirements" file support
ISSUE TYPE
MAZER VERSION
ADDITIONAL INFORMATION