Space Code Reviews in IntelliJ IDEA 2021.1
Space makes it easy for you and your team to review code, and discuss changes. After making a change, you can request a review from one or more team members. When working on a feature branch, you can merge it back into the base branch, right from Space.
The IDE is where developers feel at home, because it’s the place where they write code and create applications. The native integration between Space and IntelliJ-based IDEs comes with a lot of benefits, and lets us bring you a great user experience. Code reviews are just a first step! At JetBrains, we are committed to continuously improve the integration of Space and our IDEs.
In this post, let’s see how you can use any IntelliJ-based IDE to browse Space code reviews, assign, manage, view and submit comments, and accept changes.
JetBrains Space brings software developers together with chats, project management, issue tracking, Git hosting, CI/CD, and package repositories.
If you prefer video, our colleague Trisha Gee made a short overview of Space Code Reviews in IntelliJ IDEA:
To get started, you’ll need to log in to Space in the IDE. You can do this from the settings, under Tools | Space. Enter the URL to your Space organization, press Log In, and your default browser will ask you to grant access from the IDE.
Once completed, you can use Get from VCS to list all projects and repositories in your Space organization. Search and select the Git repository you want to start with, and click Clone.
The Space plugin also comes with a tool window where you can inspect jobs in Space Automation. The plugin adds code completion, syntax highlighting, for your
But we’re here for code reviews, so let’s eh… review those!
Code Reviews tool window
In the sidebar, or using the Tools | Space | Code Reviews menu, you’ll find the Space Code Reviews tool window. It shows all code reviews for the current project, and lets you search and filter them.
The quick filters let you browse:
- Open or Closed code reviews
- Reviews that contain your changes
- Code reviews needing your attention
- Changes that you need to review
- Reviews assigned to you
Code review timeline
From the list of code reviews, you can navigate to its details. You’ll see basic details of the code review, such as who the authors and reviewers are. You can checkout the merge request’s branch if you want to have the full codebase at your fingertips.
The code review timeline is also shown, where you can see all comments and changes that were made during the lifetime of this code review. You can add and reply to comments, and resolve them.
In Space, everything is a chat. Code review comments are no different: you can write additional comments on the code review, and browse and respond to threads as well. Without having to leave the IDE!
Folks using the browser or Space desktop app will see any comments you add, either directly in the code review if they have it open, or in Space chat.
Reviewing code in the IDE
After you open a code review in the IDE, you’ll see a list of files that were added, changed, or removed. You can open them, and see what was changed using the IDE’s diff viewer. From this diff, you can add comments to any line of code.
Comments are saved as a draft, and sent at the end of your turn in the code review process. If needed, you can use Post now to send the comment immediately.
Accept changes, or wait for response
Once you’re done reviewing changes, you can finish your turn in the code review process. In the code review’s details, you can choose to:
- Accept Changes, when everything looks fine from your point of view; or
- Wait for Response, when you’ve reviewed the changes, but have open questions or concerns.
Any of these options will end your turn in the code review process, and post draft comments you added while looking through code.
There can be many reasons for a team to review code. Whether you want folks on your team to verify new code is clear, readable and doesn’t contain any serious flaws, or you want your code reviewed and approved before merging it to the main branch, you can now do this from within the IDE!
We’ll be expanding functionality of the Space plugin in future releases. What would you like to see? Let us know in the comments!