-
Notifications
You must be signed in to change notification settings - Fork 203
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
Refactor JobTemplates and fix regex substitution #2596
Conversation
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.
+1
0143e50
to
b57aca3
Compare
I think I need to make another change. Duplicate jobtemplates aren't checked in preview mode now, but there wasn't a test for this yet. |
be76f73
to
4a01efe
Compare
I fixed the preview mode. |
4a01efe
to
c3286bf
Compare
rebased to master |
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.
Looks good. Only a few style issues (in code you've just moved).
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'm liking the refactor! Not much to criticize about the implementation, although I have a few comments regarding the tests. There should be a brown review state of almost-approved 😉
} | ||
|
||
sub expand_yaml { | ||
my ($self, $job_template_names) = @_; |
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 strikes me as odd that this is sub takes $self
but doesn't use it. The result is not the expansion of what's in the group, but the expansion of the given hash. 🤔
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 actually thought about putting some functions into their own module because they do not depend on database objects, but skipped it for now.
What I tend to use in these cases is a comment like: "Just this (…) minor issue, then auto-approved" or something :) We should use that more often to not need the additional overhead of "official approval" when it is clear what only remaining trivial issues exist before the approval would be implicit anyway. |
c3286bf
to
480d159
Compare
Split into subroutines, move code to OpenQA::Schema::Result::JobGroups OpenQA::Schema::ResultSet::JobTemplates
Some templates don't have a final newline, which resulted in the last line not being indented correctly
480d159
to
e1b2c1a
Compare
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.
Thanks! I'm okay with it as is. The tests can also be extended in another branch!
So far I found one test that failed: https://app.circleci.com/jobs/github/perlpunk/openQA/79/parallel-runs/0/steps/0-108
|
Hm. the test didn't fail before my style fixes, and also doesn't fail in #2602 which is based on this branch... |
You can try to retrigger that test. |
Refactor
Split into subroutines, move code to
OpenQA::Schema:Result::JobGroups
OpenQA::Schema::ResultSet::JobTemplates
This will make testing easier.
Fix substitution for job_templates schedule list
Some templates don't have a final newline, which resulted in the last line not being indented correctly
This is a followup to #2589
Related ticket: https://progress.opensuse.org/issues/60782