Archive for September, 2007

Customizing TeamCity notifiers’ templates

Tuesday, September 25th, 2007

TeamCity users can get notifications on different events of the projects they are watching, such as build start and failure, notifications on successfully completed builds or changing of the person responsible for the build failure. TeamCity has a number of means of notifying users on such events:

In the latest EAP build, we have also implemented the RSS feed notification on finished builds of the particular build configuration.

All notifications have a standard layout but the administrators can customize the notification templates to better suit the needs of a particular project or the company’s typical workflow. You can access and modify these templates in a dedicated notifier configuration file (not in TeamCity web UI).

The notifier templates are stored in the notifier configuration file of TeamCity Data Directory. The syntax of the notifier configuration files is described in the *.dtd files and contains two customizable sections:

  • <templates/> - specific templates with notification messages
  • <events/> - the list of events to be notified on and referenced with the associated templates

All additional templates you want to be used are placed into the <templates> section, and each notifier type template must have a specific tag or sub-element or the notification text is put within the <template/> tag. All templates are attached to specific events such as build start, failure and others. Each notification event supports a specific set of substitution patterns. These are:

  • “build_started”
  • “build_successful”, “build_failed”, “build_failing”
  • “responsible_changed”

After you have modified the notifiers templates, TeamCity server applies changes on-the-fly.

One more notification event (also customizable) - the build is probably hanging - has appeared in one of the latest TeamCity 3.0 EAP builds.

The concrete examples of customizing the notifier templates are available in TeamCity online reference.

Technorati tags: ,, , , , , , , , , ,

A new TeamCity EAP build: statistics improvements, build tags, search, and more

Friday, September 21st, 2007

We are glad to announce the new EAP release of TeamCity 3.0. This release provides a number of useful and long-awaited features.

  • Search by the build number. The found builds are displayed in a pop-up window, and you can also view the found builds on a separate page:
  • searchresults.png

  • A brand new feature: build tagging. The easy to apply labels help you to better organize the builds history and quickly navigate to the builds marked with the specific label. You can apply multiple tags for a single build, for example, “EAP”, “release”, and others:
  • tag.png

  • Possibility to take the thread dumps for both Java and .NET build processes. This new feature helps to investigate the problems of the currently running build right from the web UI:
  • theaddump.png

  • Numerous statistics-related improvements:
    • Builds range and status filters added
    • Code coverage statistics graph is added with 4 series for class, method, block, and line coverage
    • Build sources checkout time now can be extracted form the full build duration time and is displayed as a separate Clean build duration graph:
    • builddurationgraph.png

  • Subscription to the finished builds RSS feed of the selected build configuration to help you stay up-to-date with the current projects status. Click the Subscribe link located at the bottom of the build configuration page and configure your feed reader to monitor TeamCity builds RSS.
  • subscribetofeednew.png

  • Several VCS-related improvements:
    • per-VCS root user names (possibility to set a specific username for each VCS root)
    • VCS trigger quiet period: TeamCity triggers a build only if there are no changes for the specified time in all VCS roots of a build configuration
    • VCS triggering filters by VCS user and VCS root (allows to prevent build triggering after changes submitted by a particular user or changes from a specific VCS root)
  • Miscellaneous improvements including ability to view a web diff for personal changes, ability to edit TeamCity server URL through the web UI and VCS roots attaching from the project’s page.

And as usual, the new release includes multiple bugfixes and performance improvements.

View the release notes and download the latest build. We eagerly wait for your feedback at our discussion forum.

Technorati tags: ,, , , , , , ,

The Mighty Build Queue

Tuesday, September 18th, 2007

Builds in TeamCity can be initiated by a variety of different triggers. These can be, for example, a change in the VCS, the successful build of another build configuration, or a schedule-based or manual trigger. Developers can also start personal builds with a pre-tested commit from their IDE. As soon as the software build has been initiated, it is added to the build queue, which you can monitor in the dedicated Build Queue tab.

