Skip to content

Enforce newsletter sync interval floor#344

Merged
michaelmwu merged 2 commits into
mainfrom
michaelmwu/enforce-newsletter-sync-interval-min
Jun 26, 2026
Merged

Enforce newsletter sync interval floor#344
michaelmwu merged 2 commits into
mainfrom
michaelmwu/enforce-newsletter-sync-interval-min

Conversation

@michaelmwu

Copy link
Copy Markdown
Member

Summary

  • enforce the dashboard/runtime-config 60-second minimum in shared settings parsing
  • keep the newsletter scheduler and idempotency bucket helper defensively clamped to the same 60-second floor
  • add unit coverage for settings validation and idempotency bucket clamping

Tests

  • ./scripts/lint.sh
  • uv run pytest tests/unit/test_shared_settings.py tests/unit/test_backend_api.py -q
  • uv run pytest tests/ -q
  • bun run test (apps/admin_dashboard)

Note: one full ./scripts/test.sh rerun exited with code 133 after a long verbose pytest stream and no failure output; rerunning the Python suite quietly plus the dashboard test command passed.

Addresses follow-up feedback from #332 (comment)

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@michaelmwu, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 57 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9e1d01ce-0738-486f-8971-f04f874d0520

📥 Commits

Reviewing files that changed from the base of the PR and between 7a557a3 and dc422b1.

📒 Files selected for processing (5)
  • apps/api/src/five08/backend/api.py
  • packages/shared/src/five08/settings.py
  • tests/integration/test_dashboard_playwright.py
  • tests/unit/test_backend_api.py
  • tests/unit/test_shared_settings.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch michaelmwu/enforce-newsletter-sync-interval-min

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

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enforces a consistent 60-second minimum (“floor”) for the 508 members newsletter sync interval across shared settings validation and the backend API scheduler/idempotency bucketing, aligning runtime behavior with the dashboard runtime-config constraints.

Changes:

  • Add Pydantic validation (ge=60) to SharedSettings.newsletter_sync_interval_seconds.
  • Clamp API scheduler and idempotency-bucket interval handling to a 60-second minimum.
  • Add unit tests covering settings validation and idempotency bucket clamping behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/shared/src/five08/settings.py Enforces a 60s minimum at settings-parse time via Field(..., ge=60).
apps/api/src/five08/backend/api.py Clamps scheduler interval and idempotency bucket interval to a 60s floor.
tests/unit/test_shared_settings.py Adds validation coverage ensuring values below 60s are rejected.
tests/unit/test_backend_api.py Adds coverage ensuring idempotency bucketing clamps to the 60s floor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@michaelmwu michaelmwu merged commit ebffd98 into main Jun 26, 2026
11 checks passed
@michaelmwu michaelmwu deleted the michaelmwu/enforce-newsletter-sync-interval-min branch June 26, 2026 07:38
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.

2 participants