Skip to content

Commit

Permalink
🐛 Don't render assessments for data queries
Browse files Browse the repository at this point in the history
Boolean data queries had an assessment and would print that instead of
just the result
  • Loading branch information
jaym committed Sep 25, 2024
1 parent dfff538 commit 5930a73
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/reporter/print_compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ func (r *defaultReporter) printAssetQueries(resolved *policy.ResolvedPolicy, rep
dataQueriesOutput := ""
resolved.WithDataQueries(func(id string, query *policy.ExecutionQuery) {
data := query.Code.FilterResults(results)
result := r.Reporter.Printer.Results(query.Code, data)
result := r.Reporter.Printer.Datas(query.Code, data)

Check failure on line 479 in cli/reporter/print_compact.go

View workflow job for this annotation

GitHub Actions / go-test

r.Reporter.Printer.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 479 in cli/reporter/print_compact.go

View workflow job for this annotation

GitHub Actions / go-test

r.Reporter.Printer.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 479 in cli/reporter/print_compact.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Reporter.Printer.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 479 in cli/reporter/print_compact.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Reporter.Printer.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)
if result == "" {
return
}
Expand Down
2 changes: 1 addition & 1 deletion cli/reporter/render_asset_overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func renderAssetOverview(print *printer.Printer, policyObj *policy.Policy, repor

// print data results
filteredResults := codeBundle.FilterResults(results)
value := print.Results(codeBundle, filteredResults)
value := print.Datas(codeBundle, filteredResults)

Check failure on line 93 in cli/reporter/render_asset_overview.go

View workflow job for this annotation

GitHub Actions / go-test

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 93 in cli/reporter/render_asset_overview.go

View workflow job for this annotation

GitHub Actions / go-test

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 93 in cli/reporter/render_asset_overview.go

View workflow job for this annotation

GitHub Actions / golangci-lint

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 93 in cli/reporter/render_asset_overview.go

View workflow job for this annotation

GitHub Actions / golangci-lint

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

table = append(table, row{
Title: query.Title,
Expand Down
2 changes: 1 addition & 1 deletion cli/reporter/render_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func renderDataQueries(print *printer.Printer, policyObj *policy.Policy, report
}
}

result := print.Results(codeBundle, filteredResults)
result := print.Datas(codeBundle, filteredResults)

Check failure on line 104 in cli/reporter/render_policy.go

View workflow job for this annotation

GitHub Actions / go-test

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 104 in cli/reporter/render_policy.go

View workflow job for this annotation

GitHub Actions / go-test

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)

Check failure on line 104 in cli/reporter/render_policy.go

View workflow job for this annotation

GitHub Actions / golangci-lint

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas)) (typecheck)

Check failure on line 104 in cli/reporter/render_policy.go

View workflow job for this annotation

GitHub Actions / golangci-lint

print.Datas undefined (type *"go.mondoo.com/cnquery/v11/cli/printer".Printer has no field or method Datas) (typecheck)
result = strings.ReplaceAll(result, "\n", NewLineCharacter)
res.WriteString(" Result:")
writeQueryCompact(res, result)
Expand Down

0 comments on commit 5930a73

Please sign in to comment.