Skip to content

[CLAUDE] Stop cron-tracking the auto-merge sweep and debounce sub-hourly monitors (AFC-626) - #553

Merged
jaywedgeworth22 merged 8 commits into
mainfrom
claude/AFC-626-cron-monitor-margins
Nov 25, 2026
Merged

jaywedgeworth22 merged 8 commits into
mainfrom
claude/AFC-626-cron-monitor-margins

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Part of AFC-626.
This mirrors BotFleet PR #2209.

Stops Sentry Crons tracking for the Auto-merge PRs sweep (AFC-626). Removes it from CRON_SCHEDULES and CHECKIN_MARGIN_OVERRIDES, adds it to new UNMONITORED_SCHEDULES, and makes resolve_cron_expr() skip both requested and completed check-ins quietly with no unmapped-schedule drift event. Failed sweep runs still emit the normal CI failure error event, which is unverified in production. Adds flap debouncing for iOS TestFlight ship (GitHub-hosted macOS) requiring 3 consecutive failures/misses before opening an issue and 1 success to recover. Adds stdlib-only self-tests in scripts/sentry_ci_report_test.py covering mapping completeness, skipped sweep check-ins, preserved failure events, unmapped-schedule drift, and monitor thresholds; test execution results were not reported. Open review risks: unmonitored schedules lack a stale-key drift guard, and schedule comparison may be case-sensitive and break case-only renames.


Summary

Related to AFC-626. Extends the cron schedule drift guard in scripts/sentry-ci-report.py to cover unmonitored and duplicated monitor names.

Changes

  • find_cron_schedule_drift() now checks both CRON_SCHEDULES and UNMONITORED_SCHEDULES against live workflow name: values, case-insensitively. A stale UNMONITORED_SCHEDULES entry is now reported as drift since it exempts nothing while the renamed workflow would raise unmapped-schedule drift.
  • Names listed in both maps are now reported as drift, including both spellings when casing differs, since UNMONITORED_SCHEDULES wins and the cron entry would silently never check in.
  • Updated the ::error:: message and stale-cron-key Sentry event to report stale or duplicated CRON_SCHEDULES / UNMONITORED_SCHEDULES names. Operational impact is config-drift visibility only: stale or duplicated entries now surface as CI errors and Sentry config-drift events instead of being silent.

Tests

  • Added ConfigDriftTests covering stale unmonitored entries, case-insensitive matching, both-maps duplication, and the stale-key event path. Updated run_reporter helper and scheduled-workflow mapping test for case-folded comparison. Tests are added in scripts/sentry_ci_report_test.py; no test run results, deployment, or runtime verification are reported here. Automated code review reported no issues in the reviewed changes.

@linear-code

linear-code Bot commented Nov 25, 2026

Copy link
Copy Markdown

AFC-626

@kody-ai

This comment has been minimized.

Comment thread scripts/sentry-ci-report.py Resolved
Comment thread scripts/sentry_ci_report_test.py Resolved
@kody-ai

kody-ai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Automatic approval held

Kody's assessment:

Risk was identified in this PR.

find_cron_schedule_drift also flags UNMONITORED_SCHEDULES names that match
no workflow, reported as a stale cron key, so a renamed sweep cannot leave
a silent exemption behind.  Mirrors the review fix on HogHunter#397 and
ContactLogo#349.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kody-ai

This comment has been minimized.

The mapped-or-unmonitored test compares names case-folded, like
production.  run_reporter stubs the live drift scan unless a workflow set
is passed.  New tests cover a stale unmonitored name raising the
stale-cron-key event, matched case-insensitively.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread scripts/sentry-ci-report.py Resolved
swu-claude Bot and others added 2 commits November 25, 2026 03:58
A name in both CRON_SCHEDULES and UNMONITORED_SCHEDULES never checks in,
because resolve_cron_expr() checks the unmonitored list first.
find_cron_schedule_drift now returns it too, so it raises the same
stale-cron-key drift event.  Mirrors the Kody finding on HogHunter#397.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mapped-or-unmonitored test now compares CRON_SCHEDULES keys
case-folded on both sides, like resolve_cron_expr().  Adds a test that a
name in both maps is reported as drift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kody-ai

This comment has been minimized.

The overlap check now compares case-folded names on both sides, so a
CRON_SCHEDULES key and an UNMONITORED_SCHEDULES name that differ only by
case are both returned as drift instead of hiding the unmonitored one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kody-ai

This comment has been minimized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jaywedgeworth22
jaywedgeworth22 marked this pull request as ready for review November 25, 2026 05:54
@jaywedgeworth22
jaywedgeworth22 merged commit 122ddc6 into main Nov 25, 2026
10 of 11 checks passed
@kody-ai

kody-ai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

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