Skip to content

Commit 892b4f0

Browse files
committed
feat(x): status message field
Signed-off-by: Johannes Großmann <grossmann.johannes@t-online.de>
1 parent baa5e70 commit 892b4f0

4 files changed

Lines changed: 87 additions & 42 deletions

File tree

client/client.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,13 @@ func (c client) ListPlugins(ctx context.Context) ([]PluginInfo, error) {
251251
continue
252252
}
253253
info := PluginInfo{
254-
Name: name,
255-
Version: version,
256-
Disabled: item.GetDisabled(),
257-
External: item.GetExternal(),
258-
Configurable: item.GetConfigurable(),
259-
RunStatus: item.GetRunStatus(),
254+
Name: name,
255+
Version: version,
256+
Disabled: item.GetDisabled(),
257+
External: item.GetExternal(),
258+
Configurable: item.GetConfigurable(),
259+
RunStatus: item.GetRunStatus(),
260+
StatusMessage: item.GetStatusMessage(),
260261
}
261262
if sp := item.GetSecretsProvider(); sp != nil {
262263
pattern, err := secrets.ParsePattern(sp.GetPattern())
@@ -297,6 +298,7 @@ type PluginInfo struct {
297298
External bool
298299
Configurable bool
299300
RunStatus pluginsv1.RunStatus
301+
StatusMessage string
300302
SecretsProvider *SecretsProviderMetadata
301303
}
302304

client/client_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ func (m mockPluginsList) ListPlugins(_ context.Context, _ *connect.Request[plugi
7878
version = plugin.Version.String()
7979
}
8080
b := pluginsv1.Plugin_builder{
81-
Name: proto.String(name),
82-
Version: proto.String(version),
83-
Disabled: proto.Bool(plugin.Disabled),
84-
External: proto.Bool(plugin.External),
85-
Configurable: proto.Bool(plugin.Configurable),
86-
RunStatus: plugin.RunStatus.Enum(),
81+
Name: proto.String(name),
82+
Version: proto.String(version),
83+
Disabled: proto.Bool(plugin.Disabled),
84+
External: proto.Bool(plugin.External),
85+
Configurable: proto.Bool(plugin.Configurable),
86+
RunStatus: plugin.RunStatus.Enum(),
87+
StatusMessage: proto.String(plugin.StatusMessage),
8788
}
8889
if plugin.SecretsProvider != nil {
8990
b.SecretsProvider = pluginsv1.SecretsProvider_builder{
@@ -165,6 +166,7 @@ func Test_ListPlugins(t *testing.T) {
165166
SecretsProvider: &SecretsProviderMetadata{Pattern: secrets.MustParsePattern("**")},
166167
External: true,
167168
RunStatus: pluginsv1.RunStatus_RUN_STATUS_CRASHED,
169+
StatusMessage: "exit status 1: connection refused",
168170
},
169171
}
170172
socket := mockListPluginsEngine(t, plugins)

x/api/plugins/v1/api.pb.go

Lines changed: 66 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/api/plugins/v1/api.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@ message Plugin {
5050
bool configurable = 5;
5151
// Run status
5252
RunStatus run_status = 6;
53+
// Human-readable detail for the current run_status. Populated for
54+
// terminal/error statuses (CRASHED, RETRIES_EXCEEDED); typically empty
55+
// otherwise. Not machine-parseable — intended for display only.
56+
string status_message = 7;
5357
// Type-specific fields
5458
oneof metadata {
55-
SecretsProvider secrets_provider = 7;
59+
SecretsProvider secrets_provider = 8;
5660
}
5761
}
5862

0 commit comments

Comments
 (0)