Skip to content

Commit c4daff9

Browse files
committed
fix: address second review round
Signed-off-by: anilb <epipav@gmail.com>
1 parent 5937852 commit c4daff9

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

services/apps/packages_worker/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"dev:npm-worker": "CROWD_TEMPORAL_TASKQUEUE=npm-worker SERVICE=npm-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9236 src/bin/npm-worker.ts",
3030
"dev:npm-worker:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && CROWD_TEMPORAL_TASKQUEUE=npm-worker SERVICE=npm-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9236 src/bin/npm-worker.ts",
3131
"start:pypi-worker": "CROWD_TEMPORAL_TASKQUEUE=pypi-worker SERVICE=pypi-worker tsx src/bin/pypi-worker.ts",
32-
"dev:pypi-worker": "CROWD_TEMPORAL_TASKQUEUE=pypi-worker CROWD_TEMPORAL_NAMESPACE=$CROWD_PACKAGES_TEMPORAL_NAMESPACE SERVICE=pypi-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9242 src/bin/pypi-worker.ts",
33-
"dev:pypi-worker:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && CROWD_TEMPORAL_TASKQUEUE=pypi-worker SERVICE=pypi-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9242 src/bin/pypi-worker.ts",
32+
"dev:pypi-worker": "CROWD_TEMPORAL_TASKQUEUE=pypi-worker SERVICE=pypi-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9243 src/bin/pypi-worker.ts",
33+
"dev:pypi-worker:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && CROWD_TEMPORAL_TASKQUEUE=pypi-worker SERVICE=pypi-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9243 src/bin/pypi-worker.ts",
3434
"start:osv-worker": "CROWD_TEMPORAL_TASKQUEUE=osv-worker SERVICE=osv-worker tsx src/bin/osv-worker.ts",
3535
"dev:osv-worker": "CROWD_TEMPORAL_TASKQUEUE=osv-worker SERVICE=osv-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9238 src/bin/osv-worker.ts",
3636
"dev:osv-worker:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && CROWD_TEMPORAL_TASKQUEUE=osv-worker SERVICE=osv-worker LOG_LEVEL=trace nodemon --watch src --watch ../../libs --ext ts --exec tsx --inspect=0.0.0.0:9238 src/bin/osv-worker.ts",

services/apps/packages_worker/src/pypi/downloads/__tests__/pypiDownloads.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('computeLast30dWindows', () => {
5757

5858
// ── Criterion 3: daily trailing window + first-of-month helper ─────────────────────────────
5959
describe('defaultDailyRange', () => {
60-
it('defaults to a 2-day self-healing window [today-2, today-1]', () => {
60+
it('defaults to a 2-day trailing re-scan window [today-2, today-1]', () => {
6161
expect(defaultDailyRange('2026-06-30')).toEqual({
6262
startDate: '2026-06-28',
6363
endDate: '2026-06-29',

services/apps/packages_worker/src/pypi/downloads/ingestPypiDownloads.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ export async function ingestPypiDownloadsLast30d(opts: { fromDate?: string }): P
168168
}
169169
}
170170

171-
// Daily downloads for the critical pypi subset. Scheduled daily with no range → the last 2-day
172-
// self-healing window. Pass an explicit startDate/endDate to backfill an arbitrary range.
171+
// Daily downloads for the critical pypi subset. Scheduled daily with no range → the 2-day
172+
// trailing re-scan window. Pass an explicit startDate/endDate to backfill an arbitrary range.
173173
export async function ingestPypiDownloadsDaily(opts: {
174174
startDate?: string
175175
endDate?: string

services/apps/packages_worker/src/pypi/downloads/pypiDownloads.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function schedulePypiDownloads30d(): Promise<void> {
3535
}
3636

3737
// Daily downloads for the critical pypi subset. Runs daily at 06:00 UTC; no args → the workflow
38-
// scans the self-healing 2-day trailing window.
38+
// scans the 2-day trailing re-scan window.
3939
export async function schedulePypiDownloadsDaily(): Promise<void> {
4040
const { temporal } = svc
4141
if (!temporal) throw new Error('Temporal client not initialized')

services/apps/packages_worker/src/pypi/downloads/pypiDownloadsDates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function computeLast30dWindows(
5858
// re-scanned once on the next run and corrected, while keeping the daily BigQuery scan small.
5959
const DAILY_TRAILING_DAYS = 2
6060

61-
// Default daily trailing window: [today - 2, today - 1] inclusive (self-healing).
61+
// Default daily trailing re-scan window: [today - 2, today - 1] inclusive.
6262
export function defaultDailyRange(today: string): { startDate: string; endDate: string } {
6363
return { startDate: addDaysUTC(today, -DAILY_TRAILING_DAYS), endDate: addDaysUTC(today, -1) }
6464
}

services/apps/packages_worker/src/pypi/upsertProject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export async function upsertProject(
2626
project: PyPiProject,
2727
purl: string,
2828
): Promise<{ purl: string; changedFields: string[] }> {
29+
stripNullBytesDeep(project)
2930
const info = project.info
30-
stripNullBytesDeep(info)
3131

3232
const name = info.name
3333
const status = info.yanked ? 'yanked' : 'active'

services/libs/data-access-layer/src/packages/maintainers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { QueryExecutor } from '../queryExecutor'
22

3-
export interface NpmMaintainerInput {
3+
export interface PackageMaintainerInput {
44
username: string
55
displayName: string | null
66
email: string | null
@@ -10,7 +10,7 @@ export interface NpmMaintainerInput {
1010
export async function upsertPackageMaintainers(
1111
qx: QueryExecutor,
1212
packageId: string,
13-
maintainers: NpmMaintainerInput[],
13+
maintainers: PackageMaintainerInput[],
1414
ecosystem = 'npm',
1515
): Promise<string[]> {
1616
const changed = new Set<string>()

0 commit comments

Comments
 (0)