-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: introduce template renderer [CLI-506] #252
base: main
Are you sure you want to change the base?
Conversation
thisislawatts
commented
Oct 1, 2024
•
edited by jira
bot
Loading
edited by jira
bot
- feat: introduce localfinding presenter CLI-506
- test: add failing check for template contents
log.Warn().Err(err).Msg("Failed to unmarshal local finding") | ||
continue | ||
} | ||
findingPresentation := presenters.LocalFindingPresentation{ |
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.
Suggestion: The fact that we have to add the path to an extra structure means for me, that this information is missing in the local findings model. The path is not a presenter specific concern but a test concern hence it should be in the findings model.
@@ -1,3 +1,3 @@ | |||
package local_models | |||
|
|||
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config oapi.config.yaml ../cueutils/source/openapi/rest/test.spec.yaml | |||
//go:generate oapi-codegen -config oapi.config.yaml ../../../internal/cueutils/source/openapi/rest/test.spec.yaml |
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.
Question: this and other changes are already on main, why are they here?
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.
I think this needs a rebase.
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.
Without a rebase, it's hard to tell if I'm reviewing things that have already landed in main, or the topic of this PR.
The summary template coverage looks good. I love the box
custom template function.
I'd like to see more test coverage of rendering individual findings.
internal/api/api.go
Outdated
@@ -163,6 +163,7 @@ func (a *snykApiClient) GetFeatureFlag(flagname string, orgId string) (bool, err | |||
} | |||
|
|||
var flag contract.OrgFeatureFlagResponse | |||
flag.Ok = defaultResult |
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.
false
is already the default bool value in Go, is this needed?
internal/api/api_test.go
Outdated
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.
Suggest adding a GetFeatureFlag error case as well, to make sure it returns the default (not ok).
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.
(This might be a drive-by request, if this is something already in latest main
pending a rebase)
163e38f
to
120e54a
Compare