Skip to content

feat: Auto-fill config when calling generate sub-command (v2)#1698

Closed
hermanschaaf wants to merge 46 commits intocloudquery:feat/cloudquery-cli-v2from
hermanschaaf:generate-examples
Closed

feat: Auto-fill config when calling generate sub-command (v2)#1698
hermanschaaf wants to merge 46 commits intocloudquery:feat/cloudquery-cli-v2from
hermanschaaf:generate-examples

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

When calling cloudquery generate source or cloudquery 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 spec when returning an example. The rest of the config generation is handled by the CLI.

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
@hermanschaaf hermanschaaf requested a review from a team September 1, 2022 15:12
Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

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

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.

@hermanschaaf
Copy link
Copy Markdown
Contributor Author

@yevgenypats Makes sense, I will move it to the SDK 👍

@hermanschaaf
Copy link
Copy Markdown
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

@yevgenypats yevgenypats force-pushed the feat/cloudquery-cli-v2 branch from 56f2203 to 7f3548d Compare September 6, 2022 09:33
@yevgenypats yevgenypats deleted the branch cloudquery:feat/cloudquery-cli-v2 September 6, 2022 09:44
@yevgenypats yevgenypats closed this Sep 6, 2022
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.

2 participants