NPM support in Upsource 2017.2

In the latest Upsource release we have further extended the reach of JavaScript code intelligence by introducing support for npm and yarn package managers.

Upsource will look into your package.json file(s) and install the required dependencies so that you can get more out of Go to declaration and Find usages actions.

The downloaded dependencies are intelligently cached.

npm support

Here’s how you can enable JavaScript support in your project:

  • Make sure Node.js, npm and/or Yarn are installed on the Upsource server.
  • Remember: it’s better to have package-lock.json (for npm) and yarn.lock (for Yarn) stored in version control, it makes installation of dependencies much faster.
  • In Upsource, go to the Code Intelligence tab in your project’s settings, and click Enable.
  • Choose your JavaScript flavor, and enjoy!

Want to learn more about JavaScript support in Upsource? Check out this post.

Posted in Feature | Leave a comment

Upsource 2017.2.2197 is hot off the press

Please welcome the first bug-fix update for Upsource 2017.2 — build 2197. This minor release contains over 30 fixes and is recommended for all users. See the Release Notes for more details.

Posted in Release | Leave a comment

Python support in Upsource

The latest Upsource release brings Python code insight functionality to help developers understand new changes in a familiar manner and be more efficient when reviewing them.
The code insight features in Upsource include server-side static code analysis and code-aware navigation. These features allow you to understand code better when browsing through it and perform code reviews more efficiently. Let’s take a look at them.

Navigation

It might seem like a trivial thing, but the ability to navigate through the code is something we simply take for granted when using an IDE. Yet these features are often missing when viewing code in a web-based tool. Upsource, however, lets you click on a symbol to navigate to its declaration.

Python Navigation

When there’s a new change, you most likely would like to see its impact. Say, if a function has been modified, you’d probably want to know how it affected its usages. You can see in the screenshot above that you can simply highlight symbol’s usages in the file when browsing it, or find all usages. When viewing the contents of a commit, in addition to Find Usages action, you can get a usages diff that helps to learn how this change affected the usages of a particular symbol.

Find Usages

Intuitive navigation is great for a reviewer as it lets you browse through the code in a way that’s natural for you, rather than having some arbitrary order imposed on you – it makes it easier to see the context of the changes under review.

Static code analysis

There’s another IDE feature that would be extremely useful during code review – code inspections. You’re probably used to an IDE, like PyCharm, giving you pointers on where the code could be simpler, clearer, and generally a bit better. If your code review tool offered the same kind of advice, it would be easier to evaluate the quality of the code.
Python Code Inspections

Introduced and fixed issues

You can see the static code analysis results for any revision when simply browsing the code or doing a code review. However, when a change is part of a code review, you get additional help from Upsource. It shows what problems have been fixed with the new change and what new possible issues the change introduced.

Introduced issues

Upsource aims to make code review not only as painless as possible but also provide as much help as a tool can, freeing you up to worry about the things that humans are really good at.

Great! How do I get started?

To configure Python support in Upsource, go to the Code Intelligence in your project’s settings. Choose the version of Python and make sure to have python, pip, and virtualenv installed on your Upsource service. Happy reviewing!

Posted in Feature | Leave a comment

Muting a code review in Upsource 2017.2

Let’s say you’ve just fixed a typo in a branch that is undergoing a code review or committed some other minor change. Now, you’ve become one of the authors in this branch review, even though you probably don’t want to follow the review progress.

Unlike watchers and reviewers, authors cannot simply remove themselves from a code review, but in Upsource 2017.2 it is possible to mute it.

If you mute yourself in a code review like that, you will stop receiving updates in your news feed as well as email and browser notifications.

Mute Review

Your userpic will reflect that you’ve muted a review, however, only you will see that. You can unmute the review the same way: hover on your userpic and click “Unmute” – leaving comments in this code review does not unmute you automatically.

If you’re a reviewer or a watcher you can also mute reviews. As opposed to leaving a review, a muted review will still appear in pre-defined search results.

Posted in Feature | Leave a comment

Code review for .NET projects in Upsource

As you know, Upsource has IntelliJ IDEA at its core which brings IDE-level code insight right into your browser. This helps teams that code in Java, PHP, Python, Kotlin, and JavaScript perform code review in a more efficient manner.

This, however, doesn’t mean that projects written in other languages cannot use Upsource as a code review tool. In fact, all of the smart code review functionality such as progress tracking, workflow automation, and intelligent suggestion of reviewers and revisions is language-independent. The only teams that cannot use Upsource are the ones using exotic version control systems. Git, Mercurial, Subversion, and Perforce are supported out of the box.

For some languages, there are extra benefits available that may not be obvious from the first glance. In this post, I’d like to go over some Upsource features that a .NET team can use to make their code reviews more efficient.

ReSharper Code Inspections

Although there’s no built-in ReSharper engine in Upsource, it can receive and present the results of code analysis performed on your TeamCity server.

Note: If you don’t know what TeamCity is, check it out – it’s a great CI server and it’s free up to 20 build configurations.

TeamCity has a built-in ReSharper inspections runner that can be part of your build pipeline. After a simple setup, TeamCity will start sending the results of static code analysis to Upsource, and you’ll be able to see them right in the code.

Resharper Code Inspections

Needless to say, having code analysis warnings at hand during a code review can be of great help when evaluating a changeset.

Upsource Integration plugin for Rider

If you’re using Rider, a cross-platform .NET IDE combining the power of the IntelliJ platform and ReSharper, you can also benefit from Upsource IDE integration plugin.

Having this plugin installed, you can create code reviews when you commit a change, get notified about any updates relevant to you, participate in discussions, review someone else’s changes, and so on – straight from your IDE. This means that you can leverage all of the IDE’s power to help you complete a code review faster and increase its value.

Check out this article to learn more about the plugin’s features.

General Code Review Assistance

Another way Upsource can help a .NET team become more efficient at code reviews is by eliminating all the unnecessary manual work. You can automate your workflow and make sure all the critical code parts and changes are covered, as well as set up automatic assignment of reviewers for each new code review:

Custom Workflow

If you prefer, you can also create reviews manually, of course. In this case, Upsource will suggest reviewers based on historical data of code commits and code reviews, and when a new revision appears, Upsource can let you know if it might be related to a code review in progress:

Revision suggestion

Code review is an iterative process. If a reviewer finds problems in a new change, the author needs to address them and commit a new change which also needs to be reviewed. Upsource tracks reviewer’s progress and optimizes the process – when a new change arrives, the reviewer needs to only look into that latest change, not the whole changeset.

Progress Tracking

You can use labels to help prioritize concerns raised in discussions and resolve discussions when the problem has been addressed or the question has been answered.

You can also integrate Upsource with your issue tracker and create issues straight from discussions, and, if you’re using JIRA, apply transitions for your iteration workflow automatically.

These features can help a .NET team perform code reviews more efficiently, but there’s a lot more to Upsource! Project analytics, powerful search, comprehensive repository exploring, transparent team collaboration, and many small-but-handy features here and there that generally make Upsource so pleasant to work with. If you haven’t yet, give it a try!

Posted in Feature | Tagged , , | Leave a comment

Upsource 2017.2

Good news, everyone – Upsource 2017.2 is here! It comes with a number of highly anticipated features, brings some fun elements into your daily routine and, as usual, enhances the existing functionality. Here’s a quick recap.

  • External Inspection Engines

    Running SonarQube inspections? Or ReSharper/IntelliJ Inspections on TeamCity? Now you can see the results straight in Upsource. This makes a reviewer’s job even easier than before, especially if you’re working on a .NET project!
    ReSharper Code Inspections in Upsource
  • Python Support
    Code insight functionality is now also available to teams using Python. As for other supported languages this includes code-aware navigation, static code analysis, Find Usages and Usages diff.
    Python support
  • Reactions
    When there’s no need for an elaborate answer, give your feedback in a fast and compact form using a reaction.
    Reactions
  • GitLab Support
    We’ve received a number of requests to support GitLab merge requests, so you’ll be pleased to know that you can now perform code review for your GitLab merge requests in Upsource.
  • NPM Support
    To improve “Go to declaration” and “Find usages” in JavaScript code, we install dependencies listed in your package.json file using npm or yarn (whichever is required).
    NPM support
  • Suggested Revisions in Reviews
    We have employed advanced statistical analysis to suggest revisions that should be added to a review. Similar to the reviewer suggestions that were implemented several releases ago, this is another powerful tool that helps you review code more efficiently.
    Suggested Revisions in a Review
  • Achievements
    To make it easier to discover new features and to add some fun to your interactions with Upsource, we are introducing an achievements/badges system. So far we’ve added only a few basic achievements but that’s just the beginning!
    Achievements

That’s not all of it! If you’d like to learn more about the new Upsource 2017.2 features, please check out the What’s New page. See the complete list of changes in our issue tracker.

To try Upsource 2017.2 download the build and don’t forget to backup your current instance!

Posted in Release | 5 Comments

Upsource 2017.1.1922 Is Here

Please welcome a fresh update for Upsource 2017.1 (build 1922). This minor release brings a number of bug fixes and improvements, including IntelliJ IDEA plugin fixes and usability problems. Please check the full list of the Release Notes for more details.

Download the latest Upsource 2017.1.1922 and enjoy all the fresh goodies!

The Drive to Develop!

The Upsource JetBrains Team

Posted in Newsletter, Release | Tagged , | 7 Comments

