feat: add --html flag for interactive permission trace visualization #1773
lint.yaml
on: pull_request
Lint Go
58s
Lint YAML & Markdown
50s
Analyze FS with Trivy
49s
Analyze Release Image with Trivy
2m 9s
Lint Commit Messages
46s
Matrix: Analyze with CodeQL
Annotations
2 errors and 2 warnings
|
Lint Go
Process completed with exit code 1.
|
|
Lint Go:
internal/printers/html.go#L0
Please run gofumpt.
diff --git a/internal/printers/html.go b/internal/printers/html.go
index 20bc561..8208a5e 100644
--- a/internal/printers/html.go
+++ b/internal/printers/html.go
@@ -234,26 +234,30 @@ func (h *HTMLCheckTraceRenderer) writeHeader() {
h.builder.WriteString(htmlHeaderPrefix)
// Write timestamp
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
" <p class=\"metadata-timestamp\">Generated: %s</p>\n",
html.EscapeString(h.options.Timestamp.Format("2006-01-02 15:04:05 MST")),
)
// Write optional metadata
if h.options.Command != "" {
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
" <p class=\"metadata-item\">Command: <code class=\"metadata-code\">%s</code></p>\n",
html.EscapeString(h.options.Command),
)
}
if h.options.SpiceDBServer != "" {
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
" <p class=\"metadata-item\">SpiceDB Server: %s</p>\n",
html.EscapeString(h.options.SpiceDBServer),
)
}
if h.options.SpiceDBVersion != "" {
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
" <p class=\"metadata-item\">SpiceDB Version: %s</p>\n",
html.EscapeString(h.options.SpiceDBVersion),
)
@@ -443,12 +447,14 @@ func (h *HTMLCheckTraceRenderer) renderCaveatInfo(caveatInfo *v1.CaveatEvalInfo)
h.builder.WriteString(`<div class="caveat-node">`)
fmt.Fprintf(&h.builder, `<span class="icon %s">%s</span> `, iconClass, icon)
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
`<span class="caveat-expr%s">%s</span> `,
exprClass,
html.EscapeString(caveatInfo.Expression),
)
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
`<span class="caveat-name">%s</span>`,
html.EscapeString(caveatInfo.CaveatName),
)
@@ -462,7 +468,8 @@ func (h *HTMLCheckTraceRenderer) renderCaveatInfo(caveatInfo *v1.CaveatEvalInfo)
contextJSON, err := json.MarshalIndent(contextMap, "", " ")
if err != nil {
// Defensive: handle unexpected marshaling errors (no details wrapper for errors)
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
`<div class="context-json">(error marshaling context: %s)</div>`,
html.EscapeString(err.Error()),
)
@@ -470,7 +477,8 @@ func (h *HTMLCheckTraceRenderer) renderCaveatInfo(caveatInfo *v1.CaveatEvalInfo)
// Wrap context in collapsible details element for large JSON payloads
// Only rendered when len(contextMap) > 0, so always has data
h.builder.WriteString(`<details open class="context-details"><summary class="context-summary">Context</summary>`)
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
`<div class="context-json">%s</div>`,
html.EscapeString(string(contextJSON)),
)
@@ -483,7 +491,8 @@ func (h *HTMLCheckTraceRenderer) renderCaveatInfo(caveatInfo *v1.CaveatEvalInfo)
if caveatInfo.Result == v1.CaveatEvalInfo_RESULT_MISSING_SOME_CONTEXT {
if caveatInfo.PartialCaveatInfo != nil && len(caveatInfo.PartialCaveatInfo.MissingRequiredContext) > 0 {
- fmt.Fprintf(&h.builder,
+ fmt.Fprintf(
+ &h.builder,
`<div class="missing-context">missing context: %s</div>`,
html.EscapeString(strings.Join(caveatInfo.PartialCaveatInfo.MissingRequiredContext, ", ")),
)
|
|
Lint Commit Messages
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: webiny/action-conventional-commits@v1.3.1. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
|
Analyze FS with Trivy
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
diff
|
1.09 KB |
sha256:cf53c6b6b72366cc8cff5a622c9ed775a317625f54a49349b2120ef3a85188e7
|
|