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

Feature - CLI Refactor #482

Merged
merged 6 commits into from Apr 26, 2019

Conversation

adorton-adobe
Copy link
Collaborator

Refactor CLI option handling to use Click. This introduces subcommands - optional pieces of additional functionality to make the Sync Tool more useful as a standalone application.

Specifically, this update implements the following subcommands:

  • sync - Run user sync (default)
  • example-config - Generate example config files for main config, UMAPI connector and LDAP connector (will prompt for filenames if filename options are not specified - defaults are the usual filenames)
  • docs - Open the User Manual with the system's default URL handler (generally the default browser)

These are invoked in this manner -

$ user-sync [command] [options]

e.g.

$ user-sync example-config --root user-sync-config.yml --umapi connector-umapi-yml --ldap connector-ldap.yml

sync is the default command, so if no command is specified, the tool will still run user sync. This is necessary for maintaining backwards compatibility.

This update depends on the resource manager (see #481). I've merged changes from feature/resource-manager to the click branch.

Build Updates

  • Introduce .build/pre_build.py for bundling dynamic resources to the resources package. The example configs are bundled here because they should not be committed to source control (since they are already committed in the top-level examples directory)
  • update setup.py to find resources package and ensure that resources are included in the pex file (via the package_data parameter to setup())
  • update Makefile to run pre_build.py before building the pex file

Additional Notes

  • ConfigLoader.load_invocation_options() was cleaned up. It now applies CLI option overrides in a single pass, eliminating the need to resolve each override individually for each CLI option. This changes the way that certain conflicting options are resolved - in a couple of cases, it will decide which option to override and continue processing options, where previously it would throw an exception. It will log messages in these cases.

@adorton-adobe adorton-adobe added this to the v2.5.0 milestone Apr 23, 2019
@adorton-adobe adorton-adobe merged commit af91922 into adobe-apiplatform:v2 Apr 26, 2019
@adorton-adobe adorton-adobe self-assigned this May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants