Closed f1ames closed 7 months ago
Awesome work!
For the annotation key, I believe we should rely more on the human-readable form (monokle.io/suppress.kbp.no-latest-image) over the rule identifier form (monokle.io/suppress.KBP007). When you have multiple suppressions, it's hard to understand what the latter is now actually suppressing.
For the annotation value, it's indeed a petty limitation that you cannot use true
due to the JSON Schema as it makes more sense. I see Traefik uses "true"
which might be a possibility. For full context, the original intention was that if you provide a string, it's to be added as the SARIF suppression's justification (e.g. "won't fix"
or "false positive"
). I think for a quick action it's to complicated to give a selection / input for justifications.
For the annotation value, it's indeed a petty limitation that you cannot use
true
due to the JSON Schema as it makes more sense. I see Traefik uses"true"
which might be a possibility. For full context, the original intention was that if you provide a string, it's to be added as the SARIF suppression's justification (e.g."won't fix"
or"false positive"
). I think for a quick action it's to complicated to give a selection / input for justifications.
Yeah, was considering "true"
but it looks like some kind of workaround. Maybe good way to tackle this would be mentioning in the docs/readme that one can change annotation value as it acts as justification comment?
Maybe good way to tackle this would be mentioning in the docs/readme that one can change annotation value as it acts as justification comment
That's definitely a good place for it! Feel free to do that.
This PR introduces annotation based suppressions. Fixes https://github.com/kubeshop/monokle-saas/issues/2309.
Changes
CodeActionProvider
class which can be reused for different types of actions (other types of suppressions, autofixes, etc).Fixes
How it works
Remarks
Suppressed
in violations panel only. There is still highlight for them and are shown in problems panel. This is quite confusing and there is dedicated issue to fix this - https://github.com/kubeshop/vscode-monokle/issues/78.monokle.io/suppress.ruleId: suppress
because using booleantrue
violates schema resulting inK8S001
violation 😅@TODO
in the code on purpose. It's not needed for this PR but will be needed for others.Checklist