Skip to content

Prevent duplicate Discord digest posts#1994

Merged
merill merged 1 commit into
mainfrom
agent/fix-discord-digest-duplicates
Jul 25, 2026
Merged

Prevent duplicate Discord digest posts#1994
merill merged 1 commit into
mainfrom
agent/fix-discord-digest-duplicates

Conversation

@merill

@merill merill commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • prevent delayed inactive UTC cron runs from posting duplicate daily Discord digests
  • pass the triggering cron expression into the digest script
  • choose the active cron from the current Australia/Melbourne UTC offset, so AEST uses 23:00 UTC and AEDT uses 22:00 UTC

Why

GitHub scheduled workflows can start late. The workflow runs at both 22:00 and 23:00 UTC to handle Melbourne daylight saving, but the script only checked whether the actual runtime hour was 9am in Melbourne. In AEST, the 22:00 UTC run can be delayed into the 9am hour and post, then the 23:00 UTC run posts again.

Validation

  • node --check .github/scripts/discord-codebase-digest.mjs
  • simulated delayed AEST inactive cron at 9:53am Melbourne and verified it skips
  • simulated delayed AEDT inactive cron at 9:53am Melbourne and verified it skips
  • verified non-scheduled/manual behavior still skips outside 9am unless forced

Summary by CodeRabbit

  • Bug Fixes
    • Improved daily digest scheduling to respect the configured trigger schedule.
    • Added handling for Melbourne daylight-saving time changes to ensure digests run on the correct local day and time.
    • Prevented manually triggered runs from being incorrectly skipped due to schedule checks.

@merill
merill requested a review from a team as a code owner July 25, 2026 03:37
@coderabbitai

coderabbitai Bot commented Jul 25, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c42ced04-b5a6-4df3-a407-078dc7bcbe80

📥 Commits

Reviewing files that changed from the base of the PR and between 463b40d and 5a1ad37.

📒 Files selected for processing (2)
  • .github/scripts/discord-codebase-digest.mjs
  • .github/workflows/discord-codebase-digest.yml

📝 Walkthrough

Walkthrough

The daily digest workflow now passes its scheduled cron expression to the digest script. The script uses Melbourne’s UTC offset and expected cron schedule to determine whether the daily post should run.

Changes

Digest schedule gating

Layer / File(s) Summary
Trigger schedule input and workflow wiring
.github/scripts/discord-codebase-digest.mjs, .github/workflows/discord-codebase-digest.yml
The script reads DIGEST_TRIGGER_SCHEDULE, while scheduled workflow runs populate it from github.event.schedule and other runs use an empty value.
Daily eligibility evaluation
.github/scripts/discord-codebase-digest.mjs
runDailyDigest uses dailyPostSkipReason; schedule validation compares against Melbourne’s expected daily cron schedule and falls back to the 9am local-time check when needed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: preventing duplicate Discord digest posts.
Description check ✅ Passed The description explains the change, motivation, and validation, though it does not fill the template's issue and checklist sections.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-discord-digest-duplicates

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.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying maester with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5a1ad37
Status: ✅  Deploy successful!
Preview URL: https://0d1b5695.maester.pages.dev
Branch Preview URL: https://agent-fix-discord-digest-dup.maester.pages.dev

View logs

@merill
merill merged commit 74608e4 into main Jul 25, 2026
9 checks passed
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