feat: add reviewedBy and reviewedOn to suppression details [IGNR-2204] - #660
feat: add reviewedBy and reviewedOn to suppression details [IGNR-2204]#660adisatop wants to merge 11 commits into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This comment has been minimized.
This comment has been minimized.
70faf67 to
def56d3
Compare
cbill-s
left a comment
There was a problem hiding this comment.
We also need to update local_finding.sarif.tmpl for the changes to be written in the Sarif.
| {{- if and .Attributes.Suppression.Details.ReviewedOn .Attributes.Suppression.Details.ReviewedBy }} | ||
| Reviewed on: {{ .Attributes.Suppression.Details.ReviewedOn }} | ||
| Reviewed by name : {{ .Attributes.Suppression.Details.ReviewedBy.Name }} | ||
| Reviewed by email: {{ .Attributes.Suppression.Details.ReviewedBy.Email }} |
There was a problem hiding this comment.
let's follow the same pattern as ignored - can we have something like this?
{{- if .Attributes.Suppression.Details.ReviewedOn }}
Reviewed on: {{ .Attributes.Suppression.Details.ReviewedOn }}
{{- end }}
{{- if and .Attributes.Suppression.Details.ReviewedBy .Attributes.Suppression.Details.ReviewedBy.Name}}
Reviewed by: {{ .Attributes.Suppression.Details.ReviewedBy.Name }}
{{- end }}
There was a problem hiding this comment.
I would suggest
{{- if .Attributes.Suppression.Details.ReviewedOn }}
Reviewed on: {{ .Attributes.Suppression.Details.ReviewedOn }}
{{- end }}
{{- if .Attributes.Suppression.Details.ReviewedBy .Attributes.Suppression.Details.ReviewedBy.Name}}
Reviewed by: {{ .Attributes.Suppression.Details.ReviewedBy.Name }}
{{- end }}
the and does not bring anything in this case, if I am not mistaken
There was a problem hiding this comment.
This reverts commit 1560fb6.
This comment has been minimized.
This comment has been minimized.
| Ignored on: {{ formatDatetime .Attributes.Suppression.Details.IgnoredOn "2006-01-02T15:04:05.999999999Z07:00" "January 02, 2006" }} | ||
| Ignored by: {{ .Attributes.Suppression.Details.IgnoredBy.Name }} | ||
| {{- if .Attributes.Suppression.Details.ReviewedOn }} | ||
| Reviewed on: {{ .Attributes.Suppression.Details.ReviewedOn }} |
There was a problem hiding this comment.
ReviewedOn shown without datetime formatting
Low Severity
Reviewed on prints raw ReviewedOn, while Ignored on in the same block uses formatDatetime for a human-readable date. Review timestamps will appear as ISO strings in CLI output, inconsistent with neighboring suppression fields.
Reviewed by Cursor Bugbot for commit b977b26. Configure here.
There was a problem hiding this comment.
Question: @adisatop I think this is a reasonable comment. or am I missing a reason why the date format should not be presented consistently?
| type: object | ||
| required: | ||
| - name | ||
|
|
There was a problem hiding this comment.
please remove the empty lines please
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0daff2b. Configure here.
This comment has been minimized.
This comment has been minimized.
| module github.com/snyk/go-application-framework | ||
|
|
||
| go 1.26 | ||
| go 1.26.2 |
There was a problem hiding this comment.
is this an intentional change?
There was a problem hiding this comment.
yes, since bumped the code-client-go dep that using that version.
There was a problem hiding this comment.
please add table-driven validity tests for this
| Reviewed on: {{ .Attributes.Suppression.Details.ReviewedOn }} | ||
| {{- end }} | ||
| {{- if .Attributes.Suppression.Details.ReviewedBy }} | ||
| Reviewed by name: {{ .Attributes.Suppression.Details.ReviewedBy.Name }} |
There was a problem hiding this comment.
Question: Should this really be Reviewed by name:? Or should it be something like Reviewed by: <Name> (<EMail>)
|
|
||
| Expiration: {{- if .Attributes.Suppression.Details.Expiration }} {{ formatDatetime .Attributes.Suppression.Details.Expiration "2006-01-02T15:04:05.999999999Z07:00" "January 02, 2006" }} {{- else }} never {{- end }} | ||
| {{- if .Attributes.Suppression.Details.ReviewedOn }} | ||
| Reviewed on: {{ .Attributes.Suppression.Details.ReviewedOn }} |
robertolopezlopez
left a comment
There was a problem hiding this comment.
Hi @adisatop , please finish addressing the open threads (ok if you do not like the cursor suggested datetime formatting).
This comment has been minimized.
This comment has been minimized.
| {{- end }} | ||
| {{- if and $finding.Attributes.Suppression.Details.ReviewedBy }} | ||
| "reviewedBy": { | ||
| "name": {{ getQuotedString $finding.Attributes.Suppression.Details.ReviewedBy.Name }} |
| "properties": { | ||
| "category": {{ getQuotedString $finding.Attributes.Suppression.Details.Category }}, | ||
| {{- if $finding.Attributes.Suppression.Details.Expiration }}"expiration": "{{ $finding.Attributes.Suppression.Details.Expiration }}",{{- end }} | ||
| {{- if and $finding.Attributes.Suppression.Details.ReviewedOn }} |
| "name": {{ getQuotedString $finding.Attributes.Suppression.Details.IgnoredBy.Name }}, | ||
| "email": {{ getQuotedString $finding.Attributes.Suppression.Details.IgnoredBy.Email }} | ||
| } | ||
|
|
Remove redundant single-argument `and` conditionals and normalize indentation/trailing whitespace in the reviewedBy/ignoredBy blocks of the SARIF template. No change to rendered output. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Reviewer Guide 🔍
|
|
Please open a CLI PR as well, to ensure that the changes integrate well. |
| github.com/rs/zerolog v1.34.0 | ||
| github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 | ||
| github.com/snyk/code-client-go v1.24.5 | ||
| github.com/snyk/code-client-go v1.29.0 |
There was a problem hiding this comment.
Question: This is actually quite a bump. The CLI actually uses 1.27 but still there are some changes in where I wonder if this is tested enough snyk/code-client-go@v1.27.0...v1.29.0


Description
Adds optional
reviewedByandreviewedOnfields to the suppression details ofthe local finding model, so consumers (CLI, IDE, MCP) can see who reviewed an
ignore and when — not just who requested it (
ignoredBy/ignoredOn).Snyk ignores go through a review lifecycle (pending / approved / rejected).
Upstream SARIF (
code-client-goSuppressionProperties) already exposesReviewedOnandReviewedBy, but GAF was dropping them during transformation.Changes:
types.SuppressionDetailsin the REST test spec with optionalreviewedOnandreviewedBy(bothstring) and regeneratelocal_models.mapSuppressions:reviewedOnpasses through, andreviewedByis flattened from the SARIFReviewer.Name(nil-safe).code-client-goto expose the reviewed suppression properties.transform_test.go.The fields are optional pointers (
omitempty), so unreviewed ignores leave themunset. This keeps the change additive and backwards compatible on the public API.
Checklist
make test)make generate)make lint)go get github.com/snyk/go-application-framework@YOUR_LATEST_GAF_COMMITin thecliv2directory.go.modto point to your local GAF code.go mod tidyin thecliv2directory.go.modandgo.sumchanges.Note
Low Risk
Additive optional fields on suppression metadata and presentation only; no auth or scan logic changes. Dependency bumps are routine.
Overview
Adds optional reviewedOn and reviewedBy on suppression details so CLI, IDE, and MCP outputs can show who reviewed an ignore and when, alongside existing ignoredBy / ignoredOn request metadata.
The OpenAPI test spec and regenerated
local_modelsgainTypesReviewerand the new suppression fields; SARIF → local finding mapping inmapSuppressionsnow preservesReviewedOnandReviewedByfromcode-client-go(bumped to v1.29.0) instead of dropping them. Text and SARIF presenters emit the fields when present.Tests cover transform mapping and presenter output for component text and SARIF JSON. Fields are optional (
omitempty), so behavior stays backward compatible when review data is absent.Reviewed by Cursor Bugbot for commit 09af3d4. Bugbot is set up for automated code reviews on this repo. Configure here.