Global configuration
Global configuration lets you share Qodana configurations across multiple projects. Each global configuration is a set of files consisting of the qodana.yaml configuration file and inspection profile configurations contained in YAML and XML files.
This feature is available under the Ultimate Plus license.
How the global configuration works
YAML-formatted configuration files are stored in project directories of VCS repositories. For example, your project can have the following structure that will constitute a global configuration:
In this structure, the project-a and project-b directories contain Qodana configuration files.
The qodana-global-configuraton.yaml file describes the global configuration, for example:
CI/CD pipelines use an uploader tool and configuration token to send these files to Qodana Cloud. This lets global configurations become connected to Qodana Cloud projects; during project analyses, Qodana linters obtain global configuration for use.
You can use each global configuration for several projects within a single Qodana Cloud organization. Each organization can have one or multiple global configurations, whereas each project can be configured using one global and/or project configuration.
Files contained in a global configuration can be updated using access to your VCS repository.
Global and project configurations
Project configuration is a configuration created for a specific project and located within a project repository. Global configuration is a configuration that can be shared across multiple projects. Both configurations can be merged into a single configuration and contained in a single YAML-formatted file, as well as two global configurations. In this case, profile configurations are merged as well using the profile option.
If a project has both configuration types with the project settings colliding with global ones, then project settings take precedence over global settings. In this case, the final configuration will contain settings from both configurations as you can see the critical configuration option of the severityThresholds option.
Project configuration | Global configuration | Final (resolved) configuration |
|---|---|---|
failureConditions:
severityThresholds:
critical: 1
any: 10
|
plugins:
- org-plugin
properties:
orgPluginIntProperty: 10
failureConditions:
severityThresholds:
critical: 0
|
plugins:
- org-plugin
properties:
orgPluginIntProperty: 10
failureConditions:
severityThresholds:
critical: 1
any: 10
|
Uploading to Qodana Cloud
To be able to share global configurations via Qodana Cloud, you should upload a special configuration token while running your CI/CD pipeline. You can generate this token on the Global configurations tab of your organization settings.
After that, send your global configuration to Qodana Cloud as described in the How the global configuration works section on this page. This will make your global configurations become available in the organization settings of the Qodana Cloud UI.