Welcome Upsource 2017.1.1892

Introducing a bug fix for Upsource 2017.1 (build 1892). This minor update brings a lot of useful fixes and enhancements, including a number of fixes for IntelliJ IDEA plugin, and TeamCity integration, such as showing the build status on the review page:

TeamCity Integraion

To get more juicy details about the new build, please check the full list of the Release Notes.
Download Upsource 2017.1.1892 today and enjoy all the fresh goodies!

The Drive to Develop!

The JetBrains Upsource Team

Posted in Newsletter, Release | Tagged , | Leave a comment

Automating Your Code Review Workflow with Upsource

The last three posts on code review workflows show that there’s more than one way to do a code review, and that the approach you take will depend upon what you want to achieve with your reviews and the type of team you’re working with.

In this post, we’ll cover how Upsource aims to make your workflow, whatever it looks like, simpler by automating as much of it as possible. We’ll show the types of things that can be easily automated, when this might be useful, and show how to achieve it.

Automatically Create Reviews

If your workflow is predictable in who reviews code, you don’t need to manually create reviews and add reviewers, you can have Upsource do this for you. In this example, we’ll assume that you have a single individual who reviews all code that is committed.

Steps:

This is achieved using Custom Workflows.

  1. Log in as an administrator and go to the administration page by clicking on the settings icon settings-icon
  2. Select the project you want to enable automatic code reviews for, and click its Edit project button.
  3. Click on the Custom workflows link on the right of the page.
  4. Under the “Create reviews automatically” heading, click the Enable check box, then click the Add trigger button that appears.
  5. For our specific example, we’re not going to enter any authors or branch/path information, we want all code by all authors to be reviewed by our designated reviewer. You can see that Upsource suggests all the users in this project, so you can simply select one from the list.

    Trigger for automatically creating reviews

    Figure 1: Configuring a trigger for creating reviews

  6. Once this has been saved, you can see the details of the trigger:

    Trigger is set

    Figure 2: Viewing the trigger details

  7. Next time anyone checks in code, a code review for this commit will be created automatically, to be reviewed by Reviewer:
Review automatically created

Figure 3: The automatically created review

Notes:

By default, this creates a new review for every commit. You can optionally set the review to automatically track the branch it is on, which may be suitable if the team uses feature branches or a similar workflow.

05OptionallTrackBranch

Figure 4: You can optionally set the created review to track the branch

There are other options to allow commits to be bundled into a specific review, for example using issue IDs or code review IDs to automatically add a commit to a review.

Suitable for:

  • May be used for gateway code review process, where either one individual usually approves changes to code, or there’s a set of reviewers who are all automatically added to all reviews. Not so suitable for this process if the author usually makes a series of commits but only wants them to be reviewed when the code is “finished”.
  • May be used for design evolution reviews, in this workflow you may choose all commits to be reviewed by all (or most) of the team.

Vary the Automatically Assigned Reviewers

The previous automation is useful if you a) know which developers will be required as reviewers and optionally b) can assign these based on either branches or code paths. Most teams are more flexible around who they assign to reviews, particularly if they’re following an iterative approach or using code review for knowledge sharing. Upsource can assign randomly selected reviewers from a given pool of suitable developers.

In this example, we’re going to specify a pool of developers who can be randomly assigned to review any code from any developer.

Steps:

  1. We’re going to enable a second automated workflow as well as the previous one. Firstly, we need to set up the automatic creation of code reviews, like we did in the last example. The only difference is that this time we do not assign reviewers (see Figure 1 – in this second example we do not add reviewers).
  2.  While we’re on the Custom workflows section, we need to go to the “Assign review participants automatically” heading. Here, we click the Enable check box, then click the Add trigger button that appears.

    Assign reviewers trigger

    Figure 5 – Assign review participants automatically trigger

  3. As usual, Upsource will suggest users for both the “Created by” and “Users” fields. We’re going to leave the “Created by” field blank, because we want this to apply to all developers. But you can imagine that if you wanted this workflow to apply to just the junior/new developers, you could add them to this box.
  4. We’ll select a set of reviewers for all code reviews. This could be just the most senior/experienced people on the team, or could be all developers if you’re aiming for shared code ownership with your reviews.
  5. Now, we have the option of either assigning everyone in this pool to be a reviewer, or getting Upsource to select a random subset of these reviewers for each review. We’re going to configure Upsource to pick one person randomly, so the reviewers don’t get overloaded with too many reviews, and so that everyone gets to see all parts of the code.

    Pick random reviewer

    Figure 6 – Configure Upsource to select a single reviewer randomly from the pool

  6. Click the Save changes button.
  7. Now, whenever anyone checks in code, a review will automatically be created, and a random reviewer assigned.

    Review created

    Figure 7 – Review created and random reviewer assigned

