Skip to content

Commit

Permalink
chore: add more logs for shipped live processing
Browse files Browse the repository at this point in the history
  • Loading branch information
vibe13 committed Dec 17, 2024
1 parent e2b8e29 commit 57c2536
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,13 @@ private Collection<SbomGenerationRequest> handleStandardAdvisory(RequestEvent re
// Otherwise SBOMer will default to the creation of build manifests. Will change in future!
V1Beta1RequestRecord successfulRequestRecord = null;
if (ErrataStatus.SHIPPED_LIVE.equals(details.getStatus())) {
log.debug("Errata status is SHIPPED_LIVE, looking for successful request records for advisory {}", erratum.getDetails().get().getId());
successfulRequestRecord = sbomService
.searchLastSuccessfulAdvisoryRequestRecord(String.valueOf(erratum.getDetails().get().getId()));
}

log.debug("Successful request records found: {}", successfulRequestRecord);

if (successfulRequestRecord == null) {
return createBuildManifestsForDockerBuilds(requestEvent, buildDetails);
} else {
Expand Down Expand Up @@ -424,6 +427,8 @@ protected Collection<SbomGenerationRequest> createReleaseManifestsForDockerBuild
return doIgnoreRequest(requestEvent, "Standard Errata container images manifest generation is disabled");
}

log.debug("Creating release manifests for Docker builds for advisory {}", erratum.getDetails().get().getId());

Map<ProductVersionEntry, SbomGenerationRequest> releaseGenerations = createReleaseManifestsGenerationsForType(
erratum,
requestEvent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.persistence.Query;
import lombok.extern.slf4j.Slf4j;

@ApplicationScoped
@Slf4j
public class RequestEventRepository extends CriteriaAwareRepository<RequestEvent> {

public RequestEventRepository() {
Expand Down Expand Up @@ -324,6 +326,8 @@ public List<V1Beta1RequestRecord> searchAggregatedResultsNatively(String filter)
throw new ClientException("Unsupported typeKey '" + typeKey + "'. Allowed values: " + ALLOWED_TYPE_KEYS);
}

log.debug("Natively searching records for type '{}' and value '{}'", typeKey, typeValue);

// Build the native SQL query
StringBuilder sb = new StringBuilder().append("SELECT ")
.append("re.id AS request_id, ")
Expand Down

0 comments on commit 57c2536

Please sign in to comment.