Plastic Scm Code Reviews: Best Practices

how to code review plastic scm

Plastic SCM is a version control system that allows users to collaborate on projects through peer assessment. Code reviews are an essential aspect of Plastic SCM, enabling users to request feedback and contributions from peers after completing work on a changeset or branch. This process helps identify bugs, facilitates knowledge sharing, and enhances control over the code. Plastic SCM also integrates with CodeCollaborator, a tool that allows users to review, annotate, and comment on various file types. By utilizing the CodeCollaborator client, users can send diffs from Plastic SCM branches, changesets, or changeset intervals to CodeCollaborator for comprehensive code reviews. The reviewer can then provide feedback and change the status of the code review accordingly, ensuring that any unresolved issues are addressed before merging the code.

Characteristics Values
Purpose Collaboration on projects through peer assessment
When to request After completing work on a changeset or branch
Benefits Catch bugs, share knowledge, enhance control, improve code quality
Components Conversations, Comments and replies, Questions and change requests, List of changed files
CodeCollaborator integration Review, annotate, and comment on source code, images, schematics, and shared documents
CodeCollaborator client Command line tool called codecollaboratorclient.exe, requires configuration file ccollabclient.conf
Review status Change request comment unresolved, Reviewed

shunpoly

Using CodeCollaborator to review diffs from Plastic SCM branches, changesets, and changeset intervals

Plastic SCM is a version control system that facilitates collaboration on Unity projects. It allows users to track multiple changes and collaborate through peer assessment. Once a user completes work on a changeset or branch, they can request a code review from another user to check over or contribute to the changes. This process helps catch bugs, share knowledge, and enhance control, thereby improving code quality.

CodeCollaborator is a tool that can be used in conjunction with Plastic SCM to facilitate code reviews. By using the Plastic CodeCollaborator CLI client (codecollaboratorclient.exe), users can send diffs from Plastic SCM branches, changesets, or changeset intervals to CodeCollaborator for review.

An example of this process is creating a review of the branch /main/task1346 in the repository myrep@myserver:8084. To do this, the following command can be used:

> codecollaboratorclient br:/main/task1346@myserver:8084

This command sends the diffs from the specified branch to CodeCollaborator for review.

Additionally, users can view diffs in Plastic SCM's Branch Explorer and Changesets views. By opening the Plastic SCM main window on one part of the screen and a diff window on another part, the diff window's contents will update when navigating through the Branch Explorer. This allows for a side-by-side comparison of different versions of the code.

shunpoly

How to request a code review and the different ways to contribute

Plastic SCM is a full version control stack that is not a Git variant. It offers a code review feature that allows users to collaborate on projects through peer assessment. Once you have completed work on a changeset or branch, you can request a code review from a peer to check over or contribute to the changes. This can help improve code quality by catching bugs, sharing knowledge, and enhancing control.

To request a code review in Plastic SCM, you can follow these steps:

  • Complete your work on a changeset or branch.
  • Navigate to the Code Review feature in Plastic SCM.
  • Request a code review from a specific person or team member.
  • Provide clear and concise comments or instructions about the changes you are requesting.
  • The reviewer will receive a notification about the code review request and can then review the changes.
  • The reviewer can add comments, replies, or questions in the Conversation tab or request specific changes in the Changed files tab.

It is important to keep in mind that asynchronous code reviews, where the reviewer and author are not simultaneously present, can often be more efficient and allow for better concentration. Additionally, providing clear and explanatory comments during check-in can greatly speed up the code review process and enhance collaboration.

There are different ways to contribute to a code review in Plastic SCM:

  • As a reviewer, you can add comments, replies, or questions in the Conversation tab to collaborate and provide feedback.
  • You can request specific changes to particular sections of code in the Changed files tab.
  • You can use the tracking feature to ensure that requested changes are applied by the author.
  • By default, a code review cannot be merged until a reviewer marks it as "Reviewed," ensuring that all comments and change requests are resolved.

shunpoly

The different tabs in a code review and their functions

Code reviews are a way to collaborate on projects through peer assessment. They help improve code quality by catching bugs, sharing knowledge, and enhancing control. Plastic SCM's code review feature integrates with CodeCollaborator, a software tool that allows users to review, annotate, and comment on source code, images, schematics, and shared documents.

