Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Fallback to an global comment if the file does not exist in the revision #2

Merged
merged 1 commit into from
Oct 5, 2017

Conversation

betterphp
Copy link
Contributor

If the file being reported on does not exist in the revision then a exception is shown in the Jenkins log and a comment is added listing the number of issues. This may be confusing as a comment may be shown that there are more issue than there are comments.

This adds a fallback for the case described to post a global comment with the file name and line number if it's not found in the revision.

@nthienan
Copy link
Owner

nthienan commented Oct 5, 2017

I noticed this issue but have no time to fix it. Thank you for your PR!

} catch (e: ConduitException) {
if (e.message.equals("Requested file doesn't exist in this revision.")) {
val message = "Unmodified file " + filePath + " on line " + i.line() + "\n\n" + ic
differentialClient.postComment(diff.revisionId, message)
Copy link
Owner

Choose a reason for hiding this comment

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

should modify postComment() to not attach inline comments in this case

log.debug("Comment $ic has been published")
} catch (e: ConduitException) {
if (e.message.equals("Requested file doesn't exist in this revision.")) {
val message = "Unmodified file " + filePath + " on line " + i.line() + "\n\n" + ic
Copy link
Owner

Choose a reason for hiding this comment

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

can use string template

@nthienan nthienan merged commit cb81cfd into nthienan:master Oct 5, 2017
@betterphp
Copy link
Contributor Author

Awesome, thanks :)

@betterphp betterphp deleted the inline-comment-fallback branch October 5, 2017 15:06
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.

2 participants