Skip to content
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

Convert age matcher to use a duration config #159

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

himynameisdave
Copy link
Contributor

@himynameisdave himynameisdave commented Nov 19, 2024

Adds the ability to specify ranges for the age matcher. Same as the last-modified matcher, this makes use of the same DurationConfig struct. Maintains support for the previous string matcher (ie: age: 8d), but removes references to it in the documentation and marks it as "deprecated" (so that if we wanted to clean stuff up on the next major version bump, we could remove this).

# Before:
  - age: 7d

# After:
  - age:
    at-least: 7d

Closes #158

Marks the old `age: 2d` option as deprecated but keeps it for backward compatability
@himynameisdave himynameisdave changed the title Mutually exclusive age labels Convert age matcher to use a duration config Nov 19, 2024
@srvaroa
Copy link
Owner

srvaroa commented Nov 20, 2024

Thanks for this one! It looks like having both use age in the yaml confuses the parser. With this change it works correctly.

image

I think it's fine to keep Age deprecated and offer the range with AgeRange to avoid doing contorsions with the parsing. Otherwise looks ok for me, thanks a lot of taking this one.

@himynameisdave
Copy link
Contributor Author

@srvaroa should we continue to document the Age in the readme?

@srvaroa
Copy link
Owner

srvaroa commented Nov 20, 2024

@himynameisdave i think we can remove it unless you see a strong reason not to

@himynameisdave
Copy link
Contributor Author

yeap I'd prefer to remove!

@himynameisdave
Copy link
Contributor Author

@srvaroa ready for review / please run the tests!

Copy link
Owner

@srvaroa srvaroa left a comment

Choose a reason for hiding this comment

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

Thanks for the feature!

@srvaroa srvaroa merged commit fe4b1c7 into srvaroa:master Nov 22, 2024
4 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.

Apply mutally exclusive Age labels
2 participants