Posts Tagged ‘JetBrains’

JetBrains Apparel Store News

Friday, December 16th, 2011

A year ago, we launched our Apparel Store.
Throughout this year, we have fulfilled hundreds of orders, significantly improved our service and delivery.
The best news is that free shipping within the US is now included in the price. An extra $9 will take your T-Shirt to any part of the World. To tell you the truth, the price of the T-Shirt is now calculated on a zero-profit model.
Adding more cool products and other improvements is on the agenda. Your feedback and ideas are appreciated!

If you haven’t chosen a Christmas present for a colleague or for yourself, why not consider a YouTrack T-Shirt?
Order by the end of the week and get it for Christmas!*

—-
*in the USA. European customers can choose express shipping to meet the deadline.

Streamlining Issue Management with GitHub and YouTrack

Thursday, October 27th, 2011

The Typical Developer Workflow

image

* Thanks to @gregyoung for enriching me with whatthecommit.com

In general, as developers we hate uninteresting tasks such as managing issues, so the less time and effort we spend in tracking bugs and features the better. The worse case scenario is the one outlined in the previous workflow, i.e. work on a bug, comment the fix in source control and then separately manage the issue in an issue tracker. Ideally, we’d like to only have to indicate what we’ve worked on and how it’s related to a check-in once! And fortunately with YouTrack, we can. However, YouTrack goes one step further. It actually allows us to control issues from our source control. Let’s see how this plays out when it comes to using GitHub.

 

In essence we have two options when it comes to integration GitHub:

  • Directly via GitHub Service Hooks.
  • Use TeamCity as the gateway, which in itself offers other advantages (opening it up to other VCS’s too).

 

We’ll cover each of these in detail.

YouTrack and GitHub Service Hooks

Earlier this year, GitHub provided official support for YouTrack hooks, allowing for tight integration between the two systems. This makes it extremely easy to set up YouTrack for issue management.

Assuming we have a project already set up on YouTrack and GitHub:

1.  Click on the project in GitHub and select Admin

2. Select the Service Hooks from the left-hand side menu

image

3. At the very bottom of the list of Service Hooks, select YouTrack

image

4. Enter the following information in the form provided

image

A few things to note here:

  • Base Url is the url of your YouTrack server, which is independent of the actual project.
  • Committers is the group in YouTrack that has permission to commit to source code for the particular.
  • Username should be a user on YouTrack with Server Admin rights [In an upcoming release this will change to only require Project Admin rights].

 

5. Switching over to the YouTrack side, the only thing required is the to create the Committers group and add the correct users to it. This step isn’t required but it’s good practice to limit the users that can update an issue to those associated with the project.

6. A last important step (which is performed once only)  is to make sure the REST interface is activated on YouTrack (via the Administration Settings)

image

Putting it to work – Hello YouTrack Commands

Now that we have the two systems linked up, how do we actually get this to work? If you’re not familiar with YouTrack, you might not know about an amazing feature it has called commands.

When most people look at YouTrack, all the see is just another web application with links to click on. However, the true power of YouTrack is in it’s support for commands, which is basically a way of sending it different pieces of text that it understands. This is normally done using the Invoke Command window (Alt+Ctrl+J…yes YouTrack is VERY keyboard friendly):

image

We start typing text and YouTrack offers us completion and tries to figure out what we’re trying to do. It’s smart enough that it doesn’t need us to spell things out, i.e. instead of having to type “state: fixed assignee: hhariri”, we can just type “fixed hhariri” and it figures out the rest:

image

It even remembers recent commands we’ve applied to offer the same combinations to us on the next input.

Now if we take this concept of commands and combine that with the usually useless commit messages we can actually come up with something useful! We can use the commit messages to send YouTrack commands (in fact, with YouTrackSharp I’ve started implementing PowerShell commandlets to allow console support for YouTrack too). As such, from our console our Git GUI we can do the following:

image

What we’ve done here is provide a command as commit message. We’ve identified the issue we’re going to apply the command to (issue Id prefixed with #) and followed it by the command Fixed.

Once we do this and push it to GitHub, the Service Hooks in GitHub will now supply this information to YouTrack, which in turn parses the command and applies it to the issue:

image

Notice a few things here:

  • The issue’s history has been updated with the date/time it was resolved along with a comment saying it was emitted via commit by hhariri.
  • The issue has been actually marked as Fixed.
  • The Username is clickable. It has correctly identified the username that checked in and mapped that to the YouTrack user. How does it do know that? Simple. It’s based on the email address. That’s why it’s important to have the correct email address associated with both account.

Multiple Issues

YouTrack also supports multiple issues being updated via the commit message. In order to do this via the commit message, each issue should be on it’s own line (i.e. when using the console, don’t provide the –m option with the commit and have Git prompt you with an editor to input comments).

Also it is important to note that the commit messages are not limited to just the “Fixed” command, but other commands can also be added such as tagging an issue, etc. (comments currently is not supported).

Integrating GitHub (or any VCS) with YouTrack via TeamCity

The second option for integration between YouTrack and GitHub is using TeamCity as the gateway. The advantage to this mechanism (apart from using TeamCity!) is that it now opens the door to more VCS options, including Subersion, Perforce, Git, Hg and all VCS’s that TeamCity supports.

The steps to integrate YouTrack and TeamCity are pretty straightforward:

1. Click on YouTrack Administration and select TeamCity Integration

image

2. Select to Enable TeamCity Integration and click on the Add TeamCity Server link

image

Enter the information as described in the dialog box and click Save.

3. Once the server is set up, we now need to define the mappings between TeamCity and YouTrack projects. For that, we click on the define mapping link:

image

We need to define pretty much all the values in the dialog box (which are self-descriptive).

In addition to the minimum required settings, we can also define restrictions on which groups have access to viewing issues via the Permissions tab, as well define a default command to be set on issues affected by failed builds:

image

4. In order to get the User Mapping, YouTrack like before uses the Email address. As such, we need to make sure that our VCS is configured to map to email. This is done on the TeamCity side under My Settings and Tools which is located under the Username menu [Note we have now switched to TeamCity]:

image

We edit the corresponding settings and set the Git roots to use email:

image

5. That’s all that is needed in order to get VCS commands working via TeamCity acting as gateway. This will now provide us information and output like the following in YouTrack when sending a fixed command via a commit message:

image

With this, a new Tab appears on YouTrack named TeamCity which contains information about the commit being made along with a link to the username.

We could in essence stop right here. The next step however is to go full force and get some of the added benefits of integrating TeamCity and YouTrack, this time from TeamCity’s side.

6. Under TeamCity Adminsitration click on Server Configuration and then on the Issue Tracker tab

image

7. We now need to create a new connection by clicking on Create New Connection, and entering the following information:

image

Once we test the connection we can click Create and we’re done. From this point on, we can click on Changes and have drill-down information on issues, link directly to them, etc.

Summary

As we can see, there are two ways to integrate YouTrack and TeamCity. The former requires a little bit less of a setup but is restricted to GitHub (currently). The latter gives us the full benefit of having a tight integration between TeamCity and YouTrack and opens up the door to using any VCS that TeamCity supports.

Most importantly however, the purpose of all this is to streamline the process, making issue management simple, non-intrusive and easy to work with.

 

[Note: If you’re an OSS project lead, note that TeamCity and YouTrack Integration are already setup on Codebetter.com. Ping me if you need help setting up your project details to take advantage of what’s been explained here].

Webinar: Working with TeamCity, YouTrack and an OSS Stack

Sunday, April 3rd, 2011

On Tuesday I’ll be giving a webinar (in Spanish) on how to setup an environment with TeamCity, YouTrack and your favorite OSS tools and frameworks.

 

Things we’ll see:

 

TeamCity: Overview and benefits

YouTrack: Mouseless Web Issue Tracking

Introduction to Distributed Version Control Systems and benefits over Centralized

Creating Continuous Integration Processes with TeamCity and OSS stacks

Integration with Visual Studio and other IDE’s

 

The webinar will be roughly 2 hours and it will be mostly demo-centric.

It is a completely free event. If you’d like to attend, please register here

Generating Graphs for YouTrack with HTML 5 and jQuery

Tuesday, December 14th, 2010

A few days ago, a customer of ours asked me if it would be possible to visualize statistics in graphs in our Bug Tracker YouTrack. Answer is Yes. Since YouTrack offers a “ReSTful” API, you can obtain pretty much any kind of information you want from it and once you have this information, you can then display it however you wish, be it a table or a graph.

 

Let’s see how.

 

What we’ll be using…

One of the great benefits of jQuery is the rich ecosystem it offers. There’s a plug-in for pretty much everything you need, even for displaying graphs. In fact there are quite a few. We’ll be using jQuery Visualize. We’ll also be using jQuery (I’m using 1.4.4 but should work with older version) and jQueryUI, which is needed by jQuery Visualize. Finally we’ll also need jQuery Templates (I’ll explain why later on).

Don’t worry about downloading each individual file. Everything you’ll need is included in the demo code attached to this post.

Getting the information from YouTrack

For this demo, what we want to do is create a chart containing Issue counts for different projects. In particular, we are interested in Open, Fixed and Duplicate issues for ReSharper, dotCover and dotTrace:

image

In order to get this information from YouTrack we have to make a request to count the number of issues based on filters, i.e  ReSharper + Open, ReSharper + Fixed, etc.*. The URL for this would be:

http://youtrack.host.com/rest/issue/count?filter=project:ReSharper%20state:Fixed

which is nothing other than a URL encoded version of a search expression we can enter directly into YouTrack’s web interface,but to the rest API. We therefore need to send requests from our web page to YouTrack to obtain this information. The way we can do this is with Ajax and JSONP which YouTrack supports. Using jQuery.ajax, our code would look like this:

image

Problem is, this wouldn’t work, or at least, not always. When requesting a count of issues by YouTrack, the response is not immediate. YouTrack will free the request and will spin off to calculate the count. Once it’s complete it will then store the information in the cache. Next time a request is made, the value from the cache will be returned. What this means to us is that if we fire off a request, if it’s a cache miss, then we will get back a –1 instead of the actual count. We would therefore need to send a new request, until we get a value greater or equal to 0. This is not complicated to do with JavaScript and in particular with jQuery. It merely consists of polling for a result. But like all things jQuery, before you re-invent the wheel, check to see if there’s already a wheel and it turns to your liking, something which in this case does. This alternative to $.ajax allows us to poll servers and only process the result if a condition is met. As such, our previous code would now look like this:

 image

(the polling interval can be set for the calls. Here we’re using the default value).

In terms of requesting information from YouTrack, that’s all there is to it. What we need to do now is repeat the process for each project and status type and store the value.

[* Currently YouTrack does not support grouping so multiple requests will have to be made. This feature is planned however]

Representing the information as a table using jQuery Templates

We want to do two things with the results, represent them as an HTML table and display them as a graph. The data retrieved from the server is given to us as an array of objects (something we did in the code ourselves), where each object has a one property indicating the Project and three additional properties with the values of each status:

image 

We would now need to iterate through this array and generate a table from it. Instead of doing this in an ugly way by mixing tags with data, we can take advantage of jQuery templates (if you are not familiar with templates, you can think of them as a view engine for jQuery). What we do is define a template and then make a call to a function that replaces placeholders with our data. If the data we provide this function is an array, it will repeat it for each entry.

image

The code first creates the template for the markup we want to generate, which are rows of a table. It then calls the template function to create a compiled version of the template which will then be passed in to the tmpl function along with the data (the series variable). The call to appendTo is a jQuery method which adds the contents of the object it’s called on to the item passed in to the selector (in this case #rows). 

In the body section of our page, we can then define the rest of the table, which includes the header and the tag for the table body:

image

Creating the Graph

So far we have retrieved the information from YouTrack and created an HTML table to display it. Our main objective however was to also display this information graphically. That in fact is the easiest part. One reason we are using jQuery Visualize is because it can easily convert a table into a graph (it supports different types of graphs, including lines, pies, etc.). All we need to do is call visualize on a table.

image

That’s all there is to it. Once we put all the pieces together, we will end up with the following page:

image

This chart works in all browsers I’ve tested (IE 9, Opera, Firefox and Chrome)

Summary

The complete code for requesting information from YouTrack and generating the Graphs is available on my GitHub Blog repository. Once you examine it, you’ll see that it’s very few lines of code, thanks to the rich ecosystem around jQuery. I’m sure it can even be improved further, since I am by far a jQuery expert and can also be made a bit more generic to allow for different statistics to be obtained without change to the source.

I’m currently working on YouTrackSharp which is a wrapper for YouTrack requests in C#. So if you’re interested in doing the same thing from C#, you will soon be able to do.

As always, if you have any questions please leave a comment.

Enjoy!

Final JetBrains Be Wiser Party Preparations are Under Way!

Monday, September 20th, 2010
This is the last call to register for JetBrains Be Wiser Party @ JavaOne. The party begins at 8PM, September 21st at the 21st Amendment Brewery. Fresh beer is on tap, food has been ordered, and great prizes have been bought. Our team is on the ground in San Francisco and ready to have some fun!

If you are attending JavaOne, stop by our booth at the Hilton Hotel exhibition hall to say hi and pick up an official party ticket. We have limited numbers so stop by early!

Alternatively, you can learn more about the party and register to join us while there is still free space at http://bewiser.eventbrite.com/. You do not need to be attending JavaOne to join our Be Wiser party!

We hope to see you there.

JetBrains Be Wiser Party @ JavaOne San Francisco
September 21st, 2010 at 8:00 PM
21st Amendment Brewery
563 2nd Street
San Francisco, CA 94107

Develop with Pleasure & Celebrate with Passion!

JetBrains Be Wiser Party @ JavaOne SF

Wednesday, September 15th, 2010

September 21st, JetBrains will host a free community party at the 21st Amendment Brewery Restaurant in San Francisco. Meet with friends and enjoy lively conversation in a relaxed atmosphere over free food and drinks, just a few blocks from the Moscone Center. The party begins at 8PM and we welcome all JetBrains fans to join in the action, as you do not need to be registered or attending JavaOne to take part.

Be prepared to unleash your inner geek and go for the top prizes in our Be Wiser contest. This is a great opportunity to cash in on your knowledge of IntelliJ IDEA and JetBrains to win fantastic prizes including: gadgets, licenses, gift certificates and more. There will be a wide array of questions varying in degrees of difficulty, so participate, have fun and learn something new in the process. Nobody will go home empty handed as we will have plenty of our 10th Birthday t-shirts available.

Please make note of the party schedule:
8:00pm – 8:30pm: Arrival, Appetizers
8:45pm – 10:00pm: Contest
10:00pm - ? : Food, Drinks, Relax

Registration is required and space is limited so we recommend that you register immediately.
Please be sure to print and bring with you to the party, the Eventbrite ticket you receive via email. If you have any questions or issues please feel free to stop by the JetBrains booth at JavaOne or contact (robert) (DOT) (demmer) (AT) (jetbrains) (DOT) (com).

We hope to see you there!