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

Handle case where jobset has no defined errormsg for api/jobsets #702

merged 2 commits into from Apr 1, 2020


Copy link

@kquick kquick commented Jan 12, 2020

Fixes logged messages:

{date} {hostname} hydra-server[PID]: Use of uninitialized value in string eq at /nix/store/.../libexec/hydra/lib/Hydra/Controller/ line 79 <$read> line 383.
@@ -88,7 +88,7 @@ sub jobsetToHash {
triggertime => $jobset->triggertime,
fetcherrormsg => $jobset->fetcherrormsg,
errortime => $jobset->errortime,
haserrormsg => $jobset->errormsg eq "" ? JSON::false : JSON::true
haserrormsg => defined($jobset->errormsg) ? ($jobset->errormsg eq "" ? JSON::false : JSON::true) : JSON::false

This comment has been minimized.


basvandijk Jan 14, 2020

I think it's clearer to collapse the nested condition into a single condition like:

Suggested change
haserrormsg => defined($jobset->errormsg) ? ($jobset->errormsg eq "" ? JSON::false : JSON::true) : JSON::false
haserrormsg => defined($jobset->errormsg) && $jobset->errormsg ne "" ? JSON::true : JSON::false
Copy link

@nlewo nlewo commented Jan 21, 2020

@kquick Could you squash these commits?
Otherwise, lgtm.

Copy link
Contributor Author

@kquick kquick commented Jan 21, 2020

I'd prefer not to squash these commits, since I've already merged them into other branches and the result would be pretty impactful from an administrative perspective (... it would take a significant amount of effort to rebuild those other branches, which had other commits on them as well). OK, @nlewo?

@edolstra edolstra merged commit 2d092a6 into NixOS:master Apr 1, 2020
@kquick kquick deleted the kquick:fix_api_push branch Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.