Skip to content
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

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

thisislawatts
Copy link
Member

@thisislawatts thisislawatts commented Oct 1, 2024

  • 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{
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

@cmars cmars left a 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.

@@ -163,6 +163,7 @@ func (a *snykApiClient) GetFeatureFlag(flagname string, orgId string) (bool, err
}

var flag contract.OrgFeatureFlagResponse
flag.Ok = defaultResult
Copy link
Contributor

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?

Copy link
Contributor

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).

Copy link
Contributor

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)

@j-luong j-luong force-pushed the feat/CLI-506-introduce-template-renderer branch from 163e38f to 120e54a Compare October 3, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants