Skip to content

Add fluent schedule and cron expression builder#39

Merged
gonace merged 12 commits intomasterfrom
claude/schedule-cron-expression-builder
Mar 29, 2026
Merged

Add fluent schedule and cron expression builder#39
gonace merged 12 commits intomasterfrom
claude/schedule-cron-expression-builder

Conversation

@gonace
Copy link
Copy Markdown
Owner

@gonace gonace commented Mar 29, 2026

Implement a Schedule builder with two modes:

  • Interval expressions: Schedule.Every(5).Minutes
  • Cron expressions: Schedule.Cron.Daily(hour: 3) and Schedule.Cron.Create() for custom field-by-field building

claude and others added 12 commits March 29, 2026 06:09
Implement a Schedule builder with two modes:
- Interval expressions: Schedule.Every(5).Minutes
- Cron expressions: Schedule.Cron.Daily(hour: 3) and
  Schedule.Cron.Create() for custom field-by-field building

https://claude.ai/code/session_01XFQ49AHWaNZH3pyffR78LN
- Move each public class into its own file under Constants/Scheduling/
  to fix CS-R1035 (multiple public classes in single file)
- Add ScheduleExpression wrapper type with JSON converter and implicit
  string conversions, following the same pattern as AssertionRule
- Change Monitor.Schedule from string to ScheduleExpression
- Update Heartbeat constructor to accept ScheduleExpression
- Update all test builders and request tests accordingly

https://claude.ai/code/session_01XFQ49AHWaNZH3pyffR78LN
Parameter order is dictated by the JsonConverter<T> base class override.

https://claude.ai/code/session_01XFQ49AHWaNZH3pyffR78LN
- Replace C# 8.0 pattern matching with null check for netstandard2.0
- Fully qualify Schedule reference in JobBuilder to avoid clash with
  method of the same name
- Add missing using Cronitor.Models for Request in MonitorTypeTests

https://claude.ai/code/session_01XFQ49AHWaNZH3pyffR78LN
CS-R1138 is a third-party analyzer rule, not a compiler warning.
Pragma directives only work with compiler warnings. The parameter
order is dictated by the JsonConverter<T> base class and cannot
be changed.

https://claude.ai/code/session_01XFQ49AHWaNZH3pyffR78LN
The Schedule() method shadowed the Schedule static class import,
preventing the field initializer from resolving. Fully qualifying
also failed because the Cronitor static class shadows the namespace.

https://claude.ai/code/session_01XFQ49AHWaNZH3pyffR78LN
Anonymous types have read-only properties, which the Serializer skips
due to IgnoreReadOnlyProperties = true. Use ScheduleContainer instead.

https://claude.ai/code/session_01XFQ49AHWaNZH3pyffR78LN
@gonace gonace merged commit 8030ecc into master Mar 29, 2026
3 checks passed
@gonace gonace deleted the claude/schedule-cron-expression-builder branch March 29, 2026 07:02
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