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: replace js render to template #57

Merged
merged 13 commits into from
Dec 3, 2024
Merged

feat: replace js render to template #57

merged 13 commits into from
Dec 3, 2024

Conversation

olsova
Copy link
Contributor

@olsova olsova commented Nov 27, 2024

No description provided.

Copy link
Owner

@afdesk afdesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some needed JS was removed, so the search doesn't work now

go.mod Outdated
@@ -3,6 +3,18 @@ module github.com/afdesk/scan2html
go 1.19
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's bump the version up

go.mod Outdated
@@ -3,6 +3,18 @@ module github.com/afdesk/scan2html
go 1.19

require (
github.com/afdesk/trivy-go-plugin v0.0.0-20230425141703-7d18a52213b0
github.com/aquasecurity/trivy v0.38.3
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's try to use the latest version

@olsova olsova requested a review from afdesk December 2, 2024 05:21
Copy link
Owner

@afdesk afdesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few small comments
PTAL
thanks

main.go Outdated
}

firstHTML, err := common.ReadPluginFile("first.html")
rootCmd, err := initFlags()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems initFlags isn't relevant, something like initRootCmd looks better, isn't it?

main.go Outdated
if err != nil {
log.Fatalf("failed to read html file: %v", err)
log.Fatalf("%+v", err)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fatal log without description doesn't look great

main.go Outdated
if err != nil {
log.Fatalf("failed to read html file: %v", err)
if err = rootCmd.Execute(); err != nil {
log.Fatalf("%+v", err)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

main.go Outdated
if err != nil {
log.Fatalf("Failed to display help message %v", err)
return err
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should add some comment for this error too? It will be hard to look for a reason of unknown errors

render/template/html.tpl Outdated Show resolved Hide resolved
render/render.go Outdated Show resolved Hide resolved
render/render.go Outdated Show resolved Hide resolved
render/render_test.go Outdated Show resolved Hide resolved
render/render_test.go Outdated Show resolved Hide resolved
@olsova olsova requested a review from afdesk December 2, 2024 09:36
var (
tempJsonFileName = "scan2html-report-temp.json"
version = "dev"
availableFlags = []string{"--html-result", "--load-result"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update README.MD (new flags, etc.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not all fields are centering.
e.g.:
изображение

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to think about secrets (perhaps in another PR).
изображение

@afdesk afdesk merged commit 7cd063e into afdesk:v3 Dec 3, 2024
1 check passed
afdesk added a commit that referenced this pull request Dec 10, 2024
* init v3

* feat: replace js render to template (#57)

* feat: replace js render to template

* feat: add extra tables to template

* ci: update release steps

* test: add unit tests

* ci: change test trigger branch

* ci: change test trigger branch

* fix: change path for testing

* ci: add checkout

* fix: add changes according PR reviews

* test: update testdata

* fix: add centering for fixed version

* docs: update README.md

* chore: add cmd short description

* feat: add k8s scan report (#59)

---------

Co-authored-by: olsova <olga.solopova@smartforce.io>
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.

4 participants