-
Notifications
You must be signed in to change notification settings - Fork 7
fix!: markdown processing returns errors #802
fix!: markdown processing returns errors #802
Conversation
Signed-off-by: Joerg Poecher <[email protected]>
Signed-off-by: Joerg Poecher <[email protected]>
Signed-off-by: Joerg Poecher <[email protected]>
Signed-off-by: Joerg Poecher <[email protected]>
Signed-off-by: Joerg Poecher <[email protected]>
Signed-off-by: Joerg Poecher <[email protected]>
Signed-off-by: Joerg Poecher <[email protected]>
Signed-off-by: Joerg Poecher <[email protected]>
@@ -16,61 +54,158 @@ func NewMarkdownTileProcessing() *MarkdownTileProcessing { | |||
} | |||
|
|||
// Process will overwrite the default values for SLOScore and SLOComparison with the contents found in the markdown | |||
func (p *MarkdownTileProcessing) Process(tile *dynatrace.Tile, defaultScore keptncommon.SLOScore, defaultComparison keptncommon.SLOComparison) (*keptncommon.SLOScore, *keptncommon.SLOComparison) { | |||
func (p *MarkdownTileProcessing) Process(tile *dynatrace.Tile, defaultScore keptncommon.SLOScore, defaultComparison keptncommon.SLOComparison) (*markdownParsingResult, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method Process returns unexported type *dashboard.markdownParsingResult, which can be annoying to use
"testing" | ||
) | ||
|
||
type CombinedURLHandler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type CombinedURLHandler should have comment or be unexported
templatingHandler *TemplatingPayloadBasedURLHandler | ||
} | ||
|
||
func NewCombinedURLHandler(t *testing.T, templateFile string) *CombinedURLHandler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported function NewCombinedURLHandler should have comment or be unexported
} | ||
} | ||
|
||
func (h *CombinedURLHandler) AddExactFile(url string, fileName string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method CombinedURLHandler.AddExactFile should have comment or be unexported
h.fileHandler.AddExact(url, fileName) | ||
} | ||
|
||
func (h *CombinedURLHandler) AddExactTemplate(url string, templatingData interface{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method CombinedURLHandler.AddExactTemplate should have comment or be unexported
Signed-off-by: Joerg Poecher <[email protected]>
// we allow the user to use a markdown to specify SLI/SLO properties, e.g: KQG.Total.Pass | ||
// if we find KQG. we process the markdown | ||
return parseMarkdownConfiguration(tile.Markdown, defaultScore, defaultComparison) | ||
} | ||
|
||
const ( | ||
TotalPass = "kqg.total.pass" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported const TotalPass should have comment (or a comment on this block) or be unexported
Signed-off-by: Joerg Poecher <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
The following Docker Images have been built: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
closes #629
in case an error occurs while parsing the configuration contained in a markdown tile and error will be returned and no evaluation of SLIs will be done.
What is considered an error?
KQG.Total.Pass
,KQG.Total.Warning
,KQG.Compare.WithScore
,KQG.Compare.Results
andKQG.Compare.Function
KQG.Total.Pass
,KQG.Total.Warning
: any value that is not a non-negative decimal including an optional%
. So basically anything that does not match:^(\d+|\d+\.\d+)([%]?)$
KQG.Compare.WithScore
: any value other thanpass
,all
,pass_or_warn
KQG.Compare.Results
: any not integral value as well as integers that are less than1
KQG.Compare.Function
: any value other thanavg
,p50
,p90
,p95