Suitable for:

  • Teams who want developers to break out of silos, encouraging them to review code outside their usual zone
  • Knowledge sharing – by assigning random reviewers to each commit, the whole team can eventually get to see changes to the whole code base.
  • Iterative design – this can be used to assign the whole team as reviewers or watchers to every commit, or it can be used to randomly select reviewers. This latter option may be a good way to reduce some of the noise when using code reviews for design evolution.

Automatically add commits to a review by Issue Number

Many teams already tag every commit with the ID of the bug/feature ticket in the issue tracker. If this is standard practice for your team, and you want to create a code review for every issue, then you can turn on the feature in Upsource that will do this for you.

Steps:

  1. Follow steps 1-3 from the first example to navigate to the Custom workflows page.
  2. Go to “Add revisions to a review automatically” and tick the checkbox. As before, click Add trigger to define the settings.

    Create Issue ID Trigger

    Figure 8 – Create a trigger on Issue ID

  3. Don’t forget to click Save changes.
  4. You will still need to create a code review for the first commit with a comment containing a keyword in the right format (either a Jira or YouTrack issue ID, or a predefined issue ID format), unless this is combined with one of the other automated workflows. But subsequent commits with this issue ID will be added to the code review for the issue.

    Commits added to Review

    Figure 9 – Commits with the same issue number are added to the same review automatically

Suitable for:

  • Teams who do not work on feature branches but use issue numbers to group their commits.
  • Teams who already tag all commits with issue numbers, or who would like to do this.
  • Applies to all code review workflows.

Automatic integration with GitHub

This has been covered in previous blog posts. Upsource’s bi-directional integration with GitHub makes it easy to synchronise pull requests (reviews) and comments, so no matter whether a reviewer or author prefers to use the GitHub UI or Upsource, all the information is available in both tools.

Suitable for:

  • Teams who use GitHub
  • Open Source projects using GitHub where external contributors use the GitHub UI and internal team members have access to an Upsource instance.

Summary

Upsource has a number of options to help you automate your code review workflow. Just as there are many tools that automate the routine things to examine in your code (e.g. static analysis tools and automated tests) which should be used to minimise the load on your code authors and reviewers, there are ways to ease the creation of code reviews according to your workflow.

One of the options described above might suit your need, or more likely a combination of them will cover a vast majority of the cases where code reviews need to be created for your team, so you don’t even need to remember to create a review and assign people to it.

Posted in Code review practices, Newsletter | Tagged | Leave a comment

Upsource 2017.2 Roadmap

It’s been a month since we released Upsource 2017.1 and, of course, we are moving forward. Today, we would like to share our plans for the 2017.2 release which is planned for Q3 2017.

600x400_blog_UP_2017_2_@2x

Support for External Inspection Engines

Upsource is renowned for having a built-in IntelliJ IDEA engine that we use, among other things, to show inspections in code. It’s also behind the Code Analysis Summary that you see in reviews. However, there are a lot of tools on the market that specialize in static code analysis and we don’t want to limit ourselves just to inspections from IntelliJ. We are working to support external inspection runners, be it ESLint or SonarQube, or IntelliJ global inspections and ReSharper inspections bundled with TeamCity, with the goal of presenting their results alongside our own inspections.

Suggested Revisions in Reviews

We have employed advanced statistical analysis to suggest revisions that should be added to a review. Similar to the reviewer suggestions that were implemented several releases ago, this is another powerful tool that helps you review code more efficiently.

Achievements

Upsource grows up and suggests more and more cool features to make code review and code browsing better. We want to make it easier to discover new features and to add some fun to your interactions with Upsource. We plan to introduce an achievements/badges system to accomplish these goals and open doors for other engaging and useful experiences.

“Discussions” page

We are working on a new page that lists all of the discussions that are happening in a project chronologically and lets you search and filter the discussions.

NPM Support

To improve “Go to declaration” and “Find usages” in JavaScript code, we are working to support TypeScript definitions for packages that are listed in your package.json file.

Better Python Support

While basic Python support is available in Upsource, pip isn’t. We are working to address that.

Reactions

Everyone loves reactions in Slack, right? Reactions help you give feedback in a fast and compact form, saving time for everyone. We are eager to provide you with such an ability in Upsource.

We share this public roadmap to give you insight into our current direction. Unfortunately, we can’t promise to include everything listed here in the upcoming version, but we’ll definitely do our best. Also, we’re moving to shorter release cycles and aim to provide you with shiny new features as soon as they are ready. So, stay tuned for updates, and don’t forget to share your feedback by adding your comments here, using our issue tracker, or just by contacting our support team.

Your Upsource Team

The Drive to Develop!

Posted in Announcements, Newsletter | Tagged , | Leave a comment