We live in a world of teams, and with teams comes communication about our software projects in terms of what work needs to be done and bugs that have been discovered. What if we could work directly in Rider on those GitHub issues that have been assigned to us?
In this post, we will be looking at two of these platforms, how to set up Rider to integrate with those lists of tasks and finally how to work with them inside the IDE. Let’s begin! Just remember that Rider supports YouTrack, JIRA, GitHub issues, Trello, GitLab and more!
Configuring Integration with Issue Trackers
The first thing we need to do is set up Rider and add the platform that our teams use for their issue and task tracking systems. In this post, we will be looking at YouTrack and GitHub.
You can configure task track under the Settings (Ctrl+Alt+S, I’m using the Visual Studio keyboard scheme here), then Tools | Tasks | Servers.
Configuring Rider with YouTrack
Setting up Rider to have access to tasks or issues in YouTrack is very easy. First, we will select the YouTrack server to be used for the current project in Rider. We will need the URL for it, along with our username and password. We can update some other options here, as well as test the connection.
We can also set up our solution so that we can navigate to tasks from Rider’s version control. Open Settings | Version Control | Issue Navigation and select the Add YouTrack Pattern button on the right side as shown below. We can now give the URL for our YouTrack server. With this set, commits that contain an issue number will be shown in the editor or version control history.
Configuring Rider with GitHub
We will next look at connecting to a GitHub repository and the issues associated. We will be making the assumption that we have set up two-factor authentication for our GitHub accounts.
Note: I would suggest setting up two-factor authentication (2FA) on GitHub. It is a very important security safeguard for our account. You can learn more about it on the GitHub’s blog post.
From the settings, under Tasks | Servers, we can add a server of type GitHub. We will need the host URL, which for GitHub is https://github.com. We also need the repository name and owner. We also need an API Token that will be acquired from GitHub.
To acquire the API Token from GitHub, we first need to select the Create API Token button which will present us with a dialog to log into GitHub.
After a successful login, we will receive the GitHub Authentication Code via one of two ways. Either we will receive an SMS message to the phone number associated with our account or from a two-factor application on our mobile device.
Upon entering a valid Authentication Code from GitHub, Rider will fill in the API Token text box with the Token that was retrieved. We can then test our connection to GitHub and save the server details.
Automatically set Commit Message
We can also create templates for Commit Messages when we are done and want to close the tasks being worked on. This is very helpful and can include not only the task id and summary but also information about the time the item was closed, how long we worked on the item and the project name.
Working with Tasks inside Rider
All menu items to work with Tasks are all located under Tools | Tasks & Contexts. We will look at how to find the task to work with, open a task and finally close a task.
Working with YouTrack Tasks
When we want to open a task from YouTrack, we will be presented with a dialog showing the open tasks from YouTrack. We can search on the list of open tasks. We can also create a new task if needed by selecting the Create New Task item in the list. If we want to read the description of the task along with any comments we can use the Ctrl+Shift+F1 shortcut.
When we have selected a task to open we will be presented with the ability to change the task/issue state. This list will be taken from the current state list on the YouTrack server.
If we want to see the task on the server, we can always use Tools | Tasks & Contexts | Open <Task> in Browser or use the Alt+Shift+B shortcut.
When we have completed or are done with the task in Rider we can now close the task. To close the task either use the Tools | Tasks & Contexts | Close Active Task… or use the Alt+Shift+W shortcut. We will be presented with a dialog to close the task and if needed update the state of the task on the YouTrack server.
Working with GitHub Tasks
Opening a task in GitHub is very similar to YouTrack we looked at earlier. We can perform the same search and we can create new tasks that will be added to the GitHub repository as an issue. The one difference between YouTrack and GitHub is the branch name for the task will be shown for each open item in the list. An example from the screenshot below is ChinookASPNETCoreAPITier-11 branch for the open task “Implement the Dapper Data Repositories”.
We can also see and select closed tasks by checking the Include closed tasks checkbox. The closed items will be shown in a dimmer font.
When we do open a task from the list of GitHub items, we get a dialog that allows us to work with the details and that will involve also some Git potentially. Since there is an implied work with this task, GitHub assumes that any work will be done will need a new branch or we can select another branch.
If there were any code changes that had not been dealt with upon the opening of the task, we have the opportunity to shelve those changes using the Shelve current changes checkbox. We can also update the state of the task from the current list of states from GitHub.
When we are done with the task in Rider, we close it out. The current branch can be committed and/or merged along with the new state change for the task. This can all be done using the close dialog shown below.
The nice benefit of working with tasks inside Rider is the ability to switch from one task to another without losing our work. We can easily multi-task using the Version Control Tool Window (Alt+9). When we make another changelist active using the Set Active Changelist menu item on the Changlists button on the left side of the tool window, the code changes will stay with the associated changelist. Great experience when we need to switch what we are working on during our workday.
The Task features for Rider offer a powerful way to interact with work items and bugs for effective teamwork. There are many other third-party services that we can work at and we hope all developers using Rider have a great experience working directly with their daily work needs using Rider.
Download Rider 2018.3.3 and give it a try! We’d love to hear your feedback!