feat(cli): Print and log sources and destinations versions#6842
Merged
kodiakhq[bot] merged 5 commits intocloudquery:mainfrom Jan 17, 2023
Merged
Conversation
5 tasks
erezrokah
commented
Jan 16, 2023
| func syncConnectionV2(ctx context.Context, cqDir string, sourceClient *clients.SourceClient, sourceSpec specs.Source, destinationsSpecs []specs.Destination, uid string, noMigrate bool) error { | ||
| var err error | ||
| destinationNames := make([]string, len(destinationsSpecs)) | ||
| destinationStrings := make([]string, len(destinationsSpecs)) |
Member
Author
There was a problem hiding this comment.
zerolog supports Stringers and Stringer, however Stringers is not very useful as we need to create that array manually (we can't cast to an array directly)
Contributor
|
@erezrokah There were a couple of CI errors reported here, FYI |
Member
Author
👍 Those should be fixed after cloudquery/plugin-sdk#609 as we need the |
kodiakhq bot
pushed a commit
to cloudquery/plugin-sdk
that referenced
this pull request
Jan 17, 2023
A user recently ran into some issues since they thought they used a newer version of a plugin, but actually used an old one. This PR adds `String()` methods to specs so we can use them in logs/errors. CLI PR cloudquery/cloudquery#6842 ---
6904918 to
0b1d866
Compare
erezrokah
commented
Jan 17, 2023
cli/cmd/sync2.go
Outdated
| if !noMigrate { | ||
| fmt.Println("Starting migration for:", sourceSpec.Name, "->", sourceSpec.Destinations) | ||
| log.Info().Str("source", sourceSpec.Name).Strs("destinations", sourceSpec.Destinations).Msg("Start migration") | ||
| fmt.Printf("Starting migration for:%s->%s\n", sourceSpec.VersionString(), destinationStrings) |
Member
Author
There was a problem hiding this comment.
Printf is less error prone as our linter errors if you use %s and don't pass a string
Member
Author
|
@hermanschaaf this should be ready for another review after using the new SDK |
hermanschaaf
approved these changes
Jan 17, 2023
Contributor
hermanschaaf
left a comment
There was a problem hiding this comment.
Looks good, let's just fix the spacing in that one message before merging :)
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
kodiakhq bot
pushed a commit
that referenced
this pull request
Jan 17, 2023
🤖 I have created a release *beep* *boop* --- ## [2.2.0](cli-v2.1.1...cli-v2.2.0) (2023-01-17) ### Features * **cli:** Print and log sources and destinations versions ([#6842](#6842)) ([b32363b](b32363b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Summary
To go with cloudquery/plugin-sdk#609.


Examples