Skip to content

chore: keep 1-minute cron cadence during early operation - #18

Merged
Bonobo791 merged 1 commit into
mainfrom
chore-cron-cadence-docs
Jul 31, 2026
Merged

chore: keep 1-minute cron cadence during early operation#18
Bonobo791 merged 1 commit into
mainfrom
chore-cron-cadence-docs

Conversation

@Bonobo791

Copy link
Copy Markdown
Owner

Makes the every-minute schedule the documented steady state for early single-channel operation (revert note from #17 removed), per maintainer decision. Raises to */15 * * * * when user volume grows.

  • netlify/functions/cron.mjs: comment now describes the intentional cadence
  • netlify/cron.test.mjs: test renamed accordingly
  • AGENTS.md, DEPLOY.md: cadence references synced

Verified: cron suite 8/8, npm run check 0 errors.

Per maintainer decision the every-minute schedule stays until real user
volume arrives (then raise to */15). Removes the 'temporary/revert'
wording from PR #17 and syncs AGENTS.md and DEPLOY.md with the shipped
cadence.
@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2026
@codeant-ai

codeant-ai Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 209d92e Jul 31, 2026 · 00:51 00:53

@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for moderaty ready!

Name Link
🔨 Latest commit 209d92e
🔍 Latest deploy log https://app.netlify.com/projects/moderaty/deploys/6a6bf1ad09a18c0008a369bd
😎 Deploy Preview https://deploy-preview-18--moderaty.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jul 31, 2026
@codeant-ai

codeant-ai Bot commented Jul 31, 2026

Copy link
Copy Markdown

User description

Makes the every-minute schedule the documented steady state for early single-channel operation (revert note from #17 removed), per maintainer decision. Raises to */15 * * * * when user volume grows.

  • netlify/functions/cron.mjs: comment now describes the intentional cadence
  • netlify/cron.test.mjs: test renamed accordingly
  • AGENTS.md, DEPLOY.md: cadence references synced

Verified: cron suite 8/8, npm run check 0 errors.


CodeAnt-AI Description

Keep moderation scans frequent during early operation

What Changed

  • The scheduled moderation run now executes every minute during early single-channel operation
  • Documentation and schedule tests now describe raising the cadence to every 15 minutes when user volume grows
  • Existing behavior remains unchanged for one-channel processing, secure authorization, timeout handling, and failed-run reporting

Impact

✅ Faster moderation scans during early operation
✅ Clearer deployment guidance
✅ Predictable per-channel scan cadence

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@sonarqubecloud

Copy link
Copy Markdown

@codeant-ai

codeant-ai Bot commented Jul 31, 2026

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 209d92e7
Scan Time: 2026-07-31 00:53:32 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues
Antipatterns ✅ PASSED No antipatterns

View Full Results

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR successfully aligns documentation with the maintainer-decided steady state for early operation. The changes are consistent across all files (AGENTS.md, DEPLOY.md, cron function, and tests), correctly describe the 1-minute cadence as intentional rather than temporary, and maintain the documented migration path to */15 * * * * when needed. Tests pass (8/8) and checks are green. No blocking issues found.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 29464a83-6173-4086-af71-24c090b52560

📥 Commits

Reviewing files that changed from the base of the PR and between 85ec429 and 209d92e.

📒 Files selected for processing (4)
  • AGENTS.md
  • DEPLOY.md
  • netlify/cron.test.mjs
  • netlify/functions/cron.mjs

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Updated scheduling documentation to reflect moderation checks running every minute during early operation.
    • Added guidance to consider returning to a 15-minute interval as usage grows.
    • Clarified that the schedule is configurable; functionality remains unchanged.

Walkthrough

The PR updates Netlify moderation cron documentation and test descriptions to state that scheduling runs every minute during early operation, with a planned change to every 15 minutes as usage grows. Runtime behavior and schedule configuration remain unchanged.

Changes

Cron schedule documentation

Layer / File(s) Summary
Update cron cadence documentation
AGENTS.md, DEPLOY.md, netlify/functions/cron.mjs, netlify/cron.test.mjs
Documentation and the scheduled test description now reflect the one-minute early-operation cadence and future */15 * * * * schedule. Endpoint, authorization, and one-channel-per-invocation details remain unchanged.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes retaining the one-minute cron cadence during early operation.
Description check ✅ Passed The description directly explains the documented cron cadence changes, affected files, future schedule, and verification results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore-cron-cadence-docs

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Docs/tests: affirm 1-minute Netlify cron cadence during early operation

📝 Documentation 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Document the intended every-minute Netlify cron cadence for early single-channel operation.
• Remove prior “temporary/debugging” wording and align DEPLOY/AGENTS guidance with shipped behavior.
• Rename the cron schedule test to match the new operational rationale.
Diagram

graph TD
  N{{"Netlify Scheduler"}} --> C["netlify/functions/cron.mjs"] --> A["App /api/cron"] --> M["Moderation run"]
  C --> D["Docs (AGENTS/DEPLOY)"]
  C --> T["Test (cron.test)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Make cadence configurable via env var
  • ➕ Allows changing cadence without code changes/merges
  • ➕ Supports staged rollout (e.g., per-site or per-environment)
  • ➖ Adds configuration surface area and validation needs
  • ➖ Docs must still explain how/when to change the variable
2. Single source of truth in netlify.toml + docs link
  • ➕ Reduces drift between docs and implementation
  • ➕ Keeps cadence visible in deployment config
  • ➖ Requires ensuring the scheduled function is actually defined/owned there
  • ➖ May not match current project conventions for schedule ownership

Recommendation: Keep the PR’s approach: it preserves runtime behavior while clarifying the intended operational steady state and the future scaling step. Consider an env-var cadence only if operators need to change frequency without deploys; otherwise the current explicit config + aligned docs/tests is the lowest-complexity option.

Files changed (4) +14 / -12

Tests (1) +1 / -1
cron.test.mjsRename cron schedule test to match early-operation rationale +1/-1

Rename cron schedule test to match early-operation rationale

• Renames the test description to remove temporary/debugging wording. Keeps the schedule assertion ('* * * * *') unchanged.

netlify/cron.test.mjs

Documentation (3) +13 / -11
AGENTS.mdAlign agent guidance with 1-minute early-operation cadence +2/-1

Align agent guidance with 1-minute early-operation cadence

• Updates the cron trigger description to state every-minute cadence during early single-channel operation. Adds a note to raise to '*/15 * * * *' once user volume grows.

AGENTS.md

DEPLOY.mdUpdate deployment docs to reflect shipped cron schedule +4/-3

Update deployment docs to reflect shipped cron schedule

• Rewords cron documentation to describe the every-minute schedule as the early-operation steady state. Updates the explicit cron expression reference and removes prior 15-minute framing around per-channel cadence.

DEPLOY.md

cron.mjsClarify Scheduled Function comment and schedule intent +7/-7

Clarify Scheduled Function comment and schedule intent

• Rewrites the function header comment to avoid asserting a specific cadence there and points readers to the 'config' note. Replaces the prior temporary/debugging schedule comment with an intentional early-operation explanation and the planned '*/15' scaling step.

netlify/functions/cron.mjs

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0 (≤ 100 complexity)
Duplication 0 (≤ 1 duplication)

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot 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

This PR successfully standardizes the 1-minute cron cadence for early-stage operations by updating documentation and removing 'temporary' or 'debugging' labels from code comments and tests. The configuration in netlify/functions/cron.mjs is correctly set to * * * * *.

Codacy analysis shows the PR is up to standards, with no new issues, complexity increases, or clones detected. Documentation in AGENTS.md and DEPLOY.md has been synchronized with the current implementation, and the path for future scaling to a 15-minute cadence is clearly defined.

Test suggestions

  • Verify that the Netlify function config.schedule is set to '* * * * *'

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 51 rules

Grey Divider


Informational

1. JSDoc uses space indentation 📘 Rule violation ⚙ Maintainability
Description
Modified lines in both the JSDoc comment and a wrapped bullet line use leading spaces for
indentation instead of tabs, violating the project’s tabs-only indentation requirement. This can
lead to inconsistent formatting and unnecessary diff churn under strict whitespace enforcement.
Code

netlify/functions/cron.mjs[R20-22]

+ * Netlify Scheduled Function: triggers one bounded moderation run by
+ * calling the app's cron endpoint on the deployed site (see the schedule
+ * note at `config` below). The secret travels in an Authorization
Relevance

● Weak

Very similar tabs-vs-spaces wrapped-line fixes in Markdown/docs were explicitly rejected before.

PR-#11
PR-#14

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2401137 mandates tabs-only indentation, but the cited changed lines show
space-based indentation on modified content: netlify/functions/cron.mjs[20-22] has JSDoc lines
that begin with a space before the *, and DEPLOY.md[64] contains a wrapped bullet line with
leading spaces (e.g.,   one channel...), directly demonstrating noncompliance.

Rule 2401137: Use tabs for indentation, never spaces
netlify/functions/cron.mjs[20-22]
DEPLOY.md[64-64]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Modified lines in this PR are indented with spaces rather than tabs, including JSDoc lines that start with a leading space before `*` and a wrapped bullet line with leading spaces. Update these modified lines to use tabs for indentation to comply with the repository’s tabs-only whitespace policy.

## Issue Context
PR Compliance ID 2401137 requires tabs (not spaces) for indentation, and these are changed lines in the PR (including comment formatting and wrapped text under a bullet), so they are in scope for enforcement.

## Fix Focus Areas
- netlify/functions/cron.mjs[20-22]
- DEPLOY.md[64-64]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

@Bonobo791
Bonobo791 merged commit 215c3ad into main Jul 31, 2026
15 of 16 checks passed
@Bonobo791
Bonobo791 deleted the chore-cron-cadence-docs branch July 31, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant