GitHub Integration: why and how

Many teams tend to use GitHub pull requests for reviewing code changes, and it is completely understandable. GitHub is a popular choice for hosting Git repositories, and teams that keep their projects on GitHub naturally start to manage code reviews via pull requests. However, while GitHub has excellent Git hosting functionality, we believe that as far as code reviews go, there’s a lot that could be better. Upsource on the other hand provides a rich set of code review assistance features, code insight for popular programming languages and top-notch IDE integration. However, all those things were previously available only to teams using post-commit and branch review approaches. We have received a number of requests to add support for GitHub pull requests in Upsource, and we are happy to be able to offer it to you in Upsource 3.0.

Why review GitHub pull requests in Upsource?

If you haven’t tried Upsource yet, you may be wondering how exactly can Upsource make reviewing a pull request easier for you?

Code insight

Upsource is the only code review tool that provides code insight for projects written in Java, PHP, JavaScript and Kotlin. Upsource understands your code, its structure, and can help you comprehend a change and make an informed decision on its quality. For example, you can see the results of static code analysis for a change just like you would in your IDE.

CodeInsight-analysis

Upsource can even show which new potential issues were introduced with this particular revision, and which problems have been fixed.

code-analysis-summary

You can navigate through the code to better understand it, just like you would in an IDE, and see where symbols are used:
Overview25-codeInsight

Upsource will even let you know how a change affected usages of a symbol.

UsagesDiffWithZoom

No other code review tool can offer you this much insight into your code and help you understand a change on so many levels. Basically you have the power of your IDE at your fingertips while looking at code in your browser.

Incremental diffs

Code review is an iterative process, it’s rarely the case that a pull request contains only one revision. Most of the times there are multiple changes, and a reviewer has to come back to them time and again. Upsource helps you track what you already have seen. When you’re done with yet another iteration and raised a concern, next time there’s a new change, Upsource will only show you the new change, not the summary of all changes. Naturally, it is also possible to pick and choose which changes you want to see. You can see all of them, latest, or, perhaps, you only want to come back to that particular change somewhere in the middle of it all? That’s possible too!

Features-codeReview

Within current iteration Upsource also tracks read/unread files for you.

Accept/Raise concern

Upsource provides a clear way for the reviewers to indicate whether they are happy with a change, or there’s still something to be addressed.

Better discussions

Comment threads work well in GitHub, but a reviewer has to use emoji to indicate whether they are satisfied with the outcome of a discussion. Upsource provides a way to resolve discussions, and label them to categorize and prioritize any concerns raised during a review.
It also maintains the position of an unresolved discussion in the file, so that you could come back to it later, outside of the scope of the review.

Smart notifications

Upsource doesn’t spam your inbox as notifications are bundled and sent as a digest instead of being sent immediately. You can also specify which events you wish to receive notifications about. The notifications that you receive in your News Feed, be it in your browser, or in your Upsource IDE plugin, are delivered in real time, so that you can have a real-time discussion in the context of an actual change.

plugin

How does it work?

When connected to a project hosted on GitHub, Upsource synchronizes the following user activities:

  • Discussion comments posted in GitHub are shown in Upsource and vice versa
  • Pull requests can be created right form Upsource, existing pull requests are also recognized.
  • A branch review is automatically created on a new pull request

On a side note, this also means that if part of your team wants to use Upsource while some team members prefer reviewing pull requests in GitHub, this is possible too. Upsource in no way prevents you from continuing using pull requests on GitHub.

Where to start?

To begin reviewing your GitHub pull requests with Upsource you need two things – a repository in GitHub, and an instance of Upsource installed on your servers or your own cloud infrastructure.
To enable the integration and make sure user activities are synchronized, you need to:

  1. Set up GitHub authentication module: see our documentation for details.
  2. Connect Upsource to your repository by filling out a couple of fields:
    connect-to-github
    Make sure to provide a token that will be used for reading data from GitHub – anonymous access is generally not recommended.
  3. Your users will see Login to GitHub button on the project’s main page. They will need to login to GitHub from Upsource so that their comments and other activities are reflected on GitHub.

If you’ve checked the “Import pull requests as branches” option, Upsource will create code reviews for existing pull requests automatically. You can also create new pull requests from Upsource for existing branches, and merge pull requests, if there are no conflicts found.

Enjoy your code reviews!

This entry was posted in Feature. Bookmark the permalink.

26 Responses to GitHub Integration: why and how

  1. Dimitar Dimitrov says:

    Do you have any plans to provide the same level of integration for Gitlab?

  2. Ludwig Adam says:

    Will the integration work with github enterprise?

  3. Any plans for Bitbucket integration? It’s a necessary evil for us :)

    • Maria Khalusova says:

      Yes, it’s on the list. Stay tuned! 😉

      • Bernhard Breytenbach says:

        Thats great news! Any expected time-frame for this?
        Would love to give UpSource a test, but it seems the only way to use it currently is using https://www.cloudpipes.com/integrations/bitbucket/upsource
        If its still 6 months away, this could be a solution worth considering, but if its planned to be released within the next 3 months, it might be better to just wait.

        • Maria Khalusova says:

          Currently, only pull requests are not supported for Bitbucket, you can still use Upsource and Bitbucket together for post-commit code review and reviewing branches, just as any git. As for pull requests support, I cannot tell you yet if it’ll be in the next release, or the one after next.

  4. Aleksander Zubala says:

    I’m using GitHub integration and reviewing PRs straight from AppCode is awesome!

    One question though: once PRs has been reviewed and accepted I would like to be able to merge it straight from IDE.

    When I press Accept the Changes button it does not perform PR merge. In addition pressing Close Review, closes PRs on GitHub without merging changes.

    Does it mean it’s not supported in Upsource?

    • Aleksander Zubala says:

      Additional question about comments: it looks like commenting on a particular line of the file is not propagated to the GitHub PR – comment appears correctly under selected line in Upsource. Is this not supported at the moment?

      • Artem says:

        Upsource allows to leave a comment on any line in the file. On the other side GitHub only allows to comment lines in the diff.

        Thus, when you leave a comment in Upsource outside of the diff it’s not attached to the same line in GitHub..

    • Artem says:

      Hi Aleksander,

      After code review for PR is accepted you might merge the PR from the Upsource web UI (there you should see “merge” button – -please see Pull requests and merges section here – https://www.jetbrains.com/help/upsource/3.0/synchronizing-your-activities-in-github-projects.html) .

      However this functionality is not available from the Upsource IDE plugin. (We are not sure yet if it should be a feature of a plugin or IDE itself).

      Yes, if you press Close Review it’s automatically closes PR itself. It’s expected behaviour.

  5. Tavin Cole says:

    I want a github integration that detects all the repositories under my organization :)

  6. Hendrik says:

    Will Upsource every have the ability to host Git/Mercurial repository by its own?
    It was on the roadmap like a year ago but suddenly diapered and since then no one ever talked about it.
    Hub+YouTrack+Upsource seems to be such a great fit for, specially the centralized access control. But without integrated repository hosting it somehow defeats its own purpose if you still have to fiddle around with your own integration.

    • Maria Khalusova says:

      As of now, there is no plan to have a Git hosting feature as we didn’t find enough evidence that it was in fact needed. There are plenty of great git hosting solutions available, both commercial and free of charge, and Upsource works with them.

  7. Incredible hope We had thought of that.

  8. Robert Kee says:

    I just installed 3.5 and also unable to use an enterprise ssh url such as git@github..com:/.git using ssh authentication.

Leave a Reply

Your email address will not be published. Required fields are marked *