feat: add scheduling skip reasons to the webUI#7206
feat: add scheduling skip reasons to the webUI#7206okurz wants to merge 1 commit intoos-autoinst:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7206 +/- ##
=======================================
Coverage 99.87% 99.87%
=======================================
Files 416 416
Lines 43597 43630 +33
=======================================
+ Hits 43542 43575 +33
Misses 55 55 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a8f7862 to
3bb0a90
Compare
Martchus
left a comment
There was a problem hiding this comment.
Looks generally good. I only have a few nitpicks and questions.
| '</ul>' | ||
| : 'No scheduling issues detected'; | ||
|
|
||
| const popoverIcon = $('#scheduled_jobs_help_icon'); |
There was a problem hiding this comment.
It would be nice to avoid jQuery in new code.
There was a problem hiding this comment.
Done where? I still see const popoverIcon = $('#scheduled_jobs_help_icon');.
1329a42 to
dcaae1f
Compare
of course. Jobs can be scheduled and waiting for various things, different worker classes, global job limit, the "df-thingy" you implemented, etc. |
but the amount of scheduled jobs will be always the same. Such, why to add it in the popup? |
The total won't be the same if they are delayed for other reasons. |
| . " (max_running_jobs=$limit, free workers=$free_worker_count, running=$running, allocated=$busy)"); | ||
| for my $id (keys %$scheduled_jobs) { | ||
| next if defined $allocated_jobs->{$id} || $checked_jobs{$id}; | ||
| $scheduled_jobs->{$id}->{current_reason} //= 'scheduling limit reached'; |
There was a problem hiding this comment.
| $scheduled_jobs->{$id}->{current_reason} //= 'scheduling limit reached'; | |
| $scheduled_jobs->{$id}->{current_reason} //= 'scheduling limit reached' . " (max_running_jobs=$limit)"; |
Can we include the allowed amount here?
|
This pull request is now in conflicts. Could you fix it? 🙏 |
| <div> | ||
| <h2 id="scheduled_jobs_heading">Scheduled jobs</h2> | ||
| <h2 id="scheduled_jobs_heading" style="display: inline-block">Scheduled jobs</h2><%= | ||
| help_popover 'Why is my test not executed?' => 'No scheduling issues detected', |
There was a problem hiding this comment.
| help_popover 'Why is my test not executed?' => 'No scheduling issues detected', | |
| help_popover 'Why is my test not getting executed?' => 'No scheduling issues detected', |
dcaae1f to
aaf25d9
Compare
|
This pull request is now in conflicts. Could you fix it? 🙏 |
Motivation: When openQA jobs remain in the scheduled state, users have no way to know why they are not being assigned. Surfacing scheduler skip reasons reduces confusion and support requests. Design Choices: - Used the existing "reason" column in the "jobs" table to store per-job scheduling skip reasons. - Implemented a write-on-change strategy in the scheduler to update the reasons only when they change, minimizing database write load. - Replaced the direct "df" call in the WebUI with a check on the aggregated job reasons to improve efficiency. - Added a popover next to the "Scheduled jobs" heading and tooltips on job status icons to display the reasons. - Refactored the scheduler full test to use dynamic job IDs and early status checks for better robustness and readability. - Introduced a job with an unsatisfiable WORKER_CLASS to verify the 'no free workers' reason. - Fixed a bug in the scheduler where the reason for jobs without matching workers was overwritten by 'scheduling limit reached'. Benefits: - Provides immediate, per-job feedback to users about scheduling delays. - Decouples the WebUI from low-level system checks like disk space. - Leverages existing database schema for zero-migration implementation. - Makes the test suite more resilient to changes in job creation order. - Fixes an edge case in the scheduler reason reporting. Related issue: https://progress.opensuse.org/issues/198647
aaf25d9 to
379e486
Compare

Motivation:
When openQA jobs remain in the scheduled state, users have no way to know why
they are not being assigned. Surfacing scheduler skip reasons reduces
confusion and support requests.
Design Choices:
scheduling skip reasons.
reasons only when they change, minimizing database write load.
job reasons to improve efficiency.
status icons to display the reasons.
Benefits:
Related issue: https://progress.opensuse.org/issues/198647