Skip to content

fix: resolve unsafe nightly backfill window from invalid env values#213

Open
RealDiligent wants to merge 1 commit into
entrius:testfrom
RealDiligent:fix/critical-issue-backfill-env-validation
Open

fix: resolve unsafe nightly backfill window from invalid env values#213
RealDiligent wants to merge 1 commit into
entrius:testfrom
RealDiligent:fix/critical-issue-backfill-env-validation

Conversation

@RealDiligent

Copy link
Copy Markdown

Root cause

RepoBackfillScheduleService parsed NIGHTLY_BACKFILL_DAYS with raw Number(...) and used it directly for nightly backfill jobs. Invalid/non-finite or out-of-range values could cause excessive or malformed backfill windows and unnecessary load across GitHub API, queue workers, and DB.

Fix approach

  • Added bounded parsing for NIGHTLY_BACKFILL_DAYS with finite checks and integer normalization.
  • Enforced safe range (1..365) with fallback to DEFAULT_BACKFILL_DAYS.
  • Added startup warning when fallback is used.
  • Used validated value consistently for logs and queued nightly backfill jobs.

Impact

  • Prevents unsafe nightly backfill windows caused by env misconfiguration.
  • Preserves existing behavior for valid configurations.

Risk / tradeoffs

  • Invalid/out-of-range env values now fall back to defaults instead of being accepted.

Made with Cursor

@RealDiligent

Copy link
Copy Markdown
Author

CI workflows are in \�ction_required\ because this PR comes from a fork and needs maintainer approval to run.\n\nLocal validation is already green:\n- npm run lint\n- npm run build\n- npm test\n\nAfter workflow approval, checks should execute normally.

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jul 8, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant