-
Notifications
You must be signed in to change notification settings - Fork 731
Expand file tree
/
Copy pathadvisoryAffectedRanges.datasource
More file actions
30 lines (28 loc) · 2.19 KB
/
Copy pathadvisoryAffectedRanges.datasource
File metadata and controls
30 lines (28 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
DESCRIPTION >
- `advisoryAffectedRanges` stores the version ranges affected by a security advisory per package.
- Replicated from Postgres packages-db — each row defines one vulnerable window (introduced → fixed/last_affected).
- Used to determine whether a specific package version falls within a known vulnerable range.
- `id` is the internal primary key.
- `advisoryPackageId` links to the parent advisory_packages row.
- `introducedVersion` is the version where the vulnerability was introduced (empty string if unknown start).
- `fixedVersion` is the version where the vulnerability was patched (empty string if no fix exists yet).
- `lastAffected` is the last known affected version when there is no fixed version (empty string if not applicable).
- `rangeRaw` is the raw AffectedVersions string from the deps.dev BigQuery source (empty string if OSV-sourced).
- `unaffectedRaw` is the raw UnaffectedVersions string from deps.dev BigQuery (empty string if OSV-sourced).
- `createdAt` and `updatedAt` are row-level audit timestamps for Tinybird watermark-based sync.
- `deletedAt` is set when Postgres soft-deletes the row (stale OSV tuple or superseded deps.dev raw row); NULL means live. `FINAL` alone doesn't collapse this — a soft-deleted row and its live replacement are distinct PKs, so consumers must also filter `deletedAt IS NULL` (see ADR-0001 §`advisory_affected_ranges` delete/dedup strategy, CM-1258).
SCHEMA >
`id` UInt64 `json:$.record.id`,
`advisoryPackageId` UInt64 `json:$.record.advisory_package_id`,
`introducedVersion` String `json:$.record.introduced_version` DEFAULT '',
`fixedVersion` String `json:$.record.fixed_version` DEFAULT '',
`lastAffected` String `json:$.record.last_affected` DEFAULT '',
`rangeRaw` String `json:$.record.range_raw` DEFAULT '',
`unaffectedRaw` String `json:$.record.unaffected_raw` DEFAULT '',
`createdAt` DateTime64(3) `json:$.record.created_at`,
`updatedAt` DateTime64(3) `json:$.record.updated_at`,
`deletedAt` Nullable(DateTime64(3)) `json:$.record.deleted_at`
ENGINE ReplacingMergeTree
ENGINE_PARTITION_KEY toYear(createdAt)
ENGINE_SORTING_KEY advisoryPackageId, id
ENGINE_VER updatedAt