Skip to content

Commit b9bd46d

Browse files
authored
Merge pull request #6229 from grafana/rename/ext-telemetry-kind-to-type
Extension telemetry: Rename extension kind to type
1 parent 1db22ef commit b9bd46d

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

internal/cmd/report.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ import (
1717
)
1818

1919
// extensionEntry identifies a used extension in the usage report by its Go
20-
// module path, along with its version and kind.
20+
// module path, along with its version and type.
2121
type extensionEntry struct {
2222
Module string `json:"module"`
2323
Version string `json:"version"`
24-
Kind string `json:"kind"`
24+
Type string `json:"type"`
2525
}
2626

2727
// newExtensionEntry builds the usage-report entry for a registered extension.
2828
func newExtensionEntry(e *ext.Extension) extensionEntry {
2929
return extensionEntry{
3030
Module: e.Path,
3131
Version: e.Version,
32-
Kind: e.Type.String(),
32+
Type: e.Type.String(),
3333
}
3434
}
3535

@@ -109,7 +109,7 @@ func resolveExtensions(m map[string]any, catalog func() map[string]struct{}) {
109109

110110
// filterExtensions turns the recorded used extensions into report entries,
111111
// keeping only those whose module path is advertised in the public catalog and
112-
// de-duplicating per (module, kind).
112+
// de-duplicating per (module, type).
113113
func filterExtensions(used []any, public map[string]struct{}) []extensionEntry {
114114
seen := make(map[[2]string]struct{}, len(used))
115115
entries := make([]extensionEntry, 0, len(used))

internal/cmd/tests/cmd_run_report_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestRunReportsExtensions(t *testing.T) {
112112
{
113113
"module": testImportModule,
114114
"version": ext.Get(ext.JSExtension)["k6/x/testimport"].Version,
115-
"kind": "js",
115+
"type": "js",
116116
},
117117
},
118118
},
@@ -125,7 +125,7 @@ func TestRunReportsExtensions(t *testing.T) {
125125
{
126126
"module": testImportModule,
127127
"version": ext.Get(ext.JSExtension)["k6/x/testimport"].Version,
128-
"kind": "js",
128+
"type": "js",
129129
},
130130
},
131131
},
@@ -137,12 +137,12 @@ func TestRunReportsExtensions(t *testing.T) {
137137
{
138138
"module": testImportModule,
139139
"version": ext.Get(ext.JSExtension)["k6/x/testimport"].Version,
140-
"kind": "js",
140+
"type": "js",
141141
},
142142
{
143143
"module": testImportModule2,
144144
"version": ext.Get(ext.JSExtension)["k6/x/testimport2"].Version,
145-
"kind": "js",
145+
"type": "js",
146146
},
147147
},
148148
},
@@ -155,7 +155,7 @@ func TestRunReportsExtensions(t *testing.T) {
155155
{
156156
"module": ext.Get(ext.OutputExtension)["testoutput"].Path,
157157
"version": ext.Get(ext.OutputExtension)["testoutput"].Version,
158-
"kind": "output",
158+
"type": "output",
159159
},
160160
},
161161
},
@@ -186,7 +186,7 @@ func TestRunReportsExtensions(t *testing.T) {
186186
{
187187
"module": testImportModule2,
188188
"version": ext.Get(ext.JSExtension)["k6/x/testimport2"].Version,
189-
"kind": "js",
189+
"type": "js",
190190
},
191191
},
192192
},
@@ -286,7 +286,7 @@ func TestRunReportsExtensions(t *testing.T) {
286286
require.NoError(t, json.Unmarshal(raw, &report))
287287
require.Equal(t, tc.wantOutputs, report.Outputs, "expected the built-in output to stay listed under outputs")
288288
for _, e := range report.Extensions {
289-
require.NotEqual(t, "output", e["kind"], "expected no output-kind extension entry for a built-in output")
289+
require.NotEqual(t, "output", e["type"], "expected no output-type extension entry for a built-in output")
290290
}
291291
}
292292

internal/cmd/tests/cmd_subcommand_help_report_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestHelpInvocationReportsUsage(t *testing.T) {
3030
{
3131
"module": testSubModule,
3232
"version": ext.Get(ext.SubcommandExtension)["testsub"].Version,
33-
"kind": "subcommand",
33+
"type": "subcommand",
3434
},
3535
}
3636

internal/cmd/tests/cmd_subcommand_nested_report_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func TestNestedSubcommandReportsUsage(t *testing.T) {
136136
{
137137
"module": testNestModule,
138138
"version": ext.Get(ext.SubcommandExtension)["testnest"].Version,
139-
"kind": "subcommand",
139+
"type": "subcommand",
140140
},
141141
}
142142

internal/cmd/tests/cmd_subcommand_report_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestSubcommandReportsUsage(t *testing.T) {
6868
{
6969
"module": testSubModule,
7070
"version": ext.Get(ext.SubcommandExtension)["testsub"].Version,
71-
"kind": "subcommand",
71+
"type": "subcommand",
7272
},
7373
},
7474
},

0 commit comments

Comments
 (0)