feat: Auto-fill config when calling generate sub-command (v2)#1698
Closed
hermanschaaf wants to merge 46 commits intocloudquery:feat/cloudquery-cli-v2from
Closed
feat: Auto-fill config when calling generate sub-command (v2)#1698hermanschaaf wants to merge 46 commits intocloudquery:feat/cloudquery-cli-v2from
hermanschaaf wants to merge 46 commits intocloudquery:feat/cloudquery-cli-v2from
Conversation
goes together with cloudquery/plugin-sdk#4 This is V2 of CloudQuery CLI together with the new https://github.com/cloudquery/plugin-sdk - Support for multiple databases. plugins are sending info back to CLI - seperate CLI configuration from plugins configuration. - Moved to plain gRPC (no more go-plugin) - zerolog everwhere - no custom UI implementations - no bloated/unneeded abstraction layers Issues that should be fixed: cloudquery#1104 cloudquery#1055 cloudquery#983 cloudquery#859 cloudquery#858 cloudquery#888 cloudquery#857 cloudquery#854 cloudquery#904 cloudquery#751 cloudquery#539 cloudquery#392 cloudquery#292 cloudquery#159 cloudquery#908 cloudquery#840
…uery into feat/cloudquery-cli-v2
* feat: Write to config file instead of stdout * Update SDK to v0.0.10 and remove unique constraints * Add more assertions to generate test * Write to stdout * clarify if statement
test: Add more tests to cli
yevgenypats
suggested changes
Sep 1, 2022
Contributor
There was a problem hiding this comment.
The logic and templating looks perfect but I think this should go in the sdk level - https://github.com/cloudquery/plugin-sdk/blob/main/plugins/source.go#L107
as the example is tied to a specific sdk anyway so in the CLI you can just call exampleConfig and that's it and also we will be able to use it in other places if needed in the future.
Contributor
Author
|
@yevgenypats Makes sense, I will move it to the SDK 👍 |
Contributor
Author
|
@yevgenypats Should we perhaps merge this in (after I've rebased and fixed conflicts) to get the functionality? We can later move functionality to the SDK later as an internal (non-user facing) change, once that becomes possible/easier to do |
56f2203 to
7f3548d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When calling
cloudquery generate sourceorcloudquery generate destination, we now use information from the plugin to pre-populate the config with good defaults. This also adds comments and commented out lines to show what changes can be made after the initial generate call.One more thing that changes is that plugins are now expected only to provide the contents of their own
specwhen returning an example. The rest of the config generation is handled by the CLI.