For most development teams, the final step in the development process is a pull request. Even if your team has decided to use New Relic CodeStream's feedback requests as a replacement for, and not just a precursor to, your end-of-cycle PR-based code reviews, CodeStream allows you to keep all of that workflow inside your IDE. The Pull Requests section of the CodeStream pane lists all open pull requests that are relevant to you, and gives you the ability to control the list via
custom queries.
Important
Pull request creation is available for GitHub, GitHub Enterprise, GitLab, GitLab Self-Managed, Bitbucket, and Bitbucket Server. Pull request review is only available in GitHub, GitHub Enterprise, GitLab, and GitLab Self-Managed.
The pull request section seperates PRs by those waiting for review, those assigned to you, those created by you, and the most recent PRs.
By default, you'll see your pull requests broken out into the following sections, which are really just default queries:
Waiting on My Review: Open pull requests where you are a reviewer, or a requested reviewer.
Assigned to Me: Open pull requests assigned to you.
Created by Me: Open pull requests created by you.
Recent: The five most recent pull requests created by you, regardless of status.
Click on any pull request in the list to edit, review or even merge the code. When you hover over a pull request's row you'll see more details, including the repo, branches and status. You'll also see an option to view the pull request on your code-hosting service toward the end of the row.
Hover over any section's heading for options to refresh the list, edit the section's query, or to delete the section.
The first section allows you to load any pull request via URL. Just grab the URL of any pull request, paste it in, and you can view it right inside CodeStream.
When you hover over the Pull Requests section heading, icons appear at the right.
Click on the gear icon for more options, including the ability to see pull requests from all repositories, and not just those associated with repositories open in your IDE, and the ability to include labels in the list.
Perks of reviewing using CodeStream
CodeStream does improve upon the GitHub and GitLab experience in a couple of important ways. On GitHub and GitLab you can only view the changes as a series of diff hunks. CodeStream provides that view as well, but if you'd prefer to see the changes in the context of the full file you can use either list view or tree view. Select the code you want to comment on and then click the Comment button, or select Comment from the context menu. When commenting, you can either add a single comment or start a review.
With CodeStream, you can comment on lines of code that haven't changed. You can select any lines of code in the diff and not just those that are part of the changeset. These comments are added as a single comment to the pull request and aren't part of any review you may have in progress.
Create a pull request
To open a pull request at any time, click the + button at the top of the CodeStream pane or the + button in the header of the Pull Requests section. You can also use a keyboard shortcut (ctlr+shift+/p, ctrl+/p on a Mac, and m if you're a GitLab user). CodeStream provides you with tree view, list view, and diff view options for reviewing your changes before opening the pull request.
With a single click you can name the pull request based on the last commit message, the branch name, or, if you started work by selecting a ticket, the ticket title. If you have a ticket selected, you can also explicitly tie the ticket to the pull request; CodeStream will include a link to the ticket in the pull request's description. Before submitting the pull request, review your changes by clicking on any of the files listed below the form.
If the feature branch you're working on doesn't have a remote-tracking branch, when you create a pull request, you can set your remote-tracking branch.
See also the following options to create pull requests:
CodeStream automatically detects when you're working on a fork and allows you to set both the base and head repositories.
You can also create a pull request from within a CodeStream feedback request. Once the feedback request has been approved, you'll see an option to open a pull request at the top. Before you can create a pull request, make sure you've committed and pushed any changes included in your feedback request.
When you create a pull request from a feedback request, CodeStream connects the dots between the two by adding a link to the pull request in the feedback request.
Add a link to the feedback request, along with information about who did the review and when, in the description of the pull request.
GitHub custom queries
By default, GitHub's search API does a global search across all of GitHub. As a result, you'll need to make sure that your query includes at least one of the following qualifiers to make sure that the result set is appropriately limited.
user:USERNAME
org:ORGNAME
repo:USERNAME/REPOSITORY
author:USERNAME
assignee:USERNAME
mentions:USERNAME
team:ORGNAME/TEAMNAME
commenter:USERNAME
involves:USERNAME
reviewed-by:USERNAME
review-requested:USERNAME
team-review-requested:TEAMNAME
project:PROJECT_BOARD
More details about GitHub's search syntax can be found here.
GitLab custom queries
All searches are done using attribute=value format with an & between each parameter. For parameters with a space in them, leave them as-is and do not put quotes in the parameter (for example, labels=foo,help wanted). You can use @me to specify your user id and user name otherwise they can be found on GitLab. All filters, by default, have parameter scope=all (see Minimum Qualifiers). To overwrite this, use scope=X. See the examples given below.
Return all issues or just those that are opened or closed
order_by
string
Return requests ordered by created_at or updated_at fields. Default is created_at.
sort
string
Return requests sorted in asc or desc order. Default is desc.
milestone
string
Return merge requests for a specific milestone. None returns merge requests with no milestone. Any returns merge requests that have an assigned milestone.
view
string
If simple, returns the iid, URL, title, description, and basic state of merge request.
labels
string
Return merge requests matching a comma separated list of labels. None lists all merge requests with no labels. Any lists all merge requests with at least one label. No+Label (Deprecated) lists all merge requests with no labels. Predefined names are case-insensitive.
with_labels_details
boolean
If true, response returns more details for each label in labels field: :name, :color, :description, :description_html, :text_color. Default is false.
with_merge_status_recheck
boolean
If true, this projection requests (but does not guarantee) that the merge_status field be recalculated asynchronously. Default is false.
created_after
datetime
Return merge requests created on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
created_before
datetime
Return merge requests created on or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
updated_after
datetime
Return merge requests updated on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
updated_before
datetime
Return merge requests updated on or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
scope
string
Return merge requests for the given scope: created_by_me, assigned_to_me or all. Defaults to created_by_me
author_id
integer
Returns merge requests created by the given user id. Mutually exclusive with author_username. Combine with scope=all or scope=assigned_to_me.
author_username
string
Returns merge requests created by the given username. Mutually exclusive with author_id.
assignee_id
integer
Returns merge requests assigned to the given user id. None returns unassigned merge requests. Any returns merge requests with an assignee.
reviewer_id
integer
Returns merge requests which have the user as a reviewer with the given user id. None returns merge requests with no reviewers. Any returns merge requests with any reviewer. Mutually exclusive with reviewer_username.
reviewer_username
string
Returns merge requests which have the user as a reviewer with the given username. None returns merge requests with no reviewers. Any returns merge requests with any reviewer. Mutually exclusive with reviewer_id.
my_reaction_emoji
string
Return merge requests reacted by the authenticated user by the given emoji. None returns issues not given a reaction. Any returns issues given at least one reaction.
source_branch
string
Return merge requests with the given source branch.
target_branch
string
Return merge requests with the given target branch.
search
string
Search merge requests against their title and description.
in
string
Modify the scope of the search attribute. title, description, or a string joining them with comma. Default is title,description.
wip
string
Filter merge requests against their wip status. yes to return only draft merge requests, no to return non-draft merge requests.
not
hash
Return merge requests that do not match the parameters supplied. Accepts: labels, milestone, author_id, author_username, assignee_id, assignee_username, reviewer_id, reviewer_username, my_reaction_emoji. See example above for how to format not as a hash type.
environment
string
Returns merge requests deployed to the given environment. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
deployed_before
datetime
Return merge requests deployed before the given date/time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
deployed_after
datetime
Return merge requests deployed after the given date/time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
Return issues assigned to the given user id. Mutually exclusive with assignee_username. None returns unassigned issues. Any returns issues with an assignee.
assignee_username
string array
Return issues assigned to the given username. Similar to assignee_id and mutually exclusive with assignee_id. In GitLab CE, the assignee_username array should only contain a single value. Otherwise, an invalid parameter error is returned.
author_id
integer
Return issues created by the given user id. Mutually exclusive with author_username. Combine with scope=all or scope=assigned_to_me.
author_username
string
Return issues created by the given username. Similar to author_id and mutually exclusive with author_id.
confidential
boolean
Filter confidential or public issues.
created_after
datetime
Return issues created on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
created_before
datetime
Return issues created on or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
due_date
string
Return issues that have no due date, are overdue, or whose due date is this week, this month, or between two weeks ago and next month. Accepts: 0 (no due date), overdue, week, month, next_month_and_previous_two_weeks.
iids[]
integer array
Return only the issues having the given iid
in
string
Modify the scope of the search attribute. title, description, or a string joining them with comma. Default is title,description
issue_type
string
Filter to a given type of issue. One of issue, incident, or test_case.
iteration_id
integer
Return issues assigned to the given iteration ID. None returns issues that do not belong to an iteration. Any returns issues that belong to an iteration. Mutually exclusive with iteration_title.
iteration_title
string
Return issues assigned to the iteration with the given title. Similar to iteration_id and mutually exclusive with iteration_id.
labels
string
Comma-separated list of label names, issues must have all labels to be returned. None lists all issues with no labels. Any lists all issues with at least one label. Predefined names are case-insensitive.
milestone
string
The milestone title. None lists all issues with no milestone. Any lists all issues that have an assigned milestone.
my_reaction_emoji
string
Return issues reacted by the authenticated user by the given emoji. None returns issues not given a reaction. Any returns issues given at least one reaction.
non_archived
boolean
Return issues only from non-archived projects. If false, the response returns issues from both archived and non-archived projects. Default is true.
not
Hash
Return issues that do not match the parameters supplied. Accepts: assignee_id, assignee_username, author_id, author_username, iids, iteration_id, iteration_title, labels, milestone, and weight.
order_by
string
Return issues ordered by created_at, updated_at, priority, due_date, relative_position, label_priority, milestone_due, popularity, weight fields. Default is created_at.
scope
string
Return issues for the given scope: created_by_me, assigned_to_me or all. Defaults to created_by_me.
search
string
Search issues against their title and description.
sort
string
Return issues sorted in asc or desc order. Default is desc.
state
string
Return all issues or just those that are opened or closed
updated_after
datetime
Return issues updated on or after the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
updated_before
datetime
Return issues updated on or before the given time. Expected in ISO 8601 format (2019-03-15T08:00:00Z)
weight
integer
Return issues with the specified weight. None returns issues with no weight assigned. Any returns issues with a weight assigned.
project_id
integer
Returns issues for the given project.
group_id
integer
Returns issues for the given group.
To search in a specific project use parameter project_id=X. Project IDs are listed when viewing the project on GitLab. Searching through a project, by default, uses scope=all and will return all merge requests or issues for the project specified. Only one project_id may be listed at a time.
project_id=23&state=opened&assignee_id=@me
iids[]=1&project_id=473&labels=bug
To search in a specific group use parameter group_id=X. Group IDs are listed when viewing the group on GitLab. Searching through a group, by default, uses scope=all and will return all merge request or issues for the group specified. Only one group_id may be listed at a time.
group_id=23&state=opened&assignee_id=@me
iids[]=1&group_id=473&labels=bug
By default, custom filters use scope=all which searches across all of GitLab. To avoid pulling all merge requests or issues listed on GitLab, you will need to refine this search using at least one of the following qualifiers:
scope=assigned\_to\_me
scope=created\_by\_me
project_id
group_id
author_id
author_username
assignee_id
assignee_username
my\_reaction\_emoji
Search syntax is derived from GitLab's custom search API. Refer to GitLab's documentation for more details on merge request searches or issue searches.
Review a pull request
Caution
Pull request review is currently not available for Bitbucket.
Regardless of where the pull request was created, you can edit, review, and even merge it from within CodeStream. If you know how to work with pull requests on GitHub or GitLab, you'll know how to do it in CodeStream as well.
To review a pull request:
Check the details:
You can edit a GitHub pull request's details, such as reviewers, assignees and labels.
For a GitLab merge request, you can use edit mode (via the dropdown at the top of the page) or use the sidebar. By default, you can only add a single reviewer and a single assignee to a GitLab merge request. If your organization supports multiple reviewers and assignees, click the gear menu in the heading of the Merge Requests section of the CodeStream pane to enable this.
Review the conversation and add comments with the ability to @mention your collaborators.
View the changes, add comments, and submit a review.