[11.x] Fix attribute inheritance for nested scheduled groups #53626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves a bug in which the attributes of the parent schedule group were not applied to the nested group's events. @rcerljenko reported the issue in #53608.
Example of unexpected behavior:
P.S.
While debugging, I encountered two behaviors that I’m unsure how to handle, and I’d appreciate feedback.
Behavior One
Both examples below throw fatal exceptions because no
PendingEventAttribute
is set before creating a group.What should be done, as I think groups should not be created without common attributes?
group
method to thePendingEventAttribute
class to prevent callingSchedule::group
directlyBehavior Two
The frequency of the second event becomes this:
The
hourly()
method with the group'sdaily()
results in a cron expression like0 0 * * *
, whereas the expected expression is0 * * * *
.Again what should be done when modifying group events?
* * * * *
so that thehourly()
generates correct frequency@stevebauman @rodrigopedra @taylorotwell Tagging you for your valuable input during the initial PR and hoping to get your feedback on this one as well.