Skip to content

support Jenkins-status: UNSTABLE#16

Open
xamilimax wants to merge 1 commit intorouanw:masterfrom
xamilimax:feature/unstable-builds
Open

support Jenkins-status: UNSTABLE#16
xamilimax wants to merge 1 commit intorouanw:masterfrom
xamilimax:feature/unstable-builds

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?

send_event(build['id'], get_build_health(build))
end
end
end No newline at end of file
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.

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