-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add option to restart jobs upon comment submission #5946
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -231,10 +231,17 @@ | |||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||||||
</div> | ||||||
<div id="add-comments-controls"> | ||||||
<button type="submit" class="btn btn-danger"> | ||||||
<i class="fa fa-comment"></i> Submit comment on all <%= scalar @$job_ids %> jobs | ||||||
</button> | ||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Discard</button> | ||||||
<div class="form-check my-1"> | ||||||
<input class="form-check-input" | ||||||
type="checkbox" value="" id="restartRequestedCheck"> | ||||||
<label class="form-check-label" for="restartRequestedCheck"> | ||||||
Restart on Submit | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can I avoid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the "also" as necessary to make it clear that the checkbox wouldn't "restart instead of commenting" but "restart and comment". But after the discussion we just had I suggest to actually have two buttons:
|
||||||
</label> | ||||||
</div> | ||||||
<button type="submit" class="btn btn-danger"> | ||||||
<i class="fa fa-comment"></i> Submit comment on all <%= scalar @$job_ids %> jobs | ||||||
</button> | ||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Discard</button> | ||||||
</div> | ||||||
</div> | ||||||
</form> | ||||||
|
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.
The
_restart
method already supports multiple jobs as parameters.The documentation for the
/restart
route says "Restart job(s)."Calling this for every single job and validating the same request parameters again and again is not necessary.
Also you are passing something in
%args
but you never read that in the function.And there is already one function that restarts one job, that could also be called, instead of calling the whole
_restart
thing: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.
@Martchus and that's actually also what I meant earlier today:
_restart
is a complete endpoint:making a helper that implements a complete endpoint, doesn't make much sense to me.