Skip to content

[claude-hackernews] Drop working-hours gate from hourly cron#9

Merged
NiveditJain merged 1 commit into
mainfrom
drop-working-hours-gate
May 1, 2026
Merged

[claude-hackernews] Drop working-hours gate from hourly cron#9
NiveditJain merged 1 commit into
mainfrom
drop-working-hours-gate

Conversation

@NiveditJain
Copy link
Copy Markdown
Member

@NiveditJain NiveditJain commented May 1, 2026

Summary

  • Removes the 09:00-21:00 local working-hours gate from scripts/hourly_hackernews_cron.py so the cron runs on every firing.
  • Drops the now-unused _within_working_hours(), WORK_HOURS_START/END constants (and their CRON_* env overrides), the gray "skip" Discord lifecycle level, and matching docstring / README references.
  • Random pre-run sleep (_random_wait_seconds) stays in place — it's HH:00:00 jitter, not a run gate.

Test plan

  • python3 -m py_compile scripts/hourly_hackernews_cron.py (already verified locally)
  • CRON_FORCE=1 python3 scripts/hourly_hackernews_cron.py smoke test still works (CRON_FORCE now bypasses only the pre-run sleep)
  • Next hourly cron firing produces a start Discord embed regardless of local hour

Summary by CodeRabbit

  • Documentation & Chores
    • Cron job now executes at all times (removed working-hours scheduling restrictions).
    • Discord webhook notifications updated: replaced "skip" event with "noop" event while keeping "start," "ok," and "fail" events.
    • Documentation updated to reflect new execution behavior.

Per ops request: the script should run on every cron firing, with no
calendar-hour gating. Removes _within_working_hours(), the
WORK_HOURS_START/END constants and their CRON_* env overrides, the
gray "skip" Discord lifecycle event, and the related docstring/README
references. Random pre-run sleep stays in place -- it's jitter for
HH:00:00 alignment, not a run gate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 733eac86-d8eb-49d4-b86f-b0be6cae2fc6

📥 Commits

Reviewing files that changed from the base of the PR and between 689cfa6 and 569e062.

📒 Files selected for processing (2)
  • README.md
  • scripts/hourly_hackernews_cron.py

📝 Walkthrough

Walkthrough

The cron job script no longer gates execution based on working hours. The script now always runs on each cron firing with only an optional pre-run sleep bypass via CRON_FORCE. The Discord webhook lifecycle events change from "skip/start/ok/fail" to "start/ok/noop/fail". Documentation is updated to reflect this behavior.

Changes

Cohort / File(s) Summary
Documentation
README.md
Updated cron job documentation to reflect that execution always runs on each firing (no working-hours gating) and clarified lifecycle event types sent to Discord webhook (replaced "skip" with "noop").
Cron Script
scripts/hourly_hackernews_cron.py
Removed working-hours early-exit logic, environment variable overrides, helper function, and Discord "skip" event handling. Script now always proceeds to pre-run sleep (unless CRON_FORCE set) and uses "noop" event instead of "skip" in lifecycle messaging.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 No more gates of time,
The script runs sublime,
Always fired with care,
Noop events share,
A simpler climb! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drop-working-hours-gate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@NiveditJain NiveditJain merged commit 4e2282d into main May 1, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant