Skip to content
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 job group update issue #1533

Merged
merged 1 commit into from
Dec 11, 2017
Merged

Fix job group update issue #1533

merged 1 commit into from
Dec 11, 2017

Conversation

mitiao
Copy link
Contributor

@mitiao mitiao commented Dec 8, 2017

@codecov
Copy link

codecov bot commented Dec 8, 2017

Codecov Report

Merging #1533 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1533      +/-   ##
==========================================
+ Coverage   87.87%   87.95%   +0.07%     
==========================================
  Files         106      106              
  Lines        8223     8225       +2     
==========================================
+ Hits         7226     7234       +8     
+ Misses        997      991       -6
Impacted Files Coverage Δ
lib/OpenQA/WebAPI/Controller/API/V1/JobGroup.pm 97.5% <100%> (+0.06%) ⬆️
lib/OpenQA/Worker/Common.pm 84.19% <0%> (+2.2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3d4570...5e12c1d. Read the comment docs.


return 0 if $self->is_parent;
my $properties = $self->load_properties;
return $self->resultset->search({name => $properties->{name}, parent_id => undef});
unless ($group_id) {
return $self->resultset->search({name => $properties->{name}, parent_id => undef});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't duplicate so much code. the argument to search is a hash and it's only different in one key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return $self->resultset->search({name => $properties->{name}, parent_id => undef});
my $conditions = {name => $properties->{name}, parent_id => undef};
unless ($group_id) {
return $self->resultset->search($conditions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now this line is the same as 3 lines later. So please just move the $conditions->{id} = into an if - and return the search uncondiotionally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, got it...

@coolo coolo merged commit 63e3526 into os-autoinst:master Dec 11, 2017
coolo pushed a commit that referenced this pull request Dec 11, 2017
commit 63e3526
Author:     Wei Jiang <mitiao@gmail.com>
AuthorDate: Mon Dec 11 16:44:30 2017 +0800
Commit:     Stephan Kulow <stephan@kulow.org>
CommitDate: Mon Dec 11 09:44:30 2017 +0100

    Fix job group update issue (#1533)

    See: https://progress.opensuse.org/issues/29110
@mitiao mitiao deleted the jobgroup_fix branch December 12, 2017 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants