About the policy 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. Learn more about the preview program.

Policies enable engineering managers and leaders to define rules related to the development process of a product or feature. Organization-wide policies provide easy to create global policies to define common best-practices or rules matching their software delivery methodology. A policy applies to the organization associated with your admin user profile.

Sample policies are included with CloudBees SDM and can be used to create your own policies.

Policy queries

Each policy has a rule and associated actions. Rules can enforce specific steps that drive best practices, compliance, or governance requirements for the process, which help ensure higher quality, more stable software for the customer. If a policy has matches, actions associated with the policy are triggered. For example, a status label defined in the action can appear on the Pull requests screen when conditions for the policy are met.

Only an administrator for CloudBees SDM can create, edit, or modify policies and rules using the Policies screen. Users who are non-administrators can then view the results of policies from generated notifications when a policy’s rules are violated.

Policy rules

To create a policy, you have to define the rules and actions taken if a policy has matches. Rules are defined using the Rules tab of the policy editor.

Rules have three components:

Data type

Determines the type of data to which the policy applies and depends upon the services integrated with CloudBees SDM.

Target filter (optional)

Filters the data to be evaluated. By default, the policy will be evaluated for all instances of the given data type. If a target filter is specified, the policy is only evaluated for instances for which the target filter evaluates to true.

Criteria

Defines what status must be met for the actions associated with the policy to be triggered. The actions are triggered for instances where the expression defined by the criteria evaluates to true.

As an example, if GitHub is integrated, the GithubPullRequest data type can be selected. A target filter of state = 'OPEN' could be specified so that the policy is only evaluated for open pull requests. A criteria of mergeStateStatus = 'DIRTY' would then cause the policy to evaluate to true for open pull requests that have a merge status of DIRTY. Any associated actions would be triggered for these pull requests. The policy would evaluate to false for all other open pull requests.

To create a policy rule, you would enter these values:

  • Target filter: state = 'OPEN'`

  • Criteria: mergeStateStatus = 'DIRTY'`

Refer to SDM query language for information about building queries.

Data types

You can use one of the data types present in CloudBees SDM and contained in the System of Record to query data for a report or a policy. The data type you select is based upon the data source you wish to use, such as Jenkins, Jira, GitHub, and others.

Each query can only return one data type and its associations, but it’s possible to query across many different types to help refine your selection.

Refer to the data types reference section for detailed information.

Refer to SDM query language for information about building queries.

Defining policy actions

Once a policy is created, the next step is to establish actions that should happen when the policy is triggered. Each policy can have one or more actions.

Currently, only status labels can be assigned as an action. A status label appears as colored text next to an item that matches a policy’s rules. Status labels use three colors:

  • Red: Needs immediate attention. Work is blocked.

  • Yellow. Needs attention soon. Work might be blocked.

  • Green: Requires action. Work is not blocked.

Once an action is created, you can toggle it on or off using the slide. The slider is blue when an action is active and light gray when inactive.