Skip to content

Commit c51ed11

Browse files
committed
fix: correct guard alert wording + isScript doc for GO/NUGET/RUBYGEMS (CM-1241)
Signed-off-by: Uroš Marolt <uros@marolt.me>
1 parent a66d057 commit c51ed11

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

services/apps/packages_worker/src/deps-dev/activities/checkDependentCountsGuard.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ const GUARD_SOURCE_TABLE: Partial<Record<OsspckgsJobKind, string>> = {
2424
dependent_counts_rubygems: 'RubyGemsRequirementsLatest',
2525
}
2626

27+
// `Dependents` is snapshotted per-date, so "for this snapshot date" is actionable there. The
28+
// GO/NUGET/RubyGems `*RequirementsLatest` views have no snapshot history (see bootstrapOsspckgs.ts,
29+
// RETENTION_DAYS_BY_KIND) — telling an operator to check "this snapshot date" on those is misleading.
30+
const GUARD_HAS_SNAPSHOT_HISTORY: Partial<Record<OsspckgsJobKind, boolean>> = {
31+
dependent_counts: true,
32+
dependent_counts_go: false,
33+
dependent_counts_nuget: false,
34+
dependent_counts_rubygems: false,
35+
}
36+
2737
export interface CheckDependentCountsGuardOutput {
2838
ok: boolean
2939
prevRowCount: number | null
@@ -61,7 +71,7 @@ export async function checkDependentCountsGuard(
6171
},
6272
{
6373
title: 'Action',
64-
text: `Ingest aborted — existing \`dependent_count\` values preserved. Check deps.dev \`${GUARD_SOURCE_TABLE[jobKind] ?? 'Dependents'}\` table for this snapshot date.`,
74+
text: `Ingest aborted — existing \`dependent_count\` values preserved. Check deps.dev \`${GUARD_SOURCE_TABLE[jobKind] ?? 'Dependents'}\` table${(GUARD_HAS_SNAPSHOT_HISTORY[jobKind] ?? true) ? ' for this snapshot date' : ''}.`,
6575
},
6676
],
6777
)

services/apps/packages_worker/src/deps-dev/workflows/ingestDependentCounts.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ interface VariantConfig {
6363
pgColumns: string[]
6464
maxBytesGb: number
6565
buildSql: (snapshotDate: string) => string
66-
// When true, buildSql returns a multi-statement BQ script (the GO/NUGET exact reverse transitive
67-
// closure) that ends by creating TEMP TABLE _export_data, rather than a single SELECT. The export
68-
// activity then appends only EXPORT DATA and enforces the byte ceiling via maximumBytesBilled
69-
// instead of a dry-run. See ADR-0004. Unset (single-SELECT) for the edges variant; set for GO/NUGET.
66+
// When true, buildSql returns a multi-statement BQ script (the GO/NUGET/RUBYGEMS exact reverse
67+
// transitive closure) that ends by creating TEMP TABLE _export_data, rather than a single SELECT.
68+
// The export activity then appends only EXPORT DATA and enforces the byte ceiling via
69+
// maximumBytesBilled instead of a dry-run. See ADR-0004. Unset (single-SELECT) for the edges
70+
// variant; set for GO/NUGET/RUBYGEMS.
7071
isScript?: boolean
7172
}
7273

0 commit comments

Comments
 (0)