Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Show count of new, fixed issues in PR statuses #61

Merged
merged 1 commit into from
Apr 2, 2015

Conversation

iancanderson
Copy link
Contributor

This is a no-op unless the payload from the CC event includes both
fixed_issue_count and new_issue_count keys.

https://trello.com/c/f17uUGRd

COMMENT_BODY = '<img src="https://codeclimate.com/favicon.png" width="20" height="20" />&nbsp;<b>Code Climate</b> has <a href="%s">analyzed this pull request</a>.'

DETAILED_COMMENT_BODY = '<img src="https://codeclimate.com/favicon.png" width="20" height="20" />&nbsp;<b>Code Climate</b> found <a href="%s">%s and %s</a>.'
DETAILED_COMMENT_REGEX = %r{<b>Code Climate</b> found <a href=".*">.*issues.*</a>}

Choose a reason for hiding this comment

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

Looks like this regex can fail in the case of 1 fixed issue. I think the "s" needs to be optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

@JacobNinja
Copy link

:shipit:

@iancanderson
Copy link
Contributor Author

TODO: remove changes to PR comments integration, since it's deprecated

@iancanderson iancanderson force-pushed the ia-issues-counts-in-pr-messages branch from 686756e to 9fb0976 Compare April 1, 2015 13:54
@iancanderson
Copy link
Contributor Author

TODO: more "humanized" messaging - handle cases of 0 new and/or fixed issues

@iancanderson iancanderson force-pushed the ia-issues-counts-in-pr-messages branch from 9fb0976 to bc65d67 Compare April 1, 2015 15:02
Explicitly adds a dependency on activesupport (it was already an implicity
dependency through the activemodel dependency).

The new presenter uses active support for #pluralize and #to_sentence

https://trello.com/c/f17uUGRd
@iancanderson iancanderson force-pushed the ia-issues-counts-in-pr-messages branch from bc65d67 to be88d61 Compare April 1, 2015 15:04
@iancanderson
Copy link
Contributor Author

Ready for a re-review @codeclimate/review

update_status("success", "Code Climate has analyzed this pull request.")
update_status(
"success",
CC::Service::GitHubPullRequests::Presenter.new(@payload).success_message
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@noahd1
Copy link
Contributor

noahd1 commented Apr 1, 2015

LGTM

iancanderson added a commit that referenced this pull request Apr 2, 2015
Show count of new, fixed issues in PR statuses
@iancanderson iancanderson merged commit 910193f into master Apr 2, 2015
@iancanderson iancanderson deleted the ia-issues-counts-in-pr-messages branch April 2, 2015 21:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants