Skip to content

Commit

Permalink
Give the waive dialog more context.
Browse files Browse the repository at this point in the history
This should fix the UI in a couple places:

- fixes fedora-infra#2363
- fixes fedora-infra#2270

There, it claims that only one failing result is waived, but a read through the
method in `models.py` suggests that *all* unsatisfied requirements are
currently waived.

Signed-off-by: Ralph Bean <[email protected]>
  • Loading branch information
ralphbean committed Jun 13, 2018
1 parent 92d873f commit fae8957
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bodhi/server/services/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def new_update(request):
error_handler=bodhi.server.services.errors.json_handler)
def waive_test_results(request):
"""
Waive test results on a given update when gating is on.
Waive all blocking test results on a given update when gating is on.
Args:
request (pyramid.request): The current request.
Expand Down
20 changes: 14 additions & 6 deletions bodhi/server/templates/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
var missing_tests = {};

// handle Greenwave decision

// Handle unstatisfied requirements
var handle_unsatisfied_reqs = function(data){
$.each(data['unsatisfied_requirements'], function(i, req) {
if (req.type == 'test-result-missing') {
Expand All @@ -68,6 +66,7 @@
if ($.inArray(req.testcase, requirements) == -1) {
requirements.push(req.testcase);
}
$('#failed_requirements').append('<li class="list-group-item">' + req.item + '</li>');
});
};

Expand Down Expand Up @@ -1118,17 +1117,26 @@ <h3>Test Cases</h3>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title" id="waiveModalLabel">Waive Test Results</h3>
<h3 class="modal-title" id="waiveModalLabel">Waive All Test Results</h3>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<textarea class="form-control" id="waive_comment" name="waive_comment"></textarea>
<div class="row">
<div class="col-sm-offset-2 col-sm-10">
<p>Submitting this will waive the following test results blocking this update:</p>
<ul id="failed_requirements" class="list-group list-group-flush"></ul>
</div>
</div>
<div class="form-group row">
<label for="waive_comment" class="col-sm-2 col-form-label">Comment</label>
<div class="col-sm-10">
<textarea class="form-control" id="waive_comment" name="waive_comment" placeholder="A reason for the waiver..." required></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Waive Test Results</button>
<button type="submit" class="btn btn-primary">Waive</button>
</div>
</div>
</form>
Expand Down

0 comments on commit fae8957

Please sign in to comment.