feat: Add post-exec reporting support (#134)

* feat: Add post install reporting support

* fix: UI report handling

* fix: Duplicate reporting

* fix: Show warning on insecure bypass

* fix: Proxy event log insecure skip installation

* fix: Proxy event log insecure skip installation

* fix: Common definition for infer outcome
This commit is contained in:
Abhisek Datta
2026-01-27 17:50:26 +05:30
committed by GitHub
parent 0aa82033a5
commit 36ac3e3384
14 changed files with 1022 additions and 66 deletions
+16
View File
@@ -23,6 +23,7 @@ const (
EventTypeInstallTrustedAllowed EventType = "install_trusted_allowed"
EventTypeInstallStarted EventType = "install_started"
EventTypeDependencyResolved EventType = "dependency_resolved"
EventTypeInstallInsecureBypass EventType = "install_insecure_bypass"
EventTypeError EventType = "error"
)
@@ -359,6 +360,21 @@ func LogInstallTrustedAllowed(packageName, version, ecosystem string) {
}
}
// LogInstallInsecureBypass logs when an installation skips analysis due to insecure installation mode.
func LogInstallInsecureBypass(packageName, version, ecosystem string) {
event := Event{
EventType: EventTypeInstallInsecureBypass,
Message: fmt.Sprintf("Installation bypassed analysis due to insecure installation mode: %s@%s", packageName, version),
PackageName: packageName,
Version: version,
Ecosystem: ecosystem,
}
if err := LogEvent(event); err != nil {
log.Warnf("failed to log install insecure bypass event: %s", err)
}
}
// LogInstallStarted logs when an installation starts
func LogInstallStarted(packageManager string, args []string) {
event := Event{