Skip to content

Commit

Permalink
1417-timestamp-UTC
Browse files Browse the repository at this point in the history
Signed-off-by: desmax74 <[email protected]>
  • Loading branch information
desmax74 committed Nov 6, 2023
1 parent 00d978b commit 82f0a06
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pkg/assembler/backends/arangodb/certifyBad.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/arangodb/certifyLegal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/arangodb/certifyVuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/backend/certify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/backend/certifyLegal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/backend/certifyVEXStatement.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions pkg/assembler/backends/ent/backend/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/backend/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/inmem/certifyLegal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/assembler/backends/inmem/vulnMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c *demoClient) ingestVulnerabilityMetadata(ctx context.Context, vulnerabil
collectedVulnMetadataLink = &vulnerabilityMetadataLink{
id: c.getNextID(),
vulnerabilityID: vulnID,
timestamp: vulnerabilityMetadata.Timestamp,
timestamp: vulnerabilityMetadata.Timestamp.UTC(),
scoreType: vulnerabilityMetadata.ScoreType,
scoreValue: (vulnerabilityMetadata.ScoreValue),
origin: vulnerabilityMetadata.Origin,
Expand Down Expand Up @@ -287,7 +287,7 @@ func (c *demoClient) buildVulnerabilityMetadata(link *vulnerabilityMetadataLink,
vulnMetadata := &model.VulnerabilityMetadata{
ID: nodeID(link.id),
Vulnerability: vuln,
Timestamp: link.timestamp,
Timestamp: link.timestamp.UTC(),
ScoreType: model.VulnerabilityScoreType(link.scoreType),
ScoreValue: link.scoreValue,
Origin: link.origin,
Expand Down

0 comments on commit 82f0a06

Please sign in to comment.