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

Improved Pull Request review and comments support #406

Merged
merged 5 commits into from
Jan 13, 2018

Conversation

sns-seb
Copy link
Contributor

@sns-seb sns-seb commented Jan 8, 2018

At SonarSource, we have been using the Github API library for a while.

Unfortunately to implement new features in SonarQube, we hit some limitations.

Support for Pull Request reviews is out of date. Only support for beta has been done, and things changed a bit when the feature got public:

  • review state and review event flag actually do not have the same values
  • the beta header are now useless
  • new review can now be posted in a single API call

Pull Request comment support has some limitations and bugs:

  • original_position field of review comments isn't parsed
  • a comment's position can actually be null, this indicates an out-of-date comment
  • the ability to create a reply hasn't been implemented yet

So we added it to an internal fork and are contributing it back to the community.

Unit test coverage of the changes are far from SonarSource's standard, but we mostly failed at making existing unit tests run (mostly by a lack of the right Github credentials, it seems) so we barely added any new one.

If you have any direction to provide in order to successfully run the existing UTs, we will be happy to provide UT coverage on our new code.

In the mean time, rest assured that the new code has been field tested.

Please let us know if the contribution is acceptable in the shape below. We will be happy to drop our internal fork in favor of the original library when the changes are merged.

Cheers,

this fixes parsing of response of WS call submitting a review to fail
when event of new review is REQUEST_CHANGES
also, specifying event when creating a pending PR review is useless and
providing it when submitting the review is enough
position of pr comment is null when comment is outdated (ie. not located in diff patch anymore)
@sns-seb sns-seb force-pushed the improved_pr_review_and_comments branch from 024ca30 to e74346f Compare January 9, 2018 13:13
@sns-seb
Copy link
Contributor Author

sns-seb commented Jan 9, 2018

updated the PR to replace SonarSource license headers of new file with MIT license headers

@kohsuke kohsuke merged commit e74346f into hub4j:master Jan 13, 2018
kohsuke added a commit that referenced this pull request Jan 13, 2018
... with some further changes
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.

3 participants