buildqueuetabsmall.png

Since we released TeamCity 2.1 we have polished the interface of the Build Queue tab, which now provides more detailed information on a pending build status including:

  • the expected build start time
  • the expected build finish time with the estimated build duration available in the tooltip
  • the build agent where TeamCity plans to run a build
  • what triggered a build
  • a list of build agents which can run the build (additionally the current agent status is available in a pop-up window)

This information makes it easier to better manage and monitor the process of creating builds on TeamCity’s build grid:

Build Queue Example

If there are several compatible agents TeamCity tries to run the particular build on the agent with the shortest estimated build duration. Time estimates are calculated based on the builds history and the build agent on which the build is scheduled to run.

It has been possible to reorder the build queue by dragging and dropping or removing the desired build from the queue since the first version of TeamCity. With introduction of project-based user roles in the upcoming version of TeamCity, only users with the necessary rights (as defined by the TeamCity Administrator) will be able see the project’s build configurations on the Build Queue tab.

We hope you’ll find these feature improvements helpful and look forward for your feedback at our forum.

Technorati tags: , , , , , , , ,, ,

Code Duplicates Search

Friday, September 14th, 2007

As we mentioned in our previous blog post, TeamCity has a number of ways to verify the code quality. Searching for repetitive blocks of code - known as code duplicates - is one of them.

The redundant and seemingly harmless pieces of code may eventually lead to an unmanageable project code base. Our own team is a really good example: searching for code duplicates in the IntelliJ IDEA project locally took about 40 minutes, and it was almost impossible to constantly monitor the state of the code base. But as soon as we implemented the server-side search for code duplicates:

  • all of the team members had access to the duplicates report and could make the code base better structured and controlled;
  • unnecessary pieces of code were removed, thus reducing the overall size of the code base;
  • the code base became much more manageable;
  • the developers were able keep on coding as usual because the duplicates were searched for on the server, and their own machines resources were not used.

TeamCity has supported searching for Java code duplicates for quite some time. Support for finding C# duplicate code will be available in TeamCity 3.0. We are working on the possibility of configuring the Java duplicates finder to work not only via an IntelliJ IDEA project file, but also by using the Eclipse project file or a Maven POM file. Setting up a build configuration with the Duplicates finder runner ensures that all of the integrated code is constantly checked for duplicates.

When specifying this runner settings for Java projects, you need to point TeamCity to the project .ipr file and set a number of options, in particular:

  • searching or ignoring the duplicates in the test sources of your project if it does not make much sense to verify tests for duplicates
  • whether to regard usages of different variables, fields, methods, types, or literals in otherwise structurally similar code as duplicate
  • the minimum relative size/complexity of a code piece that will be regarded as a duplicate

The duplicates search is, as usual, performed on one of the available build agents, and when a build is finished, a detailed report is available in the web UI. Working with code duplicates results is similar to working with the server-side inspection results: after the build is finished, you can browse the duplicates list (build results page, Duplicates tab) and opt to show all or only the newly discovered duplicates.

Duplicates report

The top left panel displays a list of found duplicates and their instances with the file names. Use the arrows to examine the selected duplicate in one of the lower panes.

From the duplicates report page you can jump to the source code in your IDE (IntelliJ IDEA, Eclipse or Microsoft Visual Studio). Click the Open in active IDE button, and you will navigate directly to the file containing the duplicate instance and be able to quickly revise the issues found. In IntelliJ IDEA you can work with found duplicates either in the editor or in a tool window.

Keep an eye on our Early Access Program!

View the example of a server-side duplicates search at our demo site.

Technorati tags: , , , , , , , , ,

TeamCity’s server-side code inspection at your side

Tuesday, September 11th, 2007

