Add native Notarius readiness checks

This commit is contained in:
2026-11-30 01:17:33 +00:00
parent 7eed744ad1
commit a5d541529d
17 changed files with 985 additions and 28 deletions

View File

@@ -57,26 +57,7 @@ func (r *SubprocessRunner) Run(ctx context.Context, req RunRequest) (RunResult,
return RunResult{}, fmt.Errorf("notarius credentials: %w", err)
}
args := []string{
"run", req.PipelineID,
"--config", req.ConfigPath,
"--input-file", req.InputPath,
"--output-dir", req.OutputRoot,
}
if req.Cache != nil {
args = append(args, "--cache", *req.Cache)
}
if req.Debug {
args = append(args, "--debug")
}
args = append(args, "--debug-dir", req.DebugDirectory)
for _, reference := range references {
args = append(args, "--reference", reference.Selector+"="+reference.Path)
}
if req.ConfigOverlay != nil {
args = append(args, "--overlay", *req.ConfigOverlay)
}
args = append(args, "--format", "json")
args := runArgs("run", req, references)
processResult, err := r.run(ctx, subprocess.RunRequest{
Executable: req.Binary,
Args: args,
@@ -113,6 +94,32 @@ func (r *SubprocessRunner) Run(ctx context.Context, req RunRequest) (RunResult,
return baseResult, nil
}
// runArgs is shared by execution and readiness so selected runtime controls
// and references cannot drift between the two commands.
func runArgs(command string, req RunRequest, references []ReferenceBinding) []string {
args := []string{
command, req.PipelineID,
"--config", req.ConfigPath,
"--input-file", req.InputPath,
"--output-dir", req.OutputRoot,
}
if req.Cache != nil {
args = append(args, "--cache", *req.Cache)
}
if req.Debug {
args = append(args, "--debug")
}
args = append(args, "--debug-dir", req.DebugDirectory)
for _, reference := range references {
args = append(args, "--reference", reference.Selector+"="+reference.Path)
}
if req.ConfigOverlay != nil {
args = append(args, "--overlay", *req.ConfigOverlay)
}
args = append(args, "--format", "json")
return args
}
func loadCompletionReport(path, pipelineID string) (CompletionReport, error) {
var document struct {
Pipeline string `json:"pipeline"`