Remove application credential substitution
This commit is contained in:
@@ -7,19 +7,16 @@ import (
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/diagnostics"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/redaction"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/reporting"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/outcomes"
|
||||
commandkit "go.maximumdirect.net/commandkit"
|
||||
)
|
||||
|
||||
// finishProcess delivers the transcript and reports before emitting success information.
|
||||
func finishProcess(inv commandkit.Invocation, input processInput, loaded *processInputs, prepared *preparedProcess, snapshot reporting.Snapshot, transcript []byte, primary error) commandkit.Outcome {
|
||||
func finishProcess(inv commandkit.Invocation, input processInput, prepared *preparedProcess, snapshot reporting.Snapshot, transcript []byte, primary error) commandkit.Outcome {
|
||||
reporter := inv.Reporter()
|
||||
secrets := loaded.Runtime.ConfiguredSecrets(inv.Context)
|
||||
safe := redaction.New(secrets)
|
||||
for _, warning := range prepared.Prepared.Warnings {
|
||||
_ = reporter.Warn("Debug artifact: " + safe.String(warning.Error()))
|
||||
_ = reporter.Warn("Debug artifact: " + warning.Error())
|
||||
}
|
||||
completed := time.Now().UTC()
|
||||
snapshot.RunID, snapshot.StartedAt, snapshot.CompletedAt = prepared.RunID, prepared.Started, &completed
|
||||
@@ -36,7 +33,7 @@ func finishProcess(inv commandkit.Invocation, input processInput, loaded *proces
|
||||
var failed func([]diagnostics.FileFailure) diagnostics.ReportBundle
|
||||
if len(reportPaths) > 0 {
|
||||
var err error
|
||||
reports, err = renderReportBundle(snapshot, secrets...)
|
||||
reports, err = renderReportBundle(snapshot)
|
||||
if err != nil {
|
||||
if primary == nil {
|
||||
primary = err
|
||||
@@ -44,7 +41,7 @@ func finishProcess(inv commandkit.Invocation, input processInput, loaded *proces
|
||||
snapshot.Status = reporting.StatusFailed
|
||||
}
|
||||
failed = func(failures []diagnostics.FileFailure) diagnostics.ReportBundle {
|
||||
result, bundleErr := renderReportBundle(failedOutputSnapshot(snapshot, failures), secrets...)
|
||||
result, bundleErr := renderReportBundle(failedOutputSnapshot(snapshot, failures))
|
||||
if bundleErr != nil {
|
||||
return reports
|
||||
}
|
||||
@@ -60,14 +57,14 @@ func finishProcess(inv commandkit.Invocation, input processInput, loaded *proces
|
||||
}
|
||||
result := prepared.Prepared.Output.Finish(primary, transcript, reports, failed)
|
||||
if result != nil {
|
||||
return commandkit.Failure(safe.String(result.Error())).WithCause(result)
|
||||
return commandkit.Failure(result.Error()).WithCause(result)
|
||||
}
|
||||
_ = reporter.AtEnd().Info(reporting.CompletionLine(snapshot))
|
||||
for _, path := range reportPaths {
|
||||
_ = reporter.AtEnd().Info(fmt.Sprintf("Report: %s", safe.String(path)))
|
||||
_ = reporter.AtEnd().Info(fmt.Sprintf("Report: %s", path))
|
||||
}
|
||||
if prepared.Prepared.Debug != nil {
|
||||
_ = reporter.AtEnd().Info(fmt.Sprintf("Diagnostics: %s", safe.String(prepared.Prepared.Debug.Path())))
|
||||
_ = reporter.AtEnd().Info(fmt.Sprintf("Diagnostics: %s", prepared.Prepared.Debug.Path()))
|
||||
}
|
||||
return commandkit.Success()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user