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

support Jenkins-status: UNSTABLE #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xamilimax
Copy link

looks like:
image

Copy link
Owner

@rouanw rouanw left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request! The feature and UI look good.

I've added a couple of comments. Will you please also add a test case?

@@ -135,4 +136,4 @@ def get_jenkins_build_health(build)
Builds::BUILD_LIST.each do |build|
send_event(build['id'], get_build_health(build))
end
end
end
Copy link
Owner

Choose a reason for hiding this comment

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

I like having new lines at the ends of files 😄 Sorry, don't have any linting set up.

@@ -123,7 +124,7 @@ def get_jenkins_build_health(build)
latest_build = builds_with_status.first
return {
name: latest_build['fullDisplayName'],
status: latest_build['result'] == 'SUCCESS' ? SUCCESS : FAILED,
status: latest_build['result'] == 'SUCCESS' ? SUCCESS : latest_build['result'] == 'UNSTABLE' ? UNSTABLE : FAILED,
Copy link
Owner

Choose a reason for hiding this comment

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

I find nested ternaries to be very difficult to read. What about something like:

jenkins_statuses = { 'SUCCESS' => SUCCESS, 'UNSTABLE' => UNSTABLE }
# ...
status: jenkins_statuses[latest_build['result']] || FAILED

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the comments :) make sense.
I'll commit changes later when I have more time or feel free to adjust to your wishes! 👍

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.

2 participants