Collecting reporting data with the Git plugin

2 minute readExtensibilityDeveloper productivity
On this page

This plugin provides integration with CloudBees Analytics dashboards to focus on key metrics across releases and pipelines - from code commit to deployment. The ability to visualize this information as dashboards enables enterprises to understand the overall status of their release and deployment process, identify hotspots that require action, understand trends, and find opportunities for further improvement.

You can set up dashboards by adding data sources for different external tools you are using in your release. The supported tools are based on the installed plugins that support collecting data for the dashboard to send to the CloudBees Analytics server. For more information, refer to CloudBees Analytics built-in dashboards.

Code commit

Collects reporting data from Git repositories, allowing you to use the Code Commit Trends dashboard to monitor the code velocity across teams and SCM repositories over time. For more information, refer to Code Commit Trends dashboard.

Input parameters

Table 1. Code commit input parameters
Parameter Description

Git repository URL

Required. A Git repository URL. For example, http://git://server/repo.git.

Remote branch

Required. The name of the Git branch to use. For example, experimental. The default is master.

Starting commit

The hash of the earliest commit that data needs to be collected from. This only needs to be configured for the first procedure run.

Metadata property path

The property sheet where run metadata is stored. If omitted, /mySchedule/@PLUGIN_KEY@-%JobName%-%ReportObjectType% is used for schedule context. For all other contexts, the root is /myProject.

Commit URL template

Enter the template for the URL to be resolved. For example, the template for the https://github.com/somerepo/commit/a12b3 URL is ${repoUrl}/commit/${commitId}.

Transform script

Provides Groovy closure for payload customization. This script is invoked by the plugin with one or two parameters.

  • If one parameter, it is a payload object.

  • If two parameters, the first parameter is a context object (for example, FlowPlugin) and the second parameter is a payload object. In this example, the commitMessage field is added to the payload object.

In the following example, the commitMessage field is added to payload object.

{ Object pluginObject, Map commit \->
if (!commit) {
return commit
}

commit["commitMessage"] = commit["commitMessage"] + System.lineSeparator() + "CUSTOM TEXT"

return commit
}

or

{ Map commit \->
if (!commit) {
return commit
}

commit["commitMessage"] = commit["commitMessage"] + System.lineSeparator() + "CUSTOM TEXT"

return commit
}