From c383f30d89241cd64a05024786073e370a786e47 Mon Sep 17 00:00:00 2001 From: Michel Laterman <82832767+michel-laterman@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:07:52 +0100 Subject: [PATCH] Allow level: trace in settings action (#3350) Allow the trace level to be set in settings actions. --- ...low-level:-trace-for-settings-actions.yaml | 32 +++++++++++++++++++ internal/pkg/api/handleCheckin_test.go | 6 ++++ internal/pkg/api/openapi.gen.go | 1 + model/openapi.yml | 1 + pkg/api/types.gen.go | 1 + 5 files changed, 41 insertions(+) create mode 100644 changelog/fragments/1710319964-Allow-level:-trace-for-settings-actions.yaml diff --git a/changelog/fragments/1710319964-Allow-level:-trace-for-settings-actions.yaml b/changelog/fragments/1710319964-Allow-level:-trace-for-settings-actions.yaml new file mode 100644 index 000000000..e4a1077ce --- /dev/null +++ b/changelog/fragments/1710319964-Allow-level:-trace-for-settings-actions.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: enhancement + +# Change summary; a 80ish characters long description of the change. +summary: Allow level: trace for settings actions + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; a word indicating the component this changeset affects. +component: + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +pr: 3350 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/internal/pkg/api/handleCheckin_test.go b/internal/pkg/api/handleCheckin_test.go index f4753a456..4dd303beb 100644 --- a/internal/pkg/api/handleCheckin_test.go +++ b/internal/pkg/api/handleCheckin_test.go @@ -78,6 +78,12 @@ func TestConvertActionData(t *testing.T) { raw: json.RawMessage(`{"log_level":"error"}`), expect: Action_Data{json.RawMessage(`{"log_level":"error"}`)}, hasErr: false, + }, { + name: "settings action trace level", + aType: SETTINGS, + raw: json.RawMessage(`{"log_level":"trace"}`), + expect: Action_Data{json.RawMessage(`{"log_level":"trace"}`)}, + hasErr: false, }, { name: "upgrade action", aType: UPGRADE, diff --git a/internal/pkg/api/openapi.gen.go b/internal/pkg/api/openapi.gen.go index f7d91e007..10b4243fe 100644 --- a/internal/pkg/api/openapi.gen.go +++ b/internal/pkg/api/openapi.gen.go @@ -45,6 +45,7 @@ const ( ActionSettingsLogLevelDebug ActionSettingsLogLevel = "debug" ActionSettingsLogLevelError ActionSettingsLogLevel = "error" ActionSettingsLogLevelInfo ActionSettingsLogLevel = "info" + ActionSettingsLogLevelTrace ActionSettingsLogLevel = "trace" ActionSettingsLogLevelWarning ActionSettingsLogLevel = "warning" ) diff --git a/model/openapi.yml b/model/openapi.yml index efe6f35c8..a69a355ae 100644 --- a/model/openapi.yml +++ b/model/openapi.yml @@ -593,6 +593,7 @@ components: log_level: type: string enum: + - trace - debug - info - warning diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 2e436aa57..38edf510d 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -42,6 +42,7 @@ const ( ActionSettingsLogLevelDebug ActionSettingsLogLevel = "debug" ActionSettingsLogLevelError ActionSettingsLogLevel = "error" ActionSettingsLogLevelInfo ActionSettingsLogLevel = "info" + ActionSettingsLogLevelTrace ActionSettingsLogLevel = "trace" ActionSettingsLogLevelWarning ActionSettingsLogLevel = "warning" )