fix: Add missing comma when generating relations#78
Merged
erezrokah merged 2 commits intocloudquery:mainfrom Sep 11, 2022
Merged
fix: Add missing comma when generating relations#78erezrokah merged 2 commits intocloudquery:mainfrom
erezrokah merged 2 commits intocloudquery:mainfrom
Conversation
yevgenypats
approved these changes
Sep 11, 2022
Contributor
yevgenypats
left a comment
There was a problem hiding this comment.
I like the new snapshot idea!
kodiakhq bot
pushed a commit
that referenced
this pull request
Sep 11, 2022
🤖 I have created a release *beep* *boop* --- ## [0.2.7](v0.2.6...v0.2.7) (2022-09-11) ### Bug Fixes * Add missing comma when generating relations ([#78](#78)) ([41172d4](41172d4)) --- 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
The
TableDefinition.Relationsaccepts a string array but it's a bit confusing to use when you have multiple relations as it doesn't add a comma between relations.As a result if someone has multiple relations they need to work around the issue by doing either:
relations: []string{"siteAuthSettings(),publishingProfiles(),vnetConnections(),publishingProfiles()"}(a single string) (code)or
relations: []string{"siteAuthSettings(),", "publishingProfiles(),"}This PR fixes the issue (this makes the code consistent with how we template columns).
Another solution is to make relations a string type (instead of an array) to make it clear that it's printed as is.
For clarity the first commit of this PR adds a test to generate a table template and the second has the fix with the change in the snapshot c9d9db2
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)