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

task schedule: fix end-of-month validation bug #23329

Merged
merged 4 commits into from
Jun 14, 2024
Merged

Conversation

gulducat
Copy link
Member

@gulducat gulducat commented Jun 14, 2024

Fix erroneous "end cannot be sooner than start" error condition on the last day of the month.

By building "next end from from" instead of "next end from next start" (we actually use the latter for the schedule), on the last day of any given month, the next start.Day() would be 1 (the first of the next month), which is less than the current end.Day() -- whatever the last day of the month is, 28-31 -- so it would mistakenly think the user provided improper values. (I'm sorry, this is really hard to put into plain language... hopefully the code makes sense.)

I happened to be starting some e2e testing (not present in this PR) at the end of May and bumped into this, so formalize with a unit test case, and also include Fuzz testing to try and catch other possible unforeseen gotchas (I got it to catch this one, but fortunately(?) it did not foresee any more).

Fixes #23159

@gulducat gulducat requested review from schmichael and jrasell June 14, 2024 15:37
@gulducat gulducat added backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/1.8.x backport to 1.8.x release line labels Jun 14, 2024
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @gulducat!

Copy link

github-actions bot commented Jan 3, 2025

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/1.8.x backport to 1.8.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

valid task schedule fails validation on the last day of the month
2 participants