-
-
Notifications
You must be signed in to change notification settings - Fork 346
Add /eval/<id>/errors REST endpoint #1583
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
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 |
|---|---|---|
|
|
@@ -95,9 +95,24 @@ sub errors_GET { | |
|
|
||
| $c->stash->{template} = 'eval-error.tt'; | ||
|
|
||
| $c->stash->{eval} = $c->model('DB::JobsetEvals')->find($c->stash->{eval}->id, { prefetch => 'evaluationerror' }); | ||
| my $eval = $c->model('DB::JobsetEvals')->find( | ||
| $c->stash->{eval}->id, | ||
| { prefetch => 'evaluationerror' } | ||
| ); | ||
|
|
||
| $c->stash->{eval} = $eval; | ||
|
|
||
| my $error_obj = $eval->evaluationerror; | ||
|
kmein marked this conversation as resolved.
|
||
| my $err_str = $error_obj ? $error_obj->errormsg : ''; | ||
|
kmein marked this conversation as resolved.
|
||
| my $has_error = ($err_str ne '') ? \1 : \0; | ||
|
Comment on lines
+106
to
+107
Member
Author
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. Nope: |
||
|
|
||
| my $response = { | ||
| id => $eval->id, | ||
| has_error => $has_error, | ||
| errormsg => $err_str, | ||
|
kmein marked this conversation as resolved.
|
||
| }; | ||
|
Comment on lines
+107
to
+113
Member
Author
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'm not doing
Comment on lines
+109
to
+113
Member
Author
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. Previously, the JSON API of this endpoint was not specified at all in the OpenAPI schema. (Of course, this does not mean it wasn't relied upon, though it's unlikely given that it did exactly the same thing as the normal JobsetEval endpoint without |
||
|
|
||
| $self->status_ok($c, entity => $c->stash->{eval}); | ||
| $self->status_ok($c, entity => $response); | ||
| } | ||
|
|
||
| sub create_jobset : Chained('evalChain') PathPart('create-jobset') Args(0) { | ||
|
|
||
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.
This works as well, at least if you re-add
But I would like to see a human opinion on this matter. I don't know enough Perl to trust a clanker with it.