Factor out CLI code into new module, add "build" command #197
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.
This PR came out of the FilmDrop sprint in which I was given time to work on improvements to the STAC workflow developer experience. I was interested in something that would give more visibility into the content of a Task beyond what can be viewed in a Terraform definition, and an idea that came out of that is a FilmDrop task registry. The
metadatacommand that gets added here is in service of that.The other change is a refactoring of the CLI functionality to live in its own module and not necessarily be tied to a single task. This lets the
runcommand execute one of many tasks registered to aCLIinstance, which is helpful when packaging multiple tasks in a single Docker image.A note on a breaking change that this PR introduces: with the
runcommand now able to execute multiple tasks, a mandatory--taskargument has been added. This means that existing invocations of this command will now fail. I had thought about a solution that would allow omitting the--taskargument if only one task is registered to a CLI instance, but wasn't totally sold on that approach. Any discussion is welcome.Related Issue(s):
None
Proposed Changes:
Taskclass into its own module.runcommand to run one of multiple tasks, as opposed to just one.metadatacommand to output metadata of all tasks registered withCLIinstance.PR Checklist: