Skip to content

Add optional creation of Bitbucket tasks for violation comments.#5

Merged
tomasbjerre merged 1 commit intotomasbjerre:masterfrom
Syquel:feature/violation-comments-tasks
Jul 6, 2018
Merged

Add optional creation of Bitbucket tasks for violation comments.#5
tomasbjerre merged 1 commit intotomasbjerre:masterfrom
Syquel:feature/violation-comments-tasks

Conversation

@Syquel
Copy link
Copy Markdown
Contributor

@Syquel Syquel commented Jul 6, 2018

This feature optionally adds a task in Bitbucket to every violation comment, which is created on the pull request.
In combination with the Bitbucket merge check "No incomplete tasks" merges of pull requests are blocked as long as the violations are not resolved.

final BitbucketServerComment bitbucketComment =
client.pullRequestComment(file.getFilename(), line, comment);

if (violationCommentsToBitbucketApi.getCreateSingleFileCommentsTasks()) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You are changing client.pullRequestComment to return the comment and not actually create the comment.

If this is false then there will be no comment created at all right? Commenting single files, without creating a task, no longer works with this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

client.pullRequestComment still creates the comment in BitBucket via REST-call. The only change in that method is, that it does not discard the response of the Bitbucket server anymore (the created comment including ID), but returns it.
This is necessary, because the comment ID is required to create a task on it.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You are right! Merging it now.

@tomasbjerre tomasbjerre merged commit 7fe690a into tomasbjerre:master Jul 6, 2018
tomasbjerre added a commit that referenced this pull request Jul 6, 2018
@tomasbjerre
Copy link
Copy Markdown
Owner

I'm releasing the Jenkins plugin now, version 1.74!

@Syquel
Copy link
Copy Markdown
Contributor Author

Syquel commented Jul 6, 2018

Thanks for the quick release!

I already integrated this option into the violation-comments-to-stash plugin, but unfortunately it's on my laptop at work.
I will create a pull request on monday for it.

@tomasbjerre
Copy link
Copy Markdown
Owner

Ok. I added an option for it and released it.

@Syquel
Copy link
Copy Markdown
Contributor Author

Syquel commented Jul 6, 2018

Even better, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants