-
Notifications
You must be signed in to change notification settings - Fork 208
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
Fix checks for worker classes in directly chained clusters #5936
Conversation
* Consider all worker classes to verify that all jobs in a directly chained cluster have the same set of worker classes assigned * Avoid DBIx warning in case a job with directly chained dependencies has more than one worker class assigned * See https://progress.opensuse.org/issues/154735
* Consider all worker classes to verify that all jobs in a directly chained cluster have the same set of worker classes assigned * Avoid DBIx warning in case a job with directly chained dependencies has more than one worker class assigned * See https://progress.opensuse.org/issues/154735
5c31cf6
to
31174dc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5936 +/- ##
==========================================
- Coverage 98.74% 98.74% -0.01%
==========================================
Files 396 396
Lines 38870 38875 +5
==========================================
+ Hits 38384 38386 +2
- Misses 486 489 +3 ☔ View full report in Codecov by Sentry. |
@@ -6,6 +6,11 @@ use Mojo::Base 'DBIx::Class::ResultSet', -signatures; | |||
|
|||
use OpenQA::App; | |||
|
|||
sub all_values_sorted ($self, $job_id, $key) { | |||
state $options = {distinct => 1, columns => 'value', order_by => 'value'}; |
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.
Why are you using state
here?
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.
Because this hash never changes, so no need to re-initialize it on every function call. (That's probably the C++ programmer in me; in C++ that would be static const …
and state
is the closest Perl has to offer.)
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's a bit uncommon for a simple, small hashref, but I won't complain
commit 08dcad3 Merge: 6d38c3b 31174dc Author: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> AuthorDate: Mon Sep 23 15:40:50 2024 +0000 Commit: GitHub <[email protected]> CommitDate: Mon Sep 23 15:40:50 2024 +0000 Merge pull request os-autoinst#5936 from Martchus/worker-class-comparison Fix checks for worker classes in directly chained clusters
See particular commit messages and https://progress.opensuse.org/issues/154735