Skip to content

chore(deps): Bump croner from 2.2.0 to 3.0.0 #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 14, 2025

Bumps croner from 2.2.0 to 3.0.0.

Release notes

Sourced from croner's releases.

v3.0.0

Croner 3.0 Release Notes

Version 3.0 is a significant release, introducing powerful new features, major API enhancements for improved safety and flexibility, and important bug fixes.

Major New Features

  • Reverse Lookup: You can now search for previous occurrences of a cron pattern. The new find_previous_occurrence() method and iter_before() iterator allow for iterating backwards in time from a given point.
  • Flexible Parser Configuration with Builder Pattern: The CronParser has been enhanced with a builder pattern (CronParser::builder()) for a more type-safe and explicit configuration. This allows you to precisely control:
    • How the seconds field is handled (Optional, Required, Disallowed).
    • Whether the year field is supported (Optional, Required, Disallowed).
    • The logical combination of Day-of-Month and Day-of-Week fields (dom_and_dow).
    • Support for forcing alternative (Quartz-style) weekdays.
  • Logical AND for Day-of-Month and Day-of-Week with + modifier: Introduced the + prefix in the day-of-week field (e.g., 0 0 1 * +MON) to explicitly enforce a logical AND relationship between the day-of-month and day-of-week conditions, overriding the default OR behavior.
  • EXPERIMENTAL Human-Readable Descriptions: Croner can now generate human-readable, English descriptions for any cron pattern using the new .describe() method. This feature is also extensible with internationalization support, demonstrated with an initial Swedish translation.

Enhancements

  • Common Trait Implementation: Cron and CronPattern now implement common traits including Eq, PartialEq, Ord, PartialOrd, and Hash. This allows Cron instances to be reliably compared, sorted, and used in hash-based collections like HashMap.
  • Robust Whitespace Parsing: The parser is now more robust and correctly handles leading, trailing, and mixed whitespace separators in cron patterns.
  • Improved DST Handling: Fixed an issue where fixed-time jobs scheduled within a Daylight Saving Time (DST) spring forward gap would incorrectly skip to the next day. These jobs now execute immediately at the first valid time following the gap on the same calendar day, aligning with the OCPS and Vixie-cron behavior.
  • Improved Specification Conformance: This release improves conformance with the draft Open Cron Pattern Specification (OCPS). This includes better handling of 5, 6, and 7-field patterns and special characters like L, #, and W. Validation logic has been refined to ensure that the ? wildcard is only permitted in the day-of-month and day-of-week fields, improving pattern integrity.

Bug Fixes

  • Constrained Closest Weekday (W): The W modifier is now correctly constrained within the given month. The search for the closest weekday will no longer incorrectly cross into a previous or subsequent month.

Migrating to the New Parser Configuration

From this version on, the initialization of Cron instances has been updated to use a flexible builder pattern, which is more idiomatic to Rust, and provides greater control and type safety.

Previous Method (Before v3.0)

Previously, Cron was typically initialized directly from a string, which used a default parser configuration:

    // Parse cron expression
    let cron_all = Cron::new("18 * * * 5")
      // <options>
      .parse()
      .expect("Couldn't parse cron string");

New Recommended Method (v3.0 and later)

For v3.0 and later, there are two primary ways to construct a Cron object, depending on your needs.

  1. Directly, using default settings: For simple cases that do not require special configuration, the Cron::from_str() method is the most convenient option.

... (truncated)

Commits
  • 6e7b30d Update README
  • cbf9ce4 Bump version
  • 602d877 Feature/separate interval vs fixed jobs (#33)
  • 05b94f7 Implement plus-modifier for full OCPS-conformance. (#32)
  • 5820e63 Fix year search (#31)
  • 0e78d79 Merge pull request #30 from Hexagon/fix/ensure-7-fields-years-required
  • 7fbd4d4 Ensure 7 fields when years are required
  • f2aec12 Merge pull request #27 from Hexagon/feature/ocps-1.4-compliance
  • caf7993 Add --all-features to development docs. Fix serde test.
  • f32a8e6 Merge pull request #28 from Hexagon/docs/readme
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [croner](https://github.com/hexagon/croner-rust) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/hexagon/croner-rust/releases)
- [Commits](Hexagon/croner-rust@v2.2.0...v3.0.0)

---
updated-dependencies:
- dependency-name: croner
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Jul 14, 2025
Copy link
Member

@notheotherben notheotherben left a comment

Choose a reason for hiding this comment

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

This PR has been automatically approved because it was created by @dependabot.

@notheotherben notheotherben enabled auto-merge July 14, 2025 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant