Manage Release risk profiles in YAML

Release calculates a risk level for each release based on different factors such as flags, failed or failing states, or due dates. While the Release GUI enables you to manage risk profile setting and thresholds, you can also choose to manage your risk profiles for your releases using YAML specifications.

Before you begin, review how risk awareness works in Release and how to configure the feature in the Release GUI:

Generate a risk profile from Release

To see what a risk profile looks like when expressed in YAML, use the xl generate command to export the default risk profile.

  1. From the XL CLI, run the following command to create a YAML file named .yaml:

xl generate xl-release -p "Default risk profile" -f DefaultRiskProfile.yaml

  1. Open DefaultRiskProfile.yaml and inspect the contents.

    ---
    apiVersion: xl-release/v1
    kind: Templates
    spec:
    - name: Default risk profile
      type: xlrelease.RiskProfile
      defaultProfile: true
      riskProfileAssessors:
        xlrelease.TaskWithFourFiveOrSixFlagsAtRiskRiskAssessor: "75"
        xlrelease.MoreThanOneTaskOverDueRiskAssessor: "35"
        xlrelease.TaskWithOneFlagNeedsAttentionRiskAssessor: "10"
        xlrelease.TaskRetriesRiskAssessor2Retries: "60"
        xlrelease.TaskWithMoreThanSixFlagsNeedsAttentionRiskAssessor: "40"
        xlrelease.ReleaseFlaggedAtRiskAssessor: "80"
        xlrelease.ReleaseStatusFailingRiskAssessor: "70"
        xlrelease.OneTaskOverDueRiskAssessor: "25"
        xlrelease.TaskWithTwoOrThreeFlagsAtRiskRiskAssessor: "70"
        xlrelease.TaskWithOneFlagAtRiskRiskAssessor: "65"
        xlrelease.TaskRetriesRiskAssessor5Retries: "90"
        xlrelease.TaskWithFourFiveOrSixFlagsNeedsAttentionRiskAssessor: "30"
        xlrelease.TaskWithMoreThanSixFlagsAtRiskRiskAssessor: "80"
        xlrelease.ReleaseStatusFailedRiskAssessor: "90"
        xlrelease.ReleaseFlaggedAttentionNeededRiskAssessor: "30"
        xlrelease.TaskRetriesRiskAssessor: "50"
        xlrelease.TaskRetriesRiskAssessor4Retries: "80"
        xlrelease.TaskRetriesRiskAssessorMoreThan5Retries: "100"
        xlrelease.ReleaseDueDateRiskAssessor: "30"
        xlrelease.TaskWithTwoOrThreeFlagsNeedsAttentionRiskAssessor: "20"
        xlrelease.TaskRetriesRiskAssessor3Retries: "70"

Create a new risk profile

You can create a new risk profile from the GUI and generate a new YAML file, or by modifying the YAML file you generated from the Default risk profile.

Using the Release GUI

  1. See Configure risk profile settings for how to create a new risk profile, modify the threshold values and save it using a unique name (for example MyRiskProfile).
  2. From the XL CLI, run the following command to generate a YAML file named MyRiskProfile.yaml:

xl generate xl-release -p "MyRiskProfile" -f MyRiskProfile.yaml

Using YAML

  1. Open DefaultRiskProfile.yaml that you generated earlier.
  2. Modify the threshold values in the riskProfileAssessors section.
  3. Save the YAML file with a unique name (for example, MyRiskProfile.yaml).

Manage a risk profile using YAML

You can now include the risk profile specification YAML when creating Release templates using the XL CLI.