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
Fixes #14684 - Save end time for recurring #172
Conversation
adamruzicka
commented
Apr 19, 2016
•
edited
edited
- Requires Refs #14684 - Triggering validation foreman-tasks#183
It does not seem to work for me, when I set end time, the action results in 200 but it redirects me back to the invocation form without any error. Also it creates the job, it creates recurring action but it does not create the task so the job is queued forever. I don't see any error in the log. |
After short debugging session we realized that if there's no window for job to start, task is not created causing all of this problems. So a validation should be added that checks that $start_time < $end_time |
[test] |
@@ -304,7 +311,8 @@ def trigger! | |||
end | |||
|
|||
def valid? | |||
targeting.valid? & job_invocation.valid? & !pattern_template_invocations.map(&:valid?).include?(false) | |||
targeting.valid? & job_invocation.valid? & !pattern_template_invocations.map(&:valid?).include?(false) & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you're already touching this line, would you mind changing
!pattern_template_invocations.map(&:valid?).include?(false)
to
pattern_template_invocations.all?(&:valid?)
Tested manually and works fine, except one possible improvement in code this patch touches it's good to merge. Well after we have tests fixed and jenkins will confirm. |
Wasn't there a specific need for doing it this way? Something like it was needed to force validation of all of the template invocations (which the all? approach wouldn't do)? |
ah right, |
Great, glad we didn't miss it |
Foreman-tasks 0.7.17 with required change was just released |
Let's see how the [test] goes |
[test] |
1 similar comment
[test] |
0a242ed
to
2ee95a1
Compare
Works fine, thanks @adamruzicka, merging! |
oops I left double comment in commit message, sorry :-) |
Fixes #13641 - fix the ordering of the tasks menu items