Build management

The Builds page of Validate allows you to perform build management tasks such as:

  • view a list of builds for a selected project
  • filter the build list
  • rename builds (if you want to label a milestone build, for example)
  • delete builds
  • set up a build retention policy
  • view the build log

To access the builds page, click a project in the Project list and click Builds.

You can also use the Web API or the command-line tool validate admin for build management tasks.

Setting up a build retention policy

The space required to store integration build analysis data can grow very large over time. To save disk space, you can:

  • delete individual builds in Validate, with validate admin delete-build, or with the Web API
  • enable automatic build deletion

    In order to enable automatic build deletion, you need to have the Project admin role.

When you set a build retention policy, you set the number of builds to keep. By default, Validate keeps 20 builds. You can also prevent specific builds from being deleted; these builds are not included in the count of builds to keep. For example, if you set the threshold to keep 30 builds and also prevent 10 builds from being deleted, Validate will keep 40 builds.

If all builds are deleted from a project and its streams, historical citing information will be lost. Be sure to leave at least one build.

Automatically delete old builds

Klocwork supports automatic deletion of old builds to help manage storage consumption across projects and streams. This is controlled using the auto_delete_threshold property, which defines the maximum number of builds to retain. Once this threshold is exceeded, older builds are deleted the next time a new build is created.

You can configure this setting at the project or stream level, using the Validate portal, the Web API, or the kwadmin/validate admin CLI.

Avoid unsetting automatic deletion unless you have sufficient storage capacity. Be aware that unsetting or raising the threshold will consume more disk space over time.

Restriction: Deletion of builds is triggered only when a new build is created and the threshold is exceeded.

Understanding project hierarchies and inheritance

Projects and streams exist in a hierarchical structure. A stream can be created from a base project or another stream. In this structure:

  • Parent: The immediate project or stream above another stream

  • Child: A stream directly created under a project or another stream

  • Ancestor: Any project or stream higher up the hierarchy

  • Descendant: Any stream further down the hierarchy

Streams can either inherit the auto_delete_threshold from their ancestors or be assigned an explicit value. If no value is found in the hierarchy, the default value of 20 is used.

How inheritance works

After a build is completed, Klocwork evaluates the number of builds stored for the project and all its streams. Each stream's threshold is determined through the following logic:

  • If the stream has an explicit auto_delete_threshold set, that value is used

  • If not, the stream checks its parent for a threshold value

  • If the parent has no value, the check continues up the hierarchy until a value is found

  • If no value is found, the default of 20 is used

This inheritance mechanism avoids redundant values and ensures consistency across related projects.

Setting the threshold

You can configure the auto_delete_threshold using one of the following methods:

Validate Portal

  1. Log in to the Validate Portal.

  2. Click Projects in the top-left menu.

  3. Select a project from the list.

  4. Click the Builds tab.

  5. Enable Auto-delete old builds.

  6. Click the pencil icon to set the number of builds to retain.

Web API

Use the update-project method and pass a positive integer value for auto_delete_threshold.

Kwadmin or validate admin CLI

To enable auto-deletion using kwadmin or validate admin, use this command and set the threshold:

validate admin set-project-property MyProject auto_delete_threshold 10

Unsetting the auto delete threshold

You cannot fully disable automatic build deletion using the Validate Portal if an ancestor project or stream has it enabled. Un-checking the 'Auto-delete old builds' option in this case does not remove the setting; it simply causes the stream to inherit the value from its parent.

To explicitly unset automatic build deletion, set auto_delete_builds on the Web API to false.

Alternatively, using kwadmin or validate admin, set a very high threshold so builds are never deleted:

validate admin set-project-property MyProject auto_delete_threshold 99999

Automatic deletion notes and best practices

  • To remove a stream's explicitly set threshold and revert to the value from its parent, un-check the Auto-delete old builds option on Validate.

  • If you attempt to set a stream's threshold to the same value it would inherit, the stream continues to inherit rather than store a new explicit value.

  • If you change a stream's threshold to a value it would otherwise inherit, its explicitly set value is removed and it resumes inheriting.

  • When a project or stream's value is changed, it checks its descendants:

    • If a descendant has a different explicit value, no changes are made.

    • If a descendant has no value and would now inherit the same value being set, the descendant begins inheriting and its explicit value is removed.

Prevent a specific build from being deleted

When you enable automatic build deletion, you may want to prevent specific builds from being automatically deleted (for instance, iteration or milestone builds). Builds that are marked for keep do not count against the auto_delete_threshold limit.

  1. If you're not viewing the Projects list, click Projects at the top left.
  2. Click a project in the list. The project details are displayed.
  3. In the project details, click Builds.
  4. Click the pencil icon to the left of the build you wish to keep.
  5. Select do not auto-delete this build.
You can also use the Web API to specify which builds to keep.