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 all job states to be monitored from /tests route #1446
Add all job states to be monitored from /tests route #1446
Conversation
lib/OpenQA/WebAPI/Controller/Test.pm
Outdated
@scheduled = sort { $b->t_created <=> $a->t_created || $b->id <=> $a->id } @scheduled; | ||
# @scheduled = sort { $b->t_created || 'Inf' <=> $a->t_created || 'Inf' || $b->id <=> $a->id } @scheduled; | ||
@scheduled = sort { | ||
if (defined($b->{job}->t_created) && defined($a->{job}->t_created)) { |
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.
I believe that with the last change of moving ASSIGNED to PRE_EXECUTION_STATES fixed the problems I was having, rendering this change useless :) (And same with the other sorts).
7f644a1
to
3316069
Compare
lib/OpenQA/WebAPI/Controller/Test.pm
Outdated
else { | ||
0; | ||
} | ||
} @scheduled; |
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.
Please DRY. You are calling the same code multiple times, please extract method.
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.
It is actually not the same code. I guess it could be extracted so that we end up with something like $b->$time_key <=> $a->$time_key || $b->id <=> $a->id
templates/test/running_table.html.ep
Outdated
@@ -35,7 +35,7 @@ | |||
% my $distri = $job->DISTRI // ''; | |||
% my $version = $job->VERSION // ''; | |||
% my $flavor = $job->FLAVOR // ''; | |||
% my $arch = $job->ARCH // ''; | |||
% my $arch = $job->ARCH // ''; |
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.
something seems wrong here
templates/test/running_table.html.ep
Outdated
@@ -48,12 +48,12 @@ | |||
of <%= "$distri-$version-$flavor.$arch" %> | |||
</td> | |||
<td class="test"> | |||
% if (is_operator) { | |||
%= link_to url_for('apiv1_cancel', jobid => $job->id) => (class => 'cancel') => begin | |||
% if (is_operator) { |
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.
uhm…
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.
so why these indendation change?
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.
that's tabs I assume?
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.
I see.
@foursixnine Please update the git commit message subject line of "Changes in formatting of the template" to something more sexy. And I guess you need to ensure indendation is correct after the tab replacement
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.
So I'll fix that commit message, with the commit description then Replace tabs with spaces and fix indentation
fixes the operator indentation too
e93b16e
to
805ec4a
Compare
Codecov Report
@@ Coverage Diff @@
## master #1446 +/- ##
==========================================
- Coverage 88.47% 88.44% -0.04%
==========================================
Files 105 105
Lines 7945 7950 +5
==========================================
+ Hits 7029 7031 +2
- Misses 916 919 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1446 +/- ##
==========================================
+ Coverage 75.27% 88.47% +13.2%
==========================================
Files 105 105
Lines 7936 7941 +5
==========================================
+ Hits 5974 7026 +1052
+ Misses 1962 915 -1047
Continue to review full report at Codecov.
|
805ec4a
to
7e12cfc
Compare
I have just updated the PR description with an image of how it will look like. In the very seldom case where a job has t_started = undef, a warning will show up. But other than that I see no more problems |
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.
I recommend to revert the indendation changes, rest +1
templates/test/running_table.html.ep
Outdated
@@ -48,12 +48,12 @@ | |||
of <%= "$distri-$version-$flavor.$arch" %> | |||
</td> | |||
<td class="test"> | |||
% if (is_operator) { | |||
%= link_to url_for('apiv1_cancel', jobid => $job->id) => (class => 'cancel') => begin | |||
% if (is_operator) { |
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.
so why these indendation change?
With all the STATES we have (and those forthcomming), we need to know better what states belong to whic slice of it's lifetime. Remove hardcoded states Move Assigned back to EXECUTION Right now, a job that is assigned is a job that is "pending" execution For the time being we still have some jobs that spend some time here, this will allow to easily restart as 4eb1114 did.
Code was using .targets as a positional argument (Column name instead of a CSS class), this causes the table to change if a new column is being added. https://datatables.net/reference/option/columnDefs.targets
7e12cfc
to
546f998
Compare
commit 92f4fa1 Merge: a8e5e97 546f998 Author: Santiago Zarate <santiago@zarate.net.ve> AuthorDate: Wed Sep 27 17:43:50 2017 +0200 Commit: GitHub <noreply@github.com> CommitDate: Wed Sep 27 17:43:50 2017 +0200 Merge pull request #1446 from foursixnine/feature/job_table_revamp Add all job states to be monitored from /tests route
Once again, a plea can you please @ me when changing the job state (etc.) constants? They need to be updated in the Python client also. Thanks! |
this PR doesn't though - it just shuffles around the internal arrays |
oh right, I misread the changes. still, point stands - something changed 'em recently and I had to spot it myself :P |
This is an approach of adding all the states to the /tests route, so that wen can see all tests that can be represented through any of
OpenQA::Schema::Result::Jobs::STATES
.While it seems to be feasible, there are few things that migh need to change (Including how we are representing the tests at all). Also not to do unnecesary queries thatspam the database every time someone is opening /tests.