Hudson and Jenkins Plugin

Introduction

Contents

Description

The VersionOne Hudson/Jenkins integration creates a record of builds in VersionOne, so the development teams can associate stories and defects to a particular build. This visibility is useful when identifying problem builds or generating release notes.

Once the VersionOne Plugin has been installed, team members include a VersionOne identifier, such as "S-01454" or "TK-01234", in the comments of their SCM commit. Every time a build executes the publisher creates a BuildRun asset in VersionOne with details of the build. The VersionOne BuildRun is visible on the 'Relationship' tab of the Story/Defect Details page.

Using this integration you can better answer the following questions:

The following sequence diagram illustrates the VersionOne Hudson/Jenkins publisher behavior.

System Requirements

VersionOne:

Integration Server Operating System:

Continuous Integration Server:

Supported Source Code Management:

Downloads

The latest version of V1Publisher is available at V1: Integration Downloads

Installation

These instructions presume that Hudson or Jenkins is already installed, configured, and working properly.

  1. Ensure Connectivity
    Verify that you can connect to your VersionOne instance from the machine hosting Hudson or Jenkins
  2. Extract Files
    Download VersionOne plugin from the link above and extract it into a folder of your choice. This can be a temporary location since we will copy some of these files during configuration.
  3. Configure
    1. Configure VersionOne
    2. Configure Hudson/Jenkins
  4. Verify the installation
    Once configuration is complete use the following steps to verify that the build integration is working
    1. Navigate to your Hudson/Jenkins instance
    2. Force a build on the project you configured
    3. Wait for build to complete
    4. Navigate to your VersionOne instance
    5. Login
    6. Select VersionOne project in 'My Projects' dropdown
    7. Navigate to the Reports | Reports Overview page
    8. Select the "Build Run Quicklist" Report

Configuration

Configure VersionOne

If you are using Team Edition, you need to manually create the Build Project. Instructions for doing this are available on the VersionOne Community Site.
  1. Log into the VersionOne application as admin
  2. Navigate to the Admin | Configuration | System page.
  3. Check the "Enable Build Integration" checkbox and click the Apply button.
  4. Navigate to the Admin | Projects | Build Project page
  5. Click Add to add a new Build Project
  6. Specify the following
    • Name – this is how the Build Project will be known to VersionOne users
    • Reference – this is how the Build Project is known to Hudson/Jenkins
  7. Click Ok to save the new Build Project
  8. Navigate to the Admin | Projects | Projects page
  9. Click Edit on the row for the project you want associated with a Build Project
  10. Using the "Build Project" dropdown add the appropriate Build Project.
  11. Click Ok to accept the changes
  12. Logout

Configure Hudson/Jenkins

These instructions presume that you are logged into Hudson/Jenkins as an administrator.

  1. On the Hudson/Jenkins Dashboard, Click "Manage Hudson" (or Jenkins)
  2. Click "Manage Plugins"
  3. Click Advanced
  4. Under "Upload Plugin" browse to your download location and select the file versionone.hpi
  5. Click Upload
  6. Restart your Hudson/Jenkins instance in order to load the new plugin
  7. On the Hudson Dashboard, Click "Manage Hudson" (or Jenkins)
  8. Click Configure System
    There is a new VersionOne section at the end of this page
  9. Provide your VersionOne connection parameters

    If you connect to VersionOne through a proxy, check the "Use proxy server" checkbox and provide additional Proxy parameters
    It is recommended that you do not change the "Reference Field" or "Comment RegEx" fields. The "Reference Field" is the system name of the attribute to search when matching the ID in change comments with workitems in VersionOne. The "Comment RegEx" is used to extract workitem identifiers from the change comments.
  10. Test the connection
  11. Save the settings
  12. Choose the Job you wish to have published to VersionOne
    Remember that this job name must be configured in VersionOne
  13. Click "Configure" to configure the workspace
  14. In the "Post-build Actions" click the "VersionOne Notifier" checkbox
  15. Click "Save"

Technical Details

Adding Support for another source code management system

To add support for new VCS, the following actions are required.

  1. Add plugin reference to pom.xml, make sure that this dependency could be successfully resolved.
  2. Add a class wrapping native changeset type. SvnModification or PerforceModification are good examples on how to do it.
    New class must inherit VcsModification interface and provide parameterless public constructor.
  3. Modify VcsModificationWrapperFactory class to support new changeset type.
    It is required to add line similar to classNameMappings.put("hudson.plugins.perforce.PerforceChangeLogEntry","com.versionone.hudson.PerforceModification"). String literals are mappings of native changeset log entry classes to our custom wrappers in format supported by Java Reflection, so that instances and class objects could be successfully created. Changesets will be processed as soon as user installs the corresponding plugin and restarts Hudson/Jenkins server. In fact, our plugin won't start without its dependencies.