Managing reports with the report editor

CloudBees SDM is a preview, with early access for select preview members. Product features and documentation are frequently updated. If you find an issue or have a suggestion, please contact CloudBees Support.

You can use all the data being collected by CloudBees SDM by accessing a number of standard reports related to efficiency, contribution, development status, and health. Additionally, you can create custom reports to query the data and answer questions related to the entire software delivery process.

You can use all the data being collected by CloudBees SDM for an organization to generate your reports. You can create custom reports to query the data and answer questions related to the entire software delivery process.

Anyone can create, edit, modify, or delete reports using the reports editor from the Reports screen. You can use the getting started with reports section to walk you through creating your first report.

A report applies to all data captured for the organization associated with your profile.

Example reports are included with CloudBees SDM and can be used as a starting point to create your own reports.

Using the report editor

The report editor has these fields:

Report name

The title of your report.

Data type

Determines the type of data the report will return and depends upon the services integrated with CloudBees SDM.

Report criteria

Filters the data to be returned.

Fields

Builds the actual tabular report from the data defined in the data type and criteria.

Report criteria

The Report criteria field allows data selection criteria to be specified based on the data type selected, including easily accessing and associating to related data using path expressions like author.login. The . lets you traverse the hierarchy. For example, the author field of the githubPullRequest data type is a complex object with a login sub-field that corresponds to the author’s username. If you wanted to select the author based on username, you could use author.login = 'username'.

As an example, if GitHub is integrated, the GithubPullRequest data type can be selected. A criteria filter of state = 'OPEN' could be specified so that the report is only evaluated for open pull requests. An additional criteria of mergeStateStatus = 'DIRTY' would then cause the report to evaluate to true for open pull requests that have a merge status of DIRTY. The report would evaluate to false for all other open pull requests, and these results would not be listed in the tabular report.

Refer to SDM query language for information about building queries and Example reports for real-world reports.

Report data types

You can use any data type present in the SDM to query data. These data types are the basis to create reports. You can only have one data type selected at a time.

Report data type Source Type of information available

GithubPullRequest

GitHub

Pull request status, review state, assigned reviewer, time since last activity

GitbubRepository

GitHub

Repository data

JenkinsBuild

Jenkins

Job or build state, pipeline issues

JiraIssue

Jira

Jira ticket numbers, assigned person, etc.

Refer to SDM query language for information about building queries.

Fields

Fields add column headings and the data that is displayed for the generated report. When you are editing a report, you can choose whether a field is sorted ascending or descending.

Each field has three entries:

  • Title, which provides a column heading

  • Path, which provides the data path to be listed in the column

  • Sorting, which determines how the content is listed, usually ascending or descending.

Refer to [Examples] below.

Viewing reports

You can view a list of reports by selecting Reports tab. If no reports have been created, you will be prompted to create your first report.

  1. View a report by selecting one from the list.

  2. To select a different report, select the report drop-down and choose another report.

Creating a new report

To create a report, you will select a data type that determines the data source you wish to use from the Data type field. As you type, data types matching your input display below in a text box. You can also scroll this list to find the data type best suited to the report you want to create.

To create a new report:

  1. From Product hub, select Reports.

  2. Select Create report.

  3. Enter a report name.

  4. Select a data type.

  5. Enter criteria Report criteria text box. For example, to select all open pull requests with a commit status of failure, after selecting githubPullRequests in the Data type field, you can use:

    state = 'OPEN' and headCommit.statusContexts.any(state = 'FAILURE')
    Refer to SDM query language for information about building queries.
  6. Add Fields to represent the tabular columns and headings in your report.

  7. Select Save changes.

Updating existing reports

Once a report is created, you can edit a report to change the name, data type, criteria, or fields; or delete a report. You can also add sorting to fields when editing a report.

Editing a report

To edit a report:

  1. From the Product hub, select Reports

  2. Select the report you wish to modify.

  3. Select Edit report next to the report name.

  4. Update the report name, criteria, data type, or fields.

  5. Select Save changes.

For more information about queries, see SDM query language.

For information about specific data types:

Deleting a report

To delete a report:

  1. From the Product hub, select Reports.

  2. Select the report you wish to delete.

  3. Select Delete report.

  4. Confirm that you wish to delete the report by selecting Delete report or select Cancel to retain the report.

Example reports

The following sections provide examples for how to create real-world reports.

Example: Pull request failures report

Let’s say that you want to create a report to identify when a pull request has a commit failure. You would need the githubPullRequest data type would provide the base data. The report criteria helps filter the selection.

The following entries on the report editor create the query to generate the report:

  • Data type: githubPullRequest

  • Report criteria: state = 'OPEN' and pullRequestReviews.size() = 0 and reviewRequests.size() = 0

If you wanted to also add filtering for product name, you could use the following statement in Report criteria, replacing PRODUCT-NAME with the name of your product:

state = 'OPEN' and repository.products.name = 'PRODUCT-NAME' and pullRequestReviews.size() = 0 and reviewRequests.size() = 0

Once the criteria is entered, Fields add columns and data selection to generate the tabular report. The first column in determines the column, with the first text box determining the field heading and the second the entries that appear in the column. Each additional field adds another column to the report. In this example, there are four fields:

Column name of field

Query

Definition

Name

author.login

Searches for the identified author’s GitHub login ID.

Review state

state: state

Selects the reviews state of the PR.

Merge status

status: mergeStateStatus

Lists the current merge status.

Commit

headCommit.commutUrl

Provides the URL for the last commit on the PR.

The resulting report looks like this:

Example report

For more information about queries, see SDM query language.

Example: Failing jobs policy report

Let’s say that you want to explore is understanding which builds are failing in Jenkins. First, you create a policy to highlight failing jobs. This policy’s action adds a status label to highlight jobs that are failing. The policy uses the following policy rule and action: * Data type: jenkinsBuild * Target filter: startTime > now('-1 day') and jobFullName ~ 'job' * Criteria: result = 'FAILURE' or result = 'UNSTABLE' * Action: Needs attention (red) status label called "Jenkins job failing"

To build the report querying results from this policy, you would use the jenkinsBuilds data type.

  1. Report name: "Failing Jobs policy"

  2. Data type: jenkinsBuilds Data type

  3. Report criteria: policyResults.policy.name = "Failing Jobs" and policyResults.value = true

  4. Fields to create a tabular report with three columns with the headings Name, URL, and Result.

    Title Path Sort

    Name

    jobFullName

    (optional)

    URL

    displayUrl

    (optional)

    Result

    result

    (optional)

Report editor for failing jobs report

Example: Failing Jenkins builds

Let’s say that you want to explore is understanding which builds containing sdm are failing in Jenkins within the last day. To build the report, you would start with the jenkinsBuilds data type.

To create a new report using this example:

  • Report name: "Failing Jobs" (1)

  • Data type: jenkinsBuilds (2)

  • Report criteria entry: (3)

    startTime > now('-1 day') and jobFullName ~ 'sdm' and (result = 'FAILURE' or result = 'UNSTABLE')
  • Fields and their values: (4)

    Title Path Sort

    Name

    jobFullName

    (optional)

    URL

    displayUrl

    (optional)

The report editor will look like this:

Report editor for failing jobs report

The finished report looks like this:

View of failing jobs report