Cross-version support for builds

Klocwork has decoupled the Build Server version from the Klocwork Server. Therefore, you can use older build server tools with newer versions of the Klocwork Server, one full release back. For example, this means you can load Klocwork builds from any version of Klocwork 2022.1 through to 2022.4 into Klocwork 2023.3 without having to import or migrate data.

For large organizations, this feature provides flexibility by allowing you to upgrade the Server and Desktop plug-ins to take advantage of improvements in a newer release, while still analyzing some or all of your projects with a previous version of Klocwork.

Example: Loading a build from an older version of Klocwork into a newer version of the Klocwork Server and locking it to the older configuration

In this scenario, you already have builds running on an older version of Klocwork and you want to load them into a newer version of the Klocwork Server. You can either import a project from the other build machine, or you can start by creating a new project and loading the build. In this example, we create a new project on Klocwork 2023.1, and then load a build from a build machine running a 2022.1 version of Klocwork.
  1. In Klocwork 2023.1, log in and create a project in the Portal, for example, demosthenes.
  2. Lock the project to the 2022.1 configuration by running the following command from the build machine, for example:
    kwadmin lock-project-version --url http://my2023server.acme.com:8084 demosthenes

    This command creates a file that contains information about the engine and checker configuration on the build machine, including any custom checkers and whether checkers are enabled or disabled. The server uses this information as the base configuration for the project.

  3. In the Klocwork 2023.1 Portal, open the demosthenes project. You can enable or disable 2022.1 checkers, as necessary.

    You cannot make use of any checkers introduced since 2022.1, as you have locked your project to that version of the product.

  4. On the 2022.1 build machine, build the project, as usual, for example:
    kwbuildproject --url http://my2023server.acme.com:8084/demosthenes -o tablesdir buildspec.out
  5. On the 2022.1 build machine, use the kwadmin load command to load a build to the Klocwork 2023.1 Server, for example:
    kwadmin load demosthenes tablesdir --url http://my2023server.acme.com:8084

How to verify if a project is locked to an earlier version of Klocwork

When you lock a project to an earlier version of Klocwork, the lock-project-version command creates a configuration file called default_checkers_configuration.xml and moves it to that project directory on the Klocwork Server. The configuration file contains information about the checkers available in that release, including any custom checkers you deployed to that build machine.

Search the project directory for default_checkers_configuration.xml to verify whether your project is locked to an earlier version of Klocwork.

Unlocking a project so that it no longer uses a project configuration from an earlier version of Klocwork

If you no longer want to lock a project to an earlier version of Klocwork, use the unlock-project-configuration command, for example:

kwadmin unlock-project-version demosthenes --url http://my2023server.acme.com:8084
The system deletes the default_checkers_configuration.xml file from the project folder.

Because the project has still been analyzed by an older version of Klocwork, if any checkers were removed or renamed since that release, you won't see them reported in the Portal. Similarly, your project won't report any new checkers introduced since that release. If you want to take advantage of all new checkers, you must analyze your project with the current version of Klocwork.