TeamCity has an unparalleled variation of means for maintaining code quality:

  • search for duplicated pieces of code for Java and .NET projects (.NET support is now available in TeamCity 3.0 EAP)
  • server-side code inspection of Java code (more than 600 IntelliJ IDEA’s inspections are used)
  • analysis of Java code covered by unit tests

With server-side code inspection the whole project codebase is tested as often as you need. The developer’s machines are kept free, so no real development time is stolen. All the developers’ changes to the source code are integrated into the codebase are checked to make sure that they conform to coding standards and guidelines. Besides, TeamCity detects probable bugs, pieces of “dead” code, performance issues and supports many technologies including EJB, JSP, and JSF.

To inspect your code remotely on the server-side, set up a build configuration with the Inspection build runner and point it to the IntelliJ IDEA project file (the detailed procedure is described in TeamCity reference):

inspectionsbuildrunner.jpg

After the build is completed on any of the preconfigured build agents, TeamCity allows you to review the inspection results in the web UI (the build results page, on the Code Inspection tab). You can then quickly navigate to the file containing the issue found in your IDE (IntelliJ IDEA and Eclipse are supported).

You have the option to browse all or only newly introduced code problems as well as filter the problems considered errors.

inspectionspage.jpg

The server-side inspection results can be downloaded into IntelliJ IDEA, thus, you don’t need to switch to TeamCity’s web interface to review the code inspected: from the TeamCity menu, choose Code Inspection. Then you can view the inspection results in the editor and apply quick-fixes (solutions for discovered problems) or work with inspection results in a toolwindow. It’s up to you and depends on your IntelliJ IDEA working habits.

inspectionstoolwindow1.jpg

To sum things up, the server-side code inspection has a number of pros:

  • developer’s machines are not slowed down and the feedback loop becomes much shorter
  • project code quality is maintained during the project’s entire lifecycle
  • integration with IntelliJ IDEA provides ideal web-IDE navigation possibilities
  • quick-fixes let you solve most problems on-the-fly

View the example of server-side code analysis at our demo site.

Technorati tags: , , , ,, , ,

Project and build configuration VCS settings revised

Thursday, September 6th, 2007

Until now the build configuration used VCS roots that were defined in the project. Numerous TeamCity users asked for more flexibility when setting up the VCS roots, so we decided to make a number of refinements in this area. You asked, and we listened. :)
First and foremost is that in TeamCity 3.0 you can define VCS roots for any build configuration of your project, and the build configuration’s VCS roots settings are independent of the project. Specify any number of VCS roots when you create a new build configuration or edit the existing ones:

VCS settings setup

Another neat feature is shareable VCS roots. Once you decide to use the same VCS root for a group of your projects, you eliminate a bunch of redundant operations. This option is set when you specify the general settings of a build configuration:

vcsrootssharing.jpg

Technorati tags:  , , , , ,, ,

Monitor a project’s status without… TeamCity

Tuesday, September 4th, 2007

TeamCity has multiple ways to monitor a projects health. First and foremost is, of course, the user dashboard. Then come the plugins for the IDE’s that TeamCity currently integrates with (IntelliJ IDEA, MS Visual Studio, and Eclipse), standard e-mails, Jabber/XMPP protocol instant messages, and the Tray Notifier. But all these methods require either a TeamCity login, or some installation and customization procedures.

We decided to make it easy for software development teams to let their customers and other outsiders (who are not interested in the build process) monitor the builds’ status. No special magic - just insert a small HTML fragment into any web page:

  • company’s website,
  • blog,
  • Wiki,
  • Confluence.

And get an overview of the current project status: the latest build results, its ID, date and a link to the latest build artifacts:

externalstatuswidget.jpg

This “version” of the projects dashboard does not require a login of any kind and of course the builds’ status is being constantly updated.

To start using this feature you have to either create a new build configuration or edit the general properties of an already existing one and select the Enable status widget option. The cues on the HTML sources to paste into your web pages are, as usual, in the TeamCity online reference.

Technorati tags: , , , , , ,, , ,