Conversations Tab: This tab allows collaborators to interact and discuss the code review. Comments, replies, questions, and requests for changes can be added here. Each comment added to the code appears in the Conversations panel, creating a threaded discussion for easy reference.

Changed Files Tab: This section provides a list of all the files submitted for review, allowing users to filter, navigate, and view changes made to each file. Comments and questions can also be added to specific sections of code within this tab, making it easy to provide targeted feedback.

Review Status Tab: The review status tab helps track the progress and resolution of the code review. It includes statuses such as "Unresolved" for change request comments that need further attention and "Reviewed" to indicate that all comments have been addressed. By default, code cannot be merged until a reviewer marks the review as "Reviewed".

CodeCollaborator Integration Tab: This tab facilitates the integration of Plastic SCM with CodeCollaborator. Users can send Plastic SCM differences (diffs) from branches, changesets, or changeset intervals to CodeCollaborator for further review and collaboration. This integration provides a more comprehensive code review process, especially when working with various file types.

These tabs in the code review process enable efficient collaboration, feedback, and quality assurance for coding projects.

shunpoly

How to change the status of a code review

The new Plastic SCM Code Review system allows reviewers to easily track the status of a code review and make changes when necessary. Here is a step-by-step guide on how to change the status of a code review:

  • Navigating to the 'Changes' List: To change the status of a code review, reviewers can start by accessing the "Changes" list. This list provides an overview of the change request status, allowing reviewers to track whether the author has applied the requested changes.
  • Addressing Pending Comments: Before changing the status, it is important to address any pending comments or questions. The system warns reviewers if there are unresolved comments or required changes when attempting to change the status to "reviewed." By default, the “Request a change” option is selected when adding a new comment, encouraging the use of the “Changes and Questions” system.
  • Updating the Status: Reviewers can update the status of the code review by navigating to the applied changes. If a requested change has been implemented, clicking on its status will navigate to the changeset where it was applied. This allows for a clear overview of the progress and helps track the requested changes.
  • Utilizing Double-Click Functionality: The new Code Review system enhances navigation by allowing users to double-click on a change in the list to navigate directly to the applied change. This simplifies the process of reviewing and verifying implemented changes.
  • Collapsing Comments and Summary Panels: To focus on the code review status, reviewers can collapse the comments and summary panels. This increases the available size of the diff viewer, providing a clearer view of the code changes. The summary panel remains collapsed when there are no relevant changes or questions to display.
  • Verifying Requested Changes: To ensure accuracy, the window displays the requested changes as "Done" along with any new changesets created. This allows reviewers to verify that the requested changes have been correctly implemented and approve the code review status accordingly.

By following these steps, reviewers can effectively change the status of a code review in the Plastic SCM Code Review system, ensuring that requested changes are addressed and accurately reflected in the updated code.

shunpoly

The benefits of code reviews

Code reviews are an essential aspect of software development, offering numerous benefits that ensure the quality and success of projects. Firstly, they serve as a mechanism for bug detection and issue identification, enhancing the overall performance and reliability of the software. Code reviews provide an opportunity for developers to collaborate, exchange knowledge, and learn from each other's expertise and best practices. This knowledge-sharing culture not only improves coding skills but also fosters teamwork and association among team members.

Additionally, code reviews play a crucial role in maintaining coding standards and consistency, making maintenance more accessible and efficient. They ensure that the code adheres to established best practices, promoting robust and maintainable code. This is especially beneficial for remote and distributed teams, where workers handle tasks independently based on their expertise. Code reviews facilitate efficient task and skill integration, reducing overlap and misunderstandings.

Another advantage of code reviews is their ability to save time and costs associated with future maintenance. Research by SmartBear found that code reviews can reduce post-release bugs by up to 80%, underscoring their cost-effectiveness. Furthermore, IBM research indicates that code reviews can detect 60% to 65% of defects, surpassing many testing methodologies. Every hour spent on code reviews can save up to 33 hours in future maintenance, making them a valuable investment.

While multiple review cycles improve quality, it is important to manage the process effectively to avoid delays and frustration. A balanced approach that values both thoroughness and practicality is key. Starting with readability and simplicity ensures that the code is easy to understand and maintain. Additionally, a personalized approach that considers the experience levels of developers can ensure quality while respecting their experience.

Frequently asked questions

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment