diff --git a/pkg/assembler/backends/arangodb/certifyBad.go b/pkg/assembler/backends/arangodb/certifyBad.go index 52ba52c269d..7cc8b0ad6a5 100644 --- a/pkg/assembler/backends/arangodb/certifyBad.go +++ b/pkg/assembler/backends/arangodb/certifyBad.go @@ -946,7 +946,7 @@ func getCertifyBadFromCursor(ctx context.Context, cursor driver.Cursor) ([]*mode Justification: createdValue.Justification, Origin: createdValue.Collector, Collector: createdValue.Origin, - KnownSince: createdValue.KnownSince, + KnownSince: createdValue.KnownSince.UTC(), } if pkg != nil { diff --git a/pkg/assembler/backends/arangodb/certifyLegal.go b/pkg/assembler/backends/arangodb/certifyLegal.go index c5c65772927..5e0263212df 100644 --- a/pkg/assembler/backends/arangodb/certifyLegal.go +++ b/pkg/assembler/backends/arangodb/certifyLegal.go @@ -855,7 +855,7 @@ func (c *arangoClient) getCertifyLegalFromCursor(ctx context.Context, DiscoveredLicense: createdValue.DiscoveredLicense, Attribution: createdValue.Attribution, Justification: createdValue.Justification, - TimeScanned: createdValue.TimeScanned, + TimeScanned: createdValue.TimeScanned.UTC(), Origin: createdValue.Origin, Collector: createdValue.Collector, } diff --git a/pkg/assembler/backends/arangodb/certifyVuln.go b/pkg/assembler/backends/arangodb/certifyVuln.go index caa86e6c074..31f68139be7 100644 --- a/pkg/assembler/backends/arangodb/certifyVuln.go +++ b/pkg/assembler/backends/arangodb/certifyVuln.go @@ -113,7 +113,7 @@ func setCertifyVulnMatchValues(arangoQueryBuilder *arangoQueryBuilder, certifyVu } if certifyVulnSpec.TimeScanned != nil { arangoQueryBuilder.filter("certifyVuln", timeScannedStr, "==", "@"+timeScannedStr) - queryValues[timeScannedStr] = certifyVulnSpec.TimeScanned.UTC() + queryValues[timeScannedStr] = certifyVulnSpec.TimeScanned } if certifyVulnSpec.DbURI != nil { arangoQueryBuilder.filter("certifyVuln", dbUriStr, "==", "@"+dbUriStr) diff --git a/pkg/assembler/backends/ent/backend/certify.go b/pkg/assembler/backends/ent/backend/certify.go index 78fc37eb0e8..36f682d1c8b 100644 --- a/pkg/assembler/backends/ent/backend/certify.go +++ b/pkg/assembler/backends/ent/backend/certify.go @@ -162,7 +162,7 @@ func upsertCertification[T certificationInputSpec](ctx context.Context, client * SetJustification(v.Justification). SetOrigin(v.Origin). SetCollector(v.Collector). - SetKnownSince(v.KnownSince) + SetKnownSince(v.KnownSince.UTC()) case model.CertifyGoodInputSpec: insert. SetType(certification.TypeGOOD). diff --git a/pkg/assembler/backends/ent/backend/certifyLegal.go b/pkg/assembler/backends/ent/backend/certifyLegal.go index 402012df9ec..164a72b3d29 100644 --- a/pkg/assembler/backends/ent/backend/certifyLegal.go +++ b/pkg/assembler/backends/ent/backend/certifyLegal.go @@ -97,7 +97,7 @@ func (b *EntBackend) IngestCertifyLegal(ctx context.Context, subject model.Packa SetDiscoveredLicense(spec.DiscoveredLicense). SetAttribution(spec.Attribution). SetJustification(spec.Justification). - SetTimeScanned(spec.TimeScanned). + SetTimeScanned(spec.TimeScanned.UTC()). SetOrigin(spec.Origin). SetCollector(spec.Collector) diff --git a/pkg/assembler/backends/ent/backend/certifyVEXStatement.go b/pkg/assembler/backends/ent/backend/certifyVEXStatement.go index 1c4e88cc59b..a6ede389b02 100644 --- a/pkg/assembler/backends/ent/backend/certifyVEXStatement.go +++ b/pkg/assembler/backends/ent/backend/certifyVEXStatement.go @@ -92,7 +92,7 @@ func (b *EntBackend) IngestVEXStatement(ctx context.Context, subject model.Packa } insert. - SetKnownSince(vexStatement.KnownSince). + SetKnownSince(vexStatement.KnownSince.UTC()). SetStatus(vexStatement.Status.String()). SetStatement(vexStatement.Statement). SetStatusNotes(vexStatement.StatusNotes). @@ -187,7 +187,7 @@ func toModelCertifyVEXStatement(record *ent.CertifyVex) *model.CertifyVEXStateme ID: nodeID(record.ID), Subject: toPackageOrArtifact(record.Edges.Package, record.Edges.Artifact), Vulnerability: toModelVulnerabilityFromVulnerabilityID(record.Edges.Vulnerability), - KnownSince: record.KnownSince, + KnownSince: record.KnownSince.UTC(), Status: model.VexStatus(record.Status), Statement: record.Statement, StatusNotes: record.StatusNotes, diff --git a/pkg/assembler/backends/ent/backend/scorecard.go b/pkg/assembler/backends/ent/backend/scorecard.go index d6fd5427091..9453ec58aee 100644 --- a/pkg/assembler/backends/ent/backend/scorecard.go +++ b/pkg/assembler/backends/ent/backend/scorecard.go @@ -133,7 +133,7 @@ func upsertScorecard(ctx context.Context, tx *ent.Tx, source model.SourceInputSp Create(). SetChecks(checks). SetAggregateScore(scorecardInput.AggregateScore). - SetTimeScanned(scorecardInput.TimeScanned). + SetTimeScanned(scorecardInput.TimeScanned.UTC()). SetScorecardVersion(scorecardInput.ScorecardVersion). SetScorecardCommit(scorecardInput.ScorecardCommit). SetOrigin(scorecardInput.Origin). @@ -182,7 +182,7 @@ func toModelScorecard(record *ent.Scorecard) *model.Scorecard { return &model.Scorecard{ Checks: record.Checks, AggregateScore: record.AggregateScore, - TimeScanned: record.TimeScanned, + TimeScanned: record.TimeScanned.UTC(), ScorecardVersion: record.ScorecardVersion, ScorecardCommit: record.ScorecardCommit, Origin: record.Origin, diff --git a/pkg/assembler/backends/ent/backend/source.go b/pkg/assembler/backends/ent/backend/source.go index 0092f5c3ab6..258d8df949b 100644 --- a/pkg/assembler/backends/ent/backend/source.go +++ b/pkg/assembler/backends/ent/backend/source.go @@ -103,7 +103,7 @@ func upsertHasSourceAt(ctx context.Context, client *ent.Tx, pkg model.PkgInputSp SetCollector(spec.Collector). SetOrigin(spec.Origin). SetJustification(spec.Justification). - SetKnownSince(spec.KnownSince). + SetKnownSince(spec.KnownSince.UTC()). SetSourceID(srcID) if pkgMatchType.Pkg == model.PkgMatchTypeAllVersions { diff --git a/pkg/assembler/backends/inmem/certifyBad.go b/pkg/assembler/backends/inmem/certifyBad.go index 92924388f49..4619b68cd14 100644 --- a/pkg/assembler/backends/inmem/certifyBad.go +++ b/pkg/assembler/backends/inmem/certifyBad.go @@ -162,7 +162,7 @@ func (c *demoClient) ingestCertifyBad(ctx context.Context, subject model.Package } if subjectMatch && certifyBad.Justification == v.justification && certifyBad.Origin == v.origin && certifyBad.Collector == v.collector && - certifyBad.KnownSince.Equal(v.knownSince) { + certifyBad.KnownSince.UTC().Equal(v.knownSince.UTC()) { collectedCertifyBadLink = *v duplicate = true diff --git a/pkg/assembler/backends/inmem/certifyGood.go b/pkg/assembler/backends/inmem/certifyGood.go index 1d8b93a84ea..ffa17889ee1 100644 --- a/pkg/assembler/backends/inmem/certifyGood.go +++ b/pkg/assembler/backends/inmem/certifyGood.go @@ -161,7 +161,7 @@ func (c *demoClient) ingestCertifyGood(ctx context.Context, subject model.Packag } if subjectMatch && certifyGood.Justification == v.justification && certifyGood.Origin == v.origin && certifyGood.Collector == v.collector && - certifyGood.KnownSince.Equal(v.knownSince) { + certifyGood.KnownSince.UTC().Equal(v.knownSince.UTC()) { collectedCertifyGoodLink = *v duplicate = true @@ -292,7 +292,7 @@ func (c *demoClient) addCGIfMatch(out []*model.CertifyGood, noMatch(filter.Collector, link.collector) || noMatch(filter.Collector, link.collector) || noMatch(filter.Origin, link.origin) || - filter.KnownSince != nil && filter.KnownSince.After(link.knownSince) { + filter.KnownSince != nil && filter.KnownSince.UTC().After(link.knownSince.UTC()) { return out, nil } } diff --git a/pkg/assembler/backends/inmem/certifyLegal.go b/pkg/assembler/backends/inmem/certifyLegal.go index 59d30d3b769..c4b3bbca704 100644 --- a/pkg/assembler/backends/inmem/certifyLegal.go +++ b/pkg/assembler/backends/inmem/certifyLegal.go @@ -164,7 +164,7 @@ func (c *demoClient) ingestCertifyLegal(ctx context.Context, subject model.Packa cl.discoveredLicense == certifyLegal.DiscoveredLicense && slices.Equal(cl.discoveredLicenses, dis) && cl.attribution == certifyLegal.Attribution && - cl.timeScanned.Equal(certifyLegal.TimeScanned) && + cl.timeScanned.UTC().Equal(certifyLegal.TimeScanned.UTC()) && cl.justification == certifyLegal.Justification && cl.origin == certifyLegal.Origin && cl.collector == certifyLegal.Collector { @@ -223,7 +223,7 @@ func (c *demoClient) convLegal(in *certifyLegalStruct) (*model.CertifyLegal, err DiscoveredLicense: in.discoveredLicense, Attribution: in.attribution, Justification: in.justification, - TimeScanned: in.timeScanned, + TimeScanned: in.timeScanned.UTC(), Origin: in.origin, Collector: in.collector, } @@ -365,7 +365,7 @@ func (c *demoClient) addLegalIfMatch(out []*model.CertifyLegal, noMatch(filter.Justification, link.justification) || noMatch(filter.Origin, link.origin) || noMatch(filter.Collector, link.collector) || - (filter.TimeScanned != nil && !link.timeScanned.Equal(*filter.TimeScanned)) || + (filter.TimeScanned != nil && !link.timeScanned.UTC().Equal(filter.TimeScanned.UTC())) || !c.matchLicenses(filter.DeclaredLicenses, link.declaredLicenses) || !c.matchLicenses(filter.DiscoveredLicenses, link.discoveredLicenses) { return out, nil