Skip to content

Commit 1402d42

Browse files
committed
fix: stop excluding non-github repos from security contacts ingest
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent ffcd3ac commit 1402d42

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

services/apps/packages_worker/src/security-contacts/ingestSingle.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ interface SingleRepoRow {
2929
// what this on-demand path exists for. `packages` aggregates every package linked to
3030
// the repo (not just the requested purl) so extractors see every ecosystem, matching
3131
// the shape the batch sweep builds.
32+
//
33+
// No host filter: processRepo already degrades gracefully for non-github repos (the
34+
// github-specific extractors no-op, security.txt/registry-manifest extractors still run)
35+
// and always stamps contacts_last_refreshed — filtering here would leave non-github repos
36+
// permanently NULL, re-triggering this on-demand path on every single request.
3237
async function findBestRepoForPurl(qx: QueryExecutor, purl: string): Promise<SingleRepoRow | null> {
3338
return qx.selectOneOrNone(
3439
`
@@ -51,7 +56,7 @@ async function findBestRepoForPurl(qx: QueryExecutor, purl: string): Promise<Sin
5156
LIMIT 1
5257
) best ON true
5358
JOIN repos r ON r.id = best.repo_id
54-
WHERE p.purl = $(purl) AND r.host = 'github'
59+
WHERE p.purl = $(purl)
5560
`,
5661
{ purl },
5762
)

services/apps/packages_worker/src/security-contacts/processBatch.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ async function fetchBatch(qx: QueryExecutor): Promise<SweepRow[]> {
7272
FROM repos r
7373
JOIN package_repos pr ON pr.repo_id = r.id
7474
JOIN packages p ON p.id = pr.package_id AND p.is_critical
75-
WHERE r.host = 'github'
76-
AND (
75+
WHERE (
7776
-- never evaluated → always eligible
7877
r.contacts_last_refreshed IS NULL
7978
-- evaluated but no contacts found yet → retry on the daily cadence

0 commit comments

Comments
 (0)