From 6ac2fcd13c82f5f82bdea61f693fbdde90cd719d Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Wed, 2 Apr 2025 10:37:14 +0100 Subject: [PATCH 1/3] fix(deps): Update module github.com/cloudquery/plugin-sdk/v4 to v4.76.0 (#321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/cloudquery/plugin-sdk/v4](https://redirect.github.com/cloudquery/plugin-sdk) | require | minor | `v4.75.0` -> `v4.76.0` | --- ### Release Notes
cloudquery/plugin-sdk (github.com/cloudquery/plugin-sdk/v4) ### [`v4.76.0`](https://redirect.github.com/cloudquery/plugin-sdk/releases/tag/v4.76.0) [Compare Source](https://redirect.github.com/cloudquery/plugin-sdk/compare/v4.75.0...v4.76.0) ##### Features - Pass installation ID from env to usage report ([#​2106](https://redirect.github.com/cloudquery/plugin-sdk/issues/2106)) ([0bea6e7](https://redirect.github.com/cloudquery/plugin-sdk/commit/0bea6e792c2024231e6cf20804e0e493cf63f012)) ##### Bug Fixes - **deps:** Update golang.org/x/exp digest to [`054e65f`](https://redirect.github.com/cloudquery/plugin-sdk/commit/054e65f) ([#​2110](https://redirect.github.com/cloudquery/plugin-sdk/issues/2110)) ([f9875f8](https://redirect.github.com/cloudquery/plugin-sdk/commit/f9875f8706268a9c0a3d3d95eb73da9d6d258f9f)) - **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.26.9 ([#​2112](https://redirect.github.com/cloudquery/plugin-sdk/issues/2112)) ([abd2117](https://redirect.github.com/cloudquery/plugin-sdk/commit/abd2117c47837393fb06eecf270bf4d25ce511a7)) - Error if both PKs and PK components are set ([#​2113](https://redirect.github.com/cloudquery/plugin-sdk/issues/2113)) ([4f0b312](https://redirect.github.com/cloudquery/plugin-sdk/commit/4f0b3129391339df8b53358433ad17555149399e))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index fccdae7..28ccf14 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armmanagedapplications v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/solutions/armmanagedapplications/v2 v2.1.0 github.com/bradleyjkemp/cupaloy/v2 v2.8.0 - github.com/cloudquery/plugin-sdk/v4 v4.75.0 + github.com/cloudquery/plugin-sdk/v4 v4.76.0 github.com/google/go-cmp v0.7.0 github.com/invopop/jsonschema v0.13.0 github.com/jpillora/longestcommon v0.0.0-20161227235612-adb9d91ee629 @@ -25,7 +25,7 @@ require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect - github.com/cloudquery/cloudquery-api-go v1.13.7 // indirect + github.com/cloudquery/cloudquery-api-go v1.13.8 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/goccy/go-json v0.10.5 // indirect github.com/google/flatbuffers v25.2.10+incompatible // indirect diff --git a/go.sum b/go.sum index 815c18c..2c559b9 100644 --- a/go.sum +++ b/go.sum @@ -32,12 +32,12 @@ github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oM github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/cloudquery/cloudquery-api-go v1.13.7 h1:XWn9TVLpKswTrNQT9MY/HUiQWwhyoMWKpGWoRcQM5bE= -github.com/cloudquery/cloudquery-api-go v1.13.7/go.mod h1:ZhEjPkDGDL2KZKlQLUnsgQ0mPz3qC7qftr37q3q+IcA= +github.com/cloudquery/cloudquery-api-go v1.13.8 h1:8n5D0G2wynbUdexr1GS8ND8i0uOwm0gXKNipJsijPe0= +github.com/cloudquery/cloudquery-api-go v1.13.8/go.mod h1:ZhEjPkDGDL2KZKlQLUnsgQ0mPz3qC7qftr37q3q+IcA= github.com/cloudquery/jsonschema v0.0.0-20240220124159-92878faa2a66 h1:OZLPSIBYEfvkAUeOeM8CwTgVQy5zhayI99ishCrsFV0= github.com/cloudquery/jsonschema v0.0.0-20240220124159-92878faa2a66/go.mod h1:0SoZ/U7yJlNOR+fWsBSeTvTbGXB6DK01tzJ7m2Xfg34= -github.com/cloudquery/plugin-sdk/v4 v4.75.0 h1:N/edo8VA+YzfjIC+bQ3y7AAUHQEYzF6y+ZFYLyHKFMI= -github.com/cloudquery/plugin-sdk/v4 v4.75.0/go.mod h1:dDLB0XrS3R+nIWh4X8J8/ZQcsJ+lmjxUxoBxhAq8iCA= +github.com/cloudquery/plugin-sdk/v4 v4.76.0 h1:4IdRzDSDfdy5zeU0ajJeMWgjFkuoopsGbXiOTfT6U/U= +github.com/cloudquery/plugin-sdk/v4 v4.76.0/go.mod h1:gmveeddqfFvMvBkgift+ctK4AiVIqsa0nWP/btMqSeY= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From eb90cda66638d3115a2435abb24cc6a54bb08fd9 Mon Sep 17 00:00:00 2001 From: Ben Bernays Date: Wed, 2 Apr 2025 09:23:31 -0500 Subject: [PATCH 2/3] fix: Make generating docs non destructive (#323) #### Summary Before this change, after the first time a description was written to the string it would be deleted. Because all of the `schema` objects are passed by reference, this means that it would be permanently deleted if the initial object is passed in as a struct and not marshaled/unmarshaled. This PR removes that specific destructive aspect and instead overwrites the `Comments` attribute which we do not use. This change doesn't impact any existing code as all instances still use the `Generate` rather than the `GenerateFromSchema` --- jsonschema/docs/docs.go | 6 ++++-- jsonschema/docs/docs_test.go | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jsonschema/docs/docs.go b/jsonschema/docs/docs.go index a93b351..160cf73 100644 --- a/jsonschema/docs/docs.go +++ b/jsonschema/docs/docs.go @@ -17,6 +17,8 @@ func generateDoc(root jsonschema.Schema, headerLevel int) (string, error) { return toc + "\n\n" + buff.String(), err } +// GenerateFromSchema generates a markdown documentation from a jsonschema.Schema. During the writing process the `Comment` attribute can be overwritten +// To avoid this use the `Generate` function which will not modify the original schema func GenerateFromSchema(schema jsonschema.Schema, headerLevel int) (string, error) { return generateDoc(schema, headerLevel) } @@ -131,7 +133,7 @@ func writeProperty(property *jsonschema.Schema, required bool, buff *strings.Bui } func writeDescription(sc *jsonschema.Schema, buff *strings.Builder) { - if len(sc.Description) == 0 { + if len(sc.Description) == 0 || sc.Comments == "skip_description" { return } @@ -139,7 +141,7 @@ func writeDescription(sc *jsonschema.Schema, buff *strings.Builder) { buff.WriteString(strings.ReplaceAll(sc.Description, "\n", "\n ")) buff.WriteString("\n") - sc.Description = "" // already used + sc.Comments = "skip_description" } func writeValueAnnotations(sc *jsonschema.Schema, buff *strings.Builder) { diff --git a/jsonschema/docs/docs_test.go b/jsonschema/docs/docs_test.go index 17f8c46..648c136 100644 --- a/jsonschema/docs/docs_test.go +++ b/jsonschema/docs/docs_test.go @@ -58,18 +58,18 @@ func TestGCP(t *testing.T) { func TestClickHouse(t *testing.T) { genSnapshot(t, "testdata/clickhouse.json") - genSnapshot(t, "testdata/clickhouse.json") + genSnapshotStruct(t, "testdata/clickhouse.json") } func TestFiletypes(t *testing.T) { genSnapshot(t, "testdata/filetypes.json") - genSnapshot(t, "testdata/filetypes.json") + genSnapshotStruct(t, "testdata/filetypes.json") } func TestFileDestination(t *testing.T) { genSnapshot(t, "testdata/file-destination.json") - genSnapshot(t, "testdata/file-destination.json") + genSnapshotStruct(t, "testdata/file-destination.json") } From 57280fa71de68b009271c1d054f2fb660bfa44fe Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:30:22 +0100 Subject: [PATCH 3/3] chore(main): Release v0.3.25 (#322) :robot: I have created a release *beep* *boop* --- ## [0.3.25](https://github.com/cloudquery/codegen/compare/v0.3.24...v0.3.25) (2025-04-02) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.76.0 ([#321](https://github.com/cloudquery/codegen/issues/321)) ([6ac2fcd](https://github.com/cloudquery/codegen/commit/6ac2fcd13c82f5f82bdea61f693fbdde90cd719d)) * Make generating docs non destructive ([#323](https://github.com/cloudquery/codegen/issues/323)) ([eb90cda](https://github.com/cloudquery/codegen/commit/eb90cda66638d3115a2435abb24cc6a54bb08fd9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f78ac73..806a80f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.24" + ".": "0.3.25" } diff --git a/CHANGELOG.md b/CHANGELOG.md index f4b9928..e3b7d84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.3.25](https://github.com/cloudquery/codegen/compare/v0.3.24...v0.3.25) (2025-04-02) + + +### Bug Fixes + +* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.76.0 ([#321](https://github.com/cloudquery/codegen/issues/321)) ([6ac2fcd](https://github.com/cloudquery/codegen/commit/6ac2fcd13c82f5f82bdea61f693fbdde90cd719d)) +* Make generating docs non destructive ([#323](https://github.com/cloudquery/codegen/issues/323)) ([eb90cda](https://github.com/cloudquery/codegen/commit/eb90cda66638d3115a2435abb24cc6a54bb08fd9)) + ## [0.3.24](https://github.com/cloudquery/codegen/compare/v0.3.23...v0.3.24) (2025-04-01)