Working with streams

Streams allow you to create multiple streams for a single code base, rather than needing to create a separate project for each variant.

In order to use the streams feature, you need the proper license. Contact license@perforce.com for more information.

Streams provide the following benefits:

  • You can assign a single project rule configuration to all variants.
  • Issues that are common to multiple variants are automatically kept in sync and only have to be cited once.
  • Reporting is possible for individual streams, as is necessary for compliance and functional safety reports.
  • Easier to identify identical issues that exist across multiple streams and unique issues that exist only within a specific stream.
  • More convenient organization and more efficient storage of analysis data.
  • Streams are interchangable with projects. You can connect to them from your desktop tools, desktop plug-ins, CI integration, and server analyses.

Note that configurations (enabled checkers, taxonomies, custom KBs, etc.) are shared between a project and its streams.

You cannot create streams for projects which have issue grouping enabled. To create streams in a project, ensure grouping settings are disabled.

Example: Working on a code base with multiple versions

Let's say you are a car manufacturer and you have a main code base with multiple variants based on several models that you manufacture. The majority of the code remains the same across the different models, but may vary slightly such as having differing target platforms, branding or included modules. Previously, in order to be able to produce compliance reports for each individual variant, it would have been necessary to create a separate Validate project for each variant, and to synchronize citing data across projects for common issues in the shared code using validate xsync.

With this feature, you can simplify the process by having one core project, broken down into several streams. Visualizing the analysis data in streams allows you to quickly recognize an issue that is shared across streams, only cite and/or fix it once, and easily identify any unique issues for each individual stream.

How to create a stream

  1. Create your base project by selecting Create a new project from Validate.
  2. Next, create stream(s) related to your base project. Click on the project and a new window appears on the right; select Create stream.
  3. Enter a name for the stream; The Create as stream box and the Parent project fields are automatically populated. You may also add any relevant description and tags for the stream. When you are finished, click Create.
  4. Repeat steps 1-3 to create any additional streams. Note that you can also create a stream of a stream by selecting the stream from the project list and repeating these same steps.

Loading your builds to streams

Just as you can for your other projects, you can run an analysis and load the results to separate streams.

You can only load one build at a time for the entire project.
  1. Run Validate analysis on your source code using kwbuildproject.
  2. Load the generated tables to the stream with validate admin load:
    validate admin load <path-to-stream> <tables_directory>
    Example:
    validate admin load myProj/variant1 tables
  3. Run analysis on the version of your source code for your other stream, and load it to the other stream with the command:
    validate admin load <path-to-other-stream> <tables_directory>
    Example:
    validate admin load myProj/myStream1/subVariant tables
You cannot use spaces or quotes in stream names. The stream name always uses a forward slash between each project or stream.

Once you have loaded your builds to streams, you can select a project or any related streams from the projects list in the Portal to see a consolidated list of issues in the right side panel. This section displays the sum of all issues in the selected project, including all of its streams. Note that consolidated lists do not contain duplicate issues.

Citing issues on streams

Citing for identical issues is shared between a project and all of its streams. This eliminates the need to run validate xsync between streams to synchronize citing information. Simply cite an issue in your stream as you normally would for your base project; citing is automatically applied to this same issue in all other related streams.

When an issue is not unique, it has the same issue ID in all the streams where the issue exists. Additionally, when navigating to the issue from the Issues page, a table on the right shows which other streams this issue exists in.

What is a unique issue?

If an issue exists in at-most one stream, this issue is considered unique to the specific stream. This indicates that this issue was introduced in one of the stream's builds and is currently not in the state 'Fixed' in the latest build for the specified stream.

You can see the count of the currently open unique issues on the Projects page, in the Views page of a stream, and on the latest build shown in a stream's Builds page.

Hiding streams

You can select the Hide streams check box to hide any streams in the projects list (and in Cross Project Report, if any were displayed there); this setting is persistent through your current browser session. You can still see information related to steams on the projects page by clicking on a base project and looking at the 'Streams' section in the right hand panel.

Deleting a stream

You can delete a stream by selecting the icon next to any stream in your projects list. Note that if you delete a stream or project that has children, those are also deleted.