Skip to content

feat: remove parser interface and return default structs for parser and schedule#51

Merged
janrnc merged 2 commits into
gdgvda:masterfrom
janrnc:feat/remove-parser-interface-return-structs
Apr 22, 2026
Merged

feat: remove parser interface and return default structs for parser and schedule#51
janrnc merged 2 commits into
gdgvda:masterfrom
janrnc:feat/remove-parser-interface-return-structs

Conversation

@janrnc

@janrnc janrnc commented Apr 18, 2026

Copy link
Copy Markdown
Member

Refactor the core API to improve decoupling between schedule parsing and job execution by replacing the Parser interface with concrete structs and restructuring the schedule-related code.

Changes

  • Refactor Core API:
    • Remove cron.Add(spec, cmd) method; require all jobs use cron.Schedule(schedule, cmd).
    • Replace Parser interface with concrete DefaultParser struct.
    • Expose DefaultParser and DefaultSchedule as public types.
    • Update NewDefaultParser to return (*DefaultParser, error).
    • Remove WithParser and WithSeconds configuration options.
  • Restructure Schedule Code:
    • Rename spec.go to schedule.go and spec_test.go to schedule_test.go.
    • Move Schedule interface from cron.go to schedule.go.
  • Documentation & Testing:
    • Update documentation and all existing tests to reflect the new workflow of parsing schedules independently before adding them to the scheduler.

See #49

@codecov

codecov Bot commented Apr 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.64%. Comparing base (c214790) to head (4330c4c).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
parser.go 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
- Coverage   95.22%   94.64%   -0.59%     
==========================================
  Files          18       18              
  Lines         901     1083     +182     
==========================================
+ Hits          858     1025     +167     
- Misses         30       45      +15     
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@janrnc janrnc changed the title feat: remove parser interface and return default structs for parser and scheduler feat: remove parser interface and return default structs for parser and schedule Apr 18, 2026
@janrnc janrnc force-pushed the feat/remove-parser-interface-return-structs branch from 78b7a3e to bcb7960 Compare April 19, 2026 10:51
@janrnc janrnc marked this pull request as ready for review April 22, 2026 18:05
@janrnc janrnc merged commit a84ff6c into gdgvda:master Apr 22, 2026
6 of 7 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant