Skip to content

Commit 70ff2dc

Browse files
fix!: Rename domains c_name to cname (#2635)
#### Summary Related to #2189. 1. Added codegen drift detection 2. Moved generated resources under `../resources/services` for consistency with other plugins (there's a follow up here to put each namespace in a separate directory, but didn't want to do too many changes) 3. Moved `plugin/plugin.go` to `resources/plugin/plugin.go`. This is required so Go Releaser embeds the correct version of the plugin during release, see https://github.com/cloudquery/cloudquery/blob/6ab042925afaf7fe0a7fccbedd17f0915d40f7cf/plugins/.goreleaser.yaml#L12 Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent d194943 commit 70ff2dc

File tree

118 files changed

+199
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+199
-191
lines changed

.github/workflows/source_heroku.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ jobs:
4040
run: make gen-docs
4141
- name: Fail if docs are changed
4242
run: test "$(git status -s ./docs/tables | wc -l)" -eq 0
43+
- name: gen-code
44+
run: make gen-code
45+
- name: Fail if code generation changed services
46+
run: test "$(git status -s ./resources/services | wc -l)" -eq 0

plugins/source/heroku/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ gen-docs:
2727
.PHONY: lint
2828
lint:
2929
golangci-lint run
30+
31+
.PHONY: gen-code
32+
gen-code:
33+
go run codegen/main.go
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"runtime"
1212
"text/template"
1313

14-
"github.com/cloudquery/cloudquery/plugins/source/heroku/codegenmain/recipes"
14+
"github.com/cloudquery/cloudquery/plugins/source/heroku/codegen/recipes"
1515
sdkgen "github.com/cloudquery/plugin-sdk/codegen"
1616
"github.com/iancoleman/strcase"
1717
"github.com/jinzhu/inflection"
@@ -36,7 +36,7 @@ func clearServicesDirectory() {
3636
log.Fatal("Failed to get caller information")
3737
}
3838
dir := path.Dir(filename)
39-
filePath := path.Join(dir, "../codegen")
39+
filePath := path.Join(dir, "../resources/services")
4040
err := clearDirectory(filePath)
4141
if err != nil {
4242
log.Fatal(fmt.Errorf("failed to clear services directory: %w", err))
@@ -104,7 +104,7 @@ func generateResource(r recipes.Resource, mock bool) {
104104
if err := tpl.Execute(&buff, r); err != nil {
105105
log.Fatal(fmt.Errorf("failed to execute template: %w", err))
106106
}
107-
filePath := path.Join(dir, "../codegen")
107+
filePath := path.Join(dir, "../resources/services")
108108
fileName := strcase.ToSnake(r.HerokuStructName)
109109
if mock {
110110
filePath = path.Join(filePath, fileName+"_mock_test.go")
File renamed without changes.

plugins/source/heroku/codegenmain/templates/relational_resource_list.go.tpl renamed to plugins/source/heroku/codegen/templates/relational_resource_list.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Code generated by codegen; DO NOT EDIT.
22

3-
package codegen
3+
package services
44

55
import (
66
"context"

plugins/source/heroku/codegenmain/templates/relational_resource_list_mock_test.go.tpl renamed to plugins/source/heroku/codegen/templates/relational_resource_list_mock_test.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Code generated by codegen; DO NOT EDIT.
22

3-
package codegen
3+
package services
44

55
import (
66
"encoding/json"

plugins/source/heroku/codegenmain/templates/resource_list.go.tpl renamed to plugins/source/heroku/codegen/templates/resource_list.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Code generated by codegen; DO NOT EDIT.
22

3-
package codegen
3+
package services
44

55
import (
66
"context"

plugins/source/heroku/codegenmain/templates/resource_list_mock_test.go.tpl renamed to plugins/source/heroku/codegen/templates/resource_list_mock_test.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Code generated by codegen; DO NOT EDIT.
22

3-
package codegen
3+
package services
44

55
import (
66
"encoding/json"

plugins/source/heroku/docs/tables/heroku_domains.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The primary key for this table is **id**.
1515
|acm_status|String|
1616
|acm_status_reason|String|
1717
|app|JSON|
18-
|c_name|String|
18+
|cname|String|
1919
|created_at|Timestamp|
2020
|hostname|String|
2121
|id (PK)|String|

plugins/source/heroku/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"github.com/cloudquery/cloudquery/plugins/source/heroku/plugin"
4+
"github.com/cloudquery/cloudquery/plugins/source/heroku/resources/plugin"
55
"github.com/cloudquery/plugin-sdk/serve"
66
)
77

0 commit comments

Comments
 (0)