Over the past few weeks, we focused on pull requests. We already had enough tools to make the life of reviewers easier, but we knew we could do better.
First, now that Github moved their GraphQL API out of beta, we could activate the Github review system by default for every repository.
And we also integrated the "request review" feature from Github, with some small additions:
- filtering, with a default filter to easily see for a repository which pull requests you are requested to review
- a board view, so it's easy for a manager to see who is expected to work on which part, and it's easy to change the requested reviewers of many issues at once
But the main features we added are: pull-requests states, and diff modes.
You know what's worth a thousand words? An image... So we'll use screenshots, by explaining them, to discover these two features.
Let's say you are in a repository and you see this in the activity feed:
It says that the content of this pull-request, ie the code, has changed.
You have some interest in the issue solved by this PR so you open it and go to the "Files changed" tab.
You now see this:
It seems like nothing changed except this little box on top of the files list.
Let's zoom in:
Yes, you read and understand correctly. You can see previous states of the pull requests, and compare between states.
A "state" is a version of the code of a pull request. It's not rare to update a pull request after our first push, for example to add more work, or simply after a review.
These states are helpful to see how the code evolved in time.
Let's see the very first state:
It will open a new tab in the pull request, showing the same "Files changed" view, but back in time:
The block presenting the state reflects where (when...) we are:
Now that we seen how the first version of this pull request was, let's be curious and see how it evolved.
The first step is to compare this first state, with the second one:
Again, a new tab will open, but this time, only the changes between the two states are shown:
We can see that there is only one file that was changed after the first push. It seems to be only spaces, though:
If I'm not interested in reviewing space changes, there is a solution.
Let's open the menu:
And click on "Attenuate white space changes".
The result is this:
We can still see the "-" and "+" showing what changed, but as there are only white-space, lines are not colored.
But it's now hard to read. It could be ok in some cases, for example a single line added, etc, but not here. We could use a "two-panes" diff....
Oh wait, remember the menu with the "Attenuate white space changes" and the hidden entry?
Let's unveil it:
Yes, a new mode. Let's click this "Display two-columms diff" menu entry.
The result is this:
We can now, on each side (left is "previous version", right is "new version"), read the code.
Ok so I read this, and now I want to see the next change.
To help you doing this faster, we included arrows in thte block presenting the state. Block that, in this "compare" mode, display the two states being compared:
Here there is no additional information about each states, which means that they are all based on the same branch (the branch for which the author wants the pull request to be applied on), on the same version of this branch. But:
If the branch changes between two states, the two branches (before/after) will be shown.
If the branch is the same but not its version (the HEAD commit), it's because a rebase was done, and it will be indicated.
On the left of the two states, we can see an arrow. We are comparing states 1 and 2, and this arrow allows you to see the next step: the comparison of the states 2 and 3.
Of course then you'll have the sam arrow, and a left arrow to see the comparison between states 1 and 2.
It's the end of the presentation of these new features that, we hope, will ease your work with pull requests.