Using streams to track defects in your SCM project

You can use streams to adapt to many workflows. One common scenario is to use streams to track defects by simulating the structure of your source code management (SCM) system.

By simulating your SCM structure, you can:

  • Maintain the differentiation between defects that are unique to a particular feature branch, and those that occur in common across related feature branches

  • Automatically propagate the triage done on a defect in one feature branch to each relevant stream across related feature branches

The following example walks you through the process of simulating your SCM structure in Validate by using a project and streams.

  1. Before streams can be created, grouping must be disabled on the main project. If you have grouping options explicitly enabled, or if this is a migrated older project with grouping options enabled, disable grouping options as follows:

    validate admin --url http://<host>:<port> set-project-property <project> enable_group_calculations false
    validate admin --url http://<host>:<port> set-project-property <project> grouping_on_default false
  2. Create a project ('abc_main') or rename an existing project ('abc' to 'abc_main') to represent your SCM system. You can do this through the Portal, by using web API (with the update_project command), or from the command line:

    validate admin --url http(s)://<host>:<port> create-project abc_main

    or

    validate admin --url http://<host>:<port> rename-project abc abc_main
  3. Create streams of the project, named after your SCM branches:

    validate admin --url http://<host>:<port> create-project abc_main/featureBranch1
    validate admin --url http://<host>:<port> create-project abc_main/featureBranch1/featureBranch1A
    validate admin --url http://<host>:<port> create-project abc_main/featureBranch1/featureBranch1B
    validate admin --url http://<host>:<port> create-project abc_main/featureBranch2

  4. Load builds and analysis runs, either:

    • from your SCM's main branch into the project, or

    • from your SCM's feature branches into corresponding streams

    Example commands for running analysis:

    kwbuildproject kwinject.out -o tables --url http://<host>:<port>/abc_main
    kwbuildproject kwinject.out -o tables --url http://<host>:<port>/abc_main/featureBranch1

    Example commands for loading builds:

    validate admin --url http://<host>:<port> load abc_main tables
    validate admin --url http://<host>:<port> load abc_main/featureBranch1 tables
    validate admin --url http://<host>:<port> load abc_main/featureBranch1/featureBranch1A tables

    These commands generate the 'tables' folder by running analysis with kwbuildproject, then load the 'tables' results to the server with validate admin.

After performing these steps, you'll be able to go to the Portal and view the results in your project list. If you cite an issue in abc_main/featureBranch1, notice that the citing automatically appears in abc_main and all other streams with that defect in it.

For other hints on managing your builds in streams, see Build management.