diff --git a/deploy/crds/base/jvmbuildservice.io_dependencybuilds.yaml b/deploy/crds/base/jvmbuildservice.io_dependencybuilds.yaml index 6ea6a18e4c..38014aa6b7 100644 --- a/deploy/crds/base/jvmbuildservice.io_dependencybuilds.yaml +++ b/deploy/crds/base/jvmbuildservice.io_dependencybuilds.yaml @@ -86,6 +86,16 @@ spec: items: type: string type: array + gitArchive: + description: Git Archive information + properties: + url: + type: string + tag: + type: string + sha: + type: string + type: object hermeticBuildImage: description: The hermetic build image produced by the build diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java index 7c05c4610a..cb3c8e3e25 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/DeployCommand.java @@ -159,8 +159,8 @@ public void run() { try { Set gavs = new HashSet<>(); Map> contaminatedPaths = new HashMap<>(); - Map> contaminatedGavs = new HashMap<>(); - Map archivedSourceTags = new HashMap<>(); + Map contaminatedGavs = new HashMap<>(); + Git.GitStatus archivedSourceTags = new Git.GitStatus(); // Save the source first regardless of deployment checks if (isNotEmpty(gitIdentity) && gitToken.isPresent()) { diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java index e51e6cdba5..1628480c3a 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/Git.java @@ -4,8 +4,6 @@ import java.net.URI; import java.net.URISyntaxException; import java.nio.file.Path; -import java.util.Collections; -import java.util.Map; import java.util.UUID; import org.eclipse.jgit.api.errors.GitAPIException; @@ -27,7 +25,7 @@ public abstract class Git { public abstract void create(String name) throws IOException, URISyntaxException; - public abstract Map add(Path path, String commit, String imageId) + public abstract GitStatus add(Path path, String commit, String imageId) throws IOException; /** @@ -65,7 +63,7 @@ public static Git builder(String endpoint, String identity, String token, boolea } } - protected Map pushRepository(Path path, String httpTransportUrl, String commit, String imageId) { + protected GitStatus pushRepository(Path path, String httpTransportUrl, String commit, String imageId) { try (var jGit = org.eclipse.jgit.api.Git.init().setDirectory(path.toFile()).call()) { // Find the tag name associated with the commit. Then append the unique imageId. This is from the Go code // and is a hash of abr.Status.SCMInfo.SCMURL + abr.Status.SCMInfo.Tag + abr.Status.SCMInfo.Path @@ -109,9 +107,8 @@ protected Map pushRepository(Path path, String httpTransportUrl, + result.getRemoteUpdates()); } - return Collections.singletonMap(Repository.shortenRefName(tagRefUnique.getName()), + return new GitStatus(httpTransportUrl, Repository.shortenRefName(tagRefUnique.getName()), jRepo.getRefDatabase().peel(tagRefUnique).getPeeledObjectId().getName()); - } catch (GitAPIException | IOException e) { throw new RuntimeException(e); } @@ -134,4 +131,24 @@ protected String parseScmURI(String scmUri) } abstract String groupSplit(); + + public static class GitStatus { + public String url; + public String tag; + public String sha; + + public GitStatus() { + } + + public GitStatus(String url, String tag, String sha) { + this.url = url; + this.tag = tag; + this.sha = sha; + } + + @Override + public String toString() { + return "GitStatus{url='" + url + "', tag='" + tag + "', sha='" + sha + "'}"; + } + } } diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java index 23d0cb1972..92fe9dc0f1 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitHub.java @@ -5,7 +5,6 @@ import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Path; -import java.util.Map; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.kohsuke.github.GHRepository; @@ -88,7 +87,7 @@ public void create(String scmUri) } @Override - public Map add(Path path, String commit, String imageId) { + public GitStatus add(Path path, String commit, String imageId) { if (repository == null) { throw new RuntimeException("Call create first"); } diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java index 04bb6d3e6f..206f0e475c 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/analyser/deploy/git/GitLab.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Path; -import java.util.Map; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.gitlab4j.api.GitLabApi; @@ -41,7 +40,6 @@ public GitLab(String endpoint, String identity, String token, boolean ssl) { public void create(String scmUri) throws URISyntaxException { String name = parseScmURI(scmUri); - Log.infof("Creating repository with name %s", name); try { project = gitLabApi.getProjectApi().getUserProjectsStream(owner, new ProjectFilter().withSearch(name)) .filter(p -> p.getName().equals(name)) @@ -68,7 +66,7 @@ public void create(String scmUri) } @Override - public Map add(Path path, String commit, String imageId) + public GitStatus add(Path path, String commit, String imageId) throws IOException { if (project == null) { throw new RuntimeException("Call create first"); diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/DiffUtils.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/DiffUtils.java index 8a3587edc9..3ba20fb044 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/DiffUtils.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/DiffUtils.java @@ -10,12 +10,10 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.builder.DiffResult; -import org.jboss.logging.Logger; import com.redhat.hacbs.container.verifier.asm.AsmDiffable; public class DiffUtils { - private static final Logger Log = Logger.getLogger(DiffUtils.class); public record DiffResults(Set shared, Set added, Set deleted, Map> diffResults, diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/MavenUtils.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/MavenUtils.java index d381957e15..4b59231e19 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/MavenUtils.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/MavenUtils.java @@ -28,10 +28,10 @@ import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; import org.eclipse.aether.util.repository.DefaultMirrorSelector; -import org.jboss.logging.Logger; + +import io.quarkus.logging.Log; public class MavenUtils { - private static final Logger Log = Logger.getLogger(MavenUtils.class); public static Settings newSettings(Path globalSettingsFile, Path settingsFile) { try { diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/VerifyBuiltArtifactsCommand.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/VerifyBuiltArtifactsCommand.java index e8dec461b6..b5434f920f 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/VerifyBuiltArtifactsCommand.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/VerifyBuiltArtifactsCommand.java @@ -36,20 +36,19 @@ import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.repository.RemoteRepository.Builder; -import org.jboss.logging.Logger; import com.redhat.hacbs.container.results.ResultsUpdater; import com.redhat.hacbs.container.verifier.asm.JarInfo; import io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext; import io.quarkus.bootstrap.resolver.maven.BootstrapMavenException; +import io.quarkus.logging.Log; import picocli.CommandLine; import picocli.CommandLine.Command; import picocli.CommandLine.Option; @Command(name = "verify-built-artifacts") public class VerifyBuiltArtifactsCommand implements Callable { - private static final Logger Log = Logger.getLogger(VerifyBuiltArtifactsCommand.class); static class LocalOptions { @Option(required = true, names = { "-of", "--original-file" }) @@ -139,7 +138,6 @@ public Integer call() { session.setReadOnly(); } - Log.debugf("Deploy path: %s", options.mavenOptions.deployPath); var futureResults = new HashMap>>(); Files.walkFileTree(options.mavenOptions.deployPath, new SimpleFileVisitor<>() { @@ -191,7 +189,7 @@ public List call() throws Exception { } if (taskRunName != null) { var json = ResultsUpdater.MAPPER.writeValueAsString(verificationResults); - io.quarkus.logging.Log.infof("Writing verification results %s", json); + Log.infof("Writing verification results %s", json); resultsUpdater.get().updateResults(taskRunName, Map.of("VERIFICATION_RESULTS", json)); } return (failed && !reportOnly ? 1 : 0); diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/asm/JarInfo.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/asm/JarInfo.java index a90bd4ee49..94cf4fe3ed 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/asm/JarInfo.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/verifier/asm/JarInfo.java @@ -16,15 +16,14 @@ import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; -import org.jboss.logging.Logger; import org.objectweb.asm.ClassReader; import org.objectweb.asm.tree.ClassNode; import com.redhat.hacbs.container.verifier.DiffUtils; -public record JarInfo(String name, Map classes) implements AsmDiffable { +import io.quarkus.logging.Log; - private static final Logger Log = Logger.getLogger(JarInfo.class); +public record JarInfo(String name, Map classes) implements AsmDiffable { // diffClass excluding name diff --git a/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java b/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java index 3809b00d45..c363407775 100644 --- a/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java +++ b/java-components/build-request-processor/src/test/java/com/redhat/hacbs/container/analyser/deploy/git/GitTest.java @@ -10,7 +10,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.logging.LogRecord; @@ -78,7 +77,7 @@ public void create(String name) { } @Override - public Map add(Path path, String commit, String imageId) { + public GitStatus add(Path path, String commit, String imageId) { return null; } @@ -87,7 +86,7 @@ public String groupSplit() { return null; } }; - Map tagResults = test.pushRepository( + Git.GitStatus tagResults = test.pushRepository( initialRepo, testRepoURI, "c396268fb90335bde5c9272b9a194c3d4302bf24", @@ -105,23 +104,16 @@ public String groupSplit() { List tags = testRepository.tagList().call(); assertEquals(2, tags.size()); - assertEquals(1, tagResults.size()); - assertTrue(tags.stream().anyMatch(r -> r.getName().equals("refs/tags/0.1-75ecd81c7a2b384151c990975eb1dd10"))); - tagResults.forEach((k, v) -> { - var found = tags.stream().filter(t -> Repository.shortenRefName(t.getName()).matches(k)).findFirst(); - assertTrue(found.isPresent()); - try { - assertTrue(v.matches(testRepository.getRepository() - .getRefDatabase() - .peel(found.get()) - .getPeeledObjectId() - .getName())); - } catch (IOException e) { - throw new RuntimeException(e); - } - }); + var found = tags.stream().filter(t -> Repository.shortenRefName(t.getName()).matches(tagResults.tag)).findFirst(); + assertTrue(found.isPresent()); + assertTrue(tagResults.url.contains(testRepoURI)); + assertTrue(tagResults.sha.matches(testRepository.getRepository() + .getRefDatabase() + .peel(found.get()) + .getPeeledObjectId() + .getName())); } } diff --git a/java-components/cache/src/main/java/com/redhat/hacbs/artifactcache/services/CachePomScmLocator.java b/java-components/cache/src/main/java/com/redhat/hacbs/artifactcache/services/CachePomScmLocator.java index 62ce2cadb5..d207ba078d 100644 --- a/java-components/cache/src/main/java/com/redhat/hacbs/artifactcache/services/CachePomScmLocator.java +++ b/java-components/cache/src/main/java/com/redhat/hacbs/artifactcache/services/CachePomScmLocator.java @@ -9,14 +9,14 @@ import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.jboss.logging.Logger; import com.redhat.hacbs.recipies.scm.AbstractPomScmLocator; +import io.quarkus.logging.Log; + @ApplicationScoped public class CachePomScmLocator extends AbstractPomScmLocator { - private static final Logger log = Logger.getLogger(CachePomScmLocator.class); @Inject CacheFacade cache; @@ -27,7 +27,7 @@ protected AbstractPomScmLocator.PomClient createPomClient() { public Optional getPom(String group, String artifact, String version) { var response = cache.getArtifactFile("default", group.replace(".", "/"), artifact, version, artifact + "-" + version + ".pom", false); - if (!response.isPresent()) { + if (response.isEmpty()) { return Optional.empty(); } try { @@ -38,7 +38,7 @@ public Optional getPom(String group, String artifact, String version) { } } catch (Exception e) { - log.errorf(e, "Failed to get pom for %s:%s:%s", group, artifact, version); + Log.errorf(e, "Failed to get pom for %s:%s:%s", group, artifact, version); return Optional.empty(); } finally { try { diff --git a/pkg/apis/jvmbuildservice/v1alpha1/dependencybuild_types.go b/pkg/apis/jvmbuildservice/v1alpha1/dependencybuild_types.go index f00c6aabfb..16514bfcc9 100644 --- a/pkg/apis/jvmbuildservice/v1alpha1/dependencybuild_types.go +++ b/pkg/apis/jvmbuildservice/v1alpha1/dependencybuild_types.go @@ -92,11 +92,19 @@ type BuildPipelineRunResults struct { Gavs []string `json:"gavs,omitempty"` // The hermetic build image produced by the build HermeticBuildImage string `json:"hermeticBuildImage,omitempty"` + // The git archive source information + GitArchive GitArchive `json:"gitArchive,omitempty"` // The Tekton results PipelineResults *PipelineResults `json:"pipelineResults,omitempty"` } +type GitArchive struct { + URL string `json:"url,omitempty"` + Tag string `json:"tag,omitempty"` + SHA string `json:"sha,omitempty"` +} + func (r *DependencyBuildStatus) GetBuildPipelineRun(pipeline string) *BuildAttempt { for i := range r.BuildAttempts { ba := r.BuildAttempts[i] diff --git a/pkg/reconciler/artifactbuild/artifactbuild.go b/pkg/reconciler/artifactbuild/artifactbuild.go index 3d55a559ae..91816bea92 100644 --- a/pkg/reconciler/artifactbuild/artifactbuild.go +++ b/pkg/reconciler/artifactbuild/artifactbuild.go @@ -36,14 +36,6 @@ const ( DependencyBuildIdLabel = "jvmbuildservice.io/dependencybuild-id" PipelineRunLabel = "jvmbuildservice.io/pipelinerun" - PipelineResultScmUrl = "scm-url" - PipelineResultScmTag = "scm-tag" - PipelineResultScmHash = "scm-hash" - PipelineResultScmType = "scm-type" - PipelineResultContextPath = "context" - PipelineResultMessage = "message" - PipelineResultPrivate = "private" - PreBuildTaskName = "pre-build" BuildTaskName = "build" HermeticBuildTaskName = "hermetic-build" @@ -54,12 +46,13 @@ const ( PipelineResultVerificationResult = "VERIFICATION_RESULTS" PipelineResultPassedVerification = "PASSED_VERIFICATION" //#nosec PipelineResultHermeticBuildImage = "HERMETIC_BUILD_IMAGE" + PipelineResultGitArchive = "GIT_ARCHIVE" PipelineResultGavs = "GAVS" RebuildAnnotation = "jvmbuildservice.io/rebuild" - //annotation that is applied after a rebuild, it will affect the dependencybuild behaviour + // RebuiltAnnotation annotation that is applied after a rebuild, it will affect the dependencybuild behaviour RebuiltAnnotation = "jvmbuildservice.io/rebuilt" - //if this annotation is present it will be deleted after a set time to live + // HoursToLive if this annotation is present it will be deleted after a set time to live //useful when doing builds that are being deployed to maven, and you don't want to accumulate them in the cluster HoursToLive = "jvmbuildservice.io/hours-to-live" ) diff --git a/pkg/reconciler/dependencybuild/buildrecipeyaml.go b/pkg/reconciler/dependencybuild/buildrecipeyaml.go index 5ec8ebe4d7..1060fd74af 100644 --- a/pkg/reconciler/dependencybuild/buildrecipeyaml.go +++ b/pkg/reconciler/dependencybuild/buildrecipeyaml.go @@ -248,6 +248,7 @@ func createPipelineSpec(tool string, commitTime int64, jbsConfig *v1alpha12.JBSC {Name: PipelineResultImageDigest}, {Name: artifactbuild.PipelineResultPassedVerification}, {Name: artifactbuild.PipelineResultVerificationResult}, + {Name: artifactbuild.PipelineResultGitArchive}, }...), Steps: []pipelinev1beta1.Step{ { @@ -296,6 +297,7 @@ func createPipelineSpec(tool string, commitTime int64, jbsConfig *v1alpha12.JBSC {Name: PipelineResultImageDigest}, {Name: artifactbuild.PipelineResultPassedVerification}, {Name: artifactbuild.PipelineResultVerificationResult}, + {Name: artifactbuild.PipelineResultGitArchive}, }, Steps: []pipelinev1beta1.Step{ { @@ -421,9 +423,15 @@ func createPipelineSpec(tool string, commitTime int64, jbsConfig *v1alpha12.JBSC } ps.Tasks = append(ps.Tasks, tagPipelineTask) + fmt.Printf("### buildTask.Results %#v \n", buildTask.Results) + for _, i := range buildTask.Results { + fmt.Printf("### attempting to append %#v \n", i.Name) ps.Results = append(ps.Results, pipelinev1beta1.PipelineResult{Name: i.Name, Description: i.Description, Value: pipelinev1beta1.ResultValue{Type: pipelinev1beta1.ParamTypeString, StringVal: "$(tasks." + artifactbuild.BuildTaskName + ".results." + i.Name + ")"}}) } + + fmt.Printf("### PipelineSpec.Results %#v \n", ps.Results) + for _, i := range buildSetup.Params { ps.Params = append(ps.Params, pipelinev1beta1.ParamSpec{Name: i.Name, Description: i.Description, Default: i.Default, Type: i.Type}) var value pipelinev1beta1.ResultValue diff --git a/pkg/reconciler/dependencybuild/dependencybuild.go b/pkg/reconciler/dependencybuild/dependencybuild.go index 1c0c8b4a99..f55ffefd55 100644 --- a/pkg/reconciler/dependencybuild/dependencybuild.go +++ b/pkg/reconciler/dependencybuild/dependencybuild.go @@ -587,6 +587,8 @@ func (r *ReconcileDependencyBuild) handleBuildPipelineRunReceived(ctx context.Co run.Complete = true run.Succeeded = pr.Status.GetCondition(apis.ConditionSucceeded).IsTrue() + fmt.Printf("### handleBuildPipelineRunReceived :: attempt %#v \n", attempt) + if !run.Succeeded { log.Info(fmt.Sprintf("build %s failed", pr.Name)) @@ -652,8 +654,19 @@ func (r *ReconcileDependencyBuild) handleBuildPipelineRunReceived(ctx context.Co var verificationResults string var gavs []string var hermeticBuildImage string - var deployed []string + var gitArchive v1alpha1.GitArchive + + // DEBUG + jbsConfig := &v1alpha1.JBSConfig{} + err = r.client.Get(ctx, types.NamespacedName{Namespace: db.Namespace, Name: v1alpha1.JBSConfigName}, jbsConfig) + if err != nil && !errors.IsNotFound(err) { + return reconcile.Result{}, err + } + fmt.Printf("### handleBuildPipelineRunReceived :: jbsConfig :: gitURL %#v \n", jbsConfig.Spec.GitSourceArchive.URL) + // DEBUG:END for _, i := range pr.Status.Results { + fmt.Printf("### handleBuildPipelineRunReceived :: looping with i %#v \n", i.Name) + if i.Name == PipelineResultImage { image = i.Value.StringVal } else if i.Name == PipelineResultImageDigest { @@ -669,16 +682,25 @@ func (r *ReconcileDependencyBuild) handleBuildPipelineRunReceived(ctx context.Co parseBool, _ := strconv.ParseBool(i.Value.StringVal) passedVerification = !parseBool } else if i.Name == artifactbuild.PipelineResultVerificationResult { + // TODO: The TaskRun stores this as + // VERIFICATION_RESULTS {"commons-lang:commons-lang:jar:2.5":[]} + // But this is now stored as + // "verificationFailures": "{\"commons-lang:commons-lang:jar:2.5\":[]}" + // which, apart from the escaping, is rather confusing change. verificationResults = i.Value.StringVal } else if i.Name == artifactbuild.PipelineResultGavs { + // TODO: What is the difference between this and PipelineResultDeployedResources? deployed := strings.Split(i.Value.StringVal, ",") db.Status.DeployedArtifacts = deployed } else if i.Name == artifactbuild.PipelineResultDeployedResources && len(i.Value.StringVal) > 0 { //we need to create 'DeployedArtifact' resources for the objects that were deployed - deployed = strings.Split(i.Value.StringVal, ",") + gavs = strings.Split(i.Value.StringVal, ",") + } else if i.Name == artifactbuild.PipelineResultGitArchive { + err = json.Unmarshal([]byte(i.Value.StringVal), &gitArchive) + fmt.Printf("### handleBuildPipelineRunReceived :: gitArchive %#v \n", gitArchive) } } - err = r.createRebuiltArtifacts(ctx, log, pr, db, image, digest, deployed) + err = r.createRebuiltArtifacts(ctx, log, pr, db, image, digest, gavs) if err != nil { return reconcile.Result{}, err } @@ -689,8 +711,10 @@ func (r *ReconcileDependencyBuild) handleBuildPipelineRunReceived(ctx context.Co Verified: passedVerification, VerificationResults: verificationResults, Gavs: gavs, + GitArchive: gitArchive, HermeticBuildImage: hermeticBuildImage, } + problemContaminates := db.Status.ProblemContaminates() if len(problemContaminates) == 0 { db.Status.State = v1alpha1.DependencyBuildStateComplete