feat: Add destination when generating sources#1847
feat: Add destination when generating sources#1847erezrokah wants to merge 2 commits intocloudquery:mainfrom
Conversation
There was a problem hiding this comment.
I think this looks good! but I think we have to be cautions with gen turning into a product of itself which generates configs for various use-cases and so on so really important to keep it simple as I would even go far that gen is even not mandatory on it's own as it's quite common in most cases for users to create configs from documentation rather from commands that auto generate configs.
Because for example how do we know the user wants to sync the source with all destinations? so either he will have to add a destination or to delete a destination (not sure which is better I think to explicitly add might be better and the more secure way)
💯 This is a feature on its own. I'm trying to prevent the back and forth between CLI commands and manually editing files. |
Yes I think this feature might change when we have more destinations (for example we can let the user chose from a list) |
|
Also waiting on cloudquery/plugin-sdk#120 to merge this |
I wouldn't go into the rabbit hole of adding more features like choosing from a list but rather just output the config and make this feature end at this. Im even at the opinion that the |
yevgenypats
left a comment
There was a problem hiding this comment.
Actually second thought here - Let's keep the gen command write only without reading the current directly I think it is really important to keep bugs at bay and things like oh it read a different directory and so on. I think the current gen command is way more advanced to the current status of the tool anyway.
|
Got it, I'll close the PR so we can think this through |
Summary
Requires cloudquery/plugin-sdk#120
Somehow fixes #1808.
When generating sources, if there's a destination generated already, add it to the source configuration.
Then I think our docs should first instruct users to generate the destination, then the sources.
Use the following steps to ensure your PR is ready to be reviewed
go fmtto format your code 🖊golangci-lint run🚨 (install golangci-lint here)