From 1ef86f1db6ef6e6756c974f4879b6a716bb73ee5 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Fri, 20 Mar 2026 09:37:48 +0100 Subject: [PATCH] Parallelize artifact verification and SBOM generation Run VerifyArtifacts and GenerateBillOfMaterials concurrently after changelog generation. Changelog must run first since it performs git checkouts on the shared working tree. Signed-off-by: Sascha Grunert --- pkg/anago/anago.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkg/anago/anago.go b/pkg/anago/anago.go index a9064e7ce8f..8a0caa2499a 100644 --- a/pkg/anago/anago.go +++ b/pkg/anago/anago.go @@ -23,6 +23,7 @@ import ( "github.com/blang/semver/v4" "github.com/sirupsen/logrus" + "golang.org/x/sync/errgroup" "sigs.k8s.io/release-sdk/git" "sigs.k8s.io/release-utils/helpers" @@ -271,7 +272,7 @@ func (s *Stage) Run() error { return fmt.Errorf("init log file: %w", err) } - logger := log.NewStepLogger(12) + logger := log.NewStepLogger(11) v := version.GetVersionInfo() logger.Infof("Using krel version: %s", v.GitVersion) @@ -323,16 +324,20 @@ func (s *Stage) Run() error { return fmt.Errorf("generate changelog: %w", err) } - logger.WithStep().Info("Verifying artifacts") + logger.WithStep().Info("Verifying artifacts and generating bill of materials") - if err := s.client.VerifyArtifacts(); err != nil { - return fmt.Errorf("verifying artifacts: %w", err) - } + g := new(errgroup.Group) + + g.Go(func() error { + return s.client.VerifyArtifacts() + }) - logger.WithStep().Info("Generating bill of materials") + g.Go(func() error { + return s.client.GenerateBillOfMaterials() + }) - if err := s.client.GenerateBillOfMaterials(); err != nil { - return fmt.Errorf("generating sbom: %w", err) + if err := g.Wait(); err != nil { + return err } logger.WithStep().Info("Staging artifacts")