add structured logging to PURL and sigstore Rego builtins#3121
add structured logging to PURL and sigstore Rego builtins#3121robnester-rh wants to merge 1 commit intoconforma:mainfrom
Conversation
Add log.WithField("function", ...) to PURL and sigstore custom Rego
builtin functions to ease troubleshooting. This follows the same
pattern already used in the OCI builtin functions.
Functions updated:
- ec.purl.is_valid
- ec.purl.parse
- ec.sigstore.verify_image
- ec.sigstore.verify_attestation
Ref: EC-1668
Resolves: conforma#1361
Signed-off-by: Rob Nester <rnester@redhat.com>
Review Summary by QodoAdd structured logging to PURL and sigstore Rego builtins
WalkthroughsDescription• Add structured logging to PURL builtin functions using log.WithField pattern • Add structured logging to sigstore builtin functions with context fields • Import logrus package in sigstore module for logging support • Replace unstructured log calls with field-based logging for better debugging Diagramflowchart LR
A["PURL Functions<br/>is_valid, parse"] -->|"Add log.WithField<br/>function name"| B["Structured Logging"]
C["Sigstore Functions<br/>verify_image, verify_attestation"] -->|"Add log.WithField<br/>function name"| B
B -->|"Include context fields<br/>purl, ref, error, counts"| D["Enhanced Debugging"]
File Changes1. internal/rego/purl/purl.go
|
Code Review by Qodo
1. Missing rfunc log field
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Add log.WithField("function", ...) to PURL and sigstore custom Rego builtin functions to ease troubleshooting. This follows the same pattern already used in the OCI builtin functions.
Functions updated:
Ref: EC-1668
Resolves: #1361