Tools for generating PDF reports used as requirements for deployment of an application in RTE production environments
Project description
Sonar report generator for RTE prescription enforcement
Overview
This project offers a suite of Python packages designed to generate PDF reports that serve as requirements for deploying applications in RTE production environments.
Features
- Automatic generation of a PDF report that includes all necessary information for validating the deployment of an application in RTE production environments.
- Utilization of multiple sources for retrieving Sonar metrics (e.g., SonarQube and Sonarcloud), depending on the application module.
- Automatic retrieval of all module metrics directly from Sonar servers for the specified branch (or the default branch if none is explicitly provided).
- Calculation of an aggregated backend code coverage indicator for multi-module application based on SonarQube description of "coverage" metric
- Generation of a traffic light indicator:
- Green light indicates that all current and future prescription criteria are validated by the application.
- Orange light signifies that while all current prescription criteria are validated, some future ones are not.
- Red light means that some current prescription criteria are not validated.
Usage
Build and/or install
A wheel can be built with following command, at base directory of the project:
python -m build
Project can also be directly installed with following command:
python -m pip install .
Generate Sonar report
Sonar report can be generated with following command:
python -m rte_sonar_reports -a <path-to-application-description-file> -c <path-to-sonar-configuration-file> -o <path-to-output-report-file>
Default log level threshold is set to INFO, but it is possible to override it using the LOGLEVEL environment variable.
LOGLEVEL=ERROR python -m rte_sonar_reports -a ... -c ... -o ...
LOGLEVEL=DEBUG python -m rte_sonar_reports -a ... -c ... -o ...
Sonar servers configuration
The Sonar servers configuration files is an ini file that contains the connection information to the Sonar instances that may be referenced while generating the final report. Each section of the file define a Sonar instance used to retrieve static code analysis results.
Supported keys in each section are:
| Key | Value type | Field type | Description |
|---|---|---|---|
| base_url | string | Mandatory | Base URL to be used to reach Sonar server using Sonar API |
| token | string | Optional | Authentication token to get access to the Sonar analysis results. Can be omitted if analysis results are access free (e.g. public analysis on SonarCloud) |
Example:
[SonarQube]
base_url = https://my.sonarqube.instance
token = my_sonarqube_token
[SonarCloud]
base_url = https://sonarcloud.io
Application description
The application description allows to define the information needed to define your application and all its attributes used to generate the final report.
An application is defined by:
- its name
- its version
- the list of its modules. Each module is an individual package which is associated to an individual Sonar project. It may be a microservice, a library, or a monolith as soon as its Sonar quality report is contained in a unique Sonar project.
A module is defined by:
- its name
- its type (backend, frontend, ...): type is important because some requirements (e.g. code coverage) may be
different between backend and frontend. The script does all the following values:
- backend
- frontend
- other
- its sonar_config attributes, which is the name of the Sonar configuration to use to retrieve the module's metrics, as defined in the Sonar servers configuration
- its project_key used to locate the project on the Sonar server
- its branch to get metrics from
The application description is provided through a yaml formatted file, of the following form:
application:
name: My complete test application
version: 1.0.0
modules:
- name: Frontend module
sonar_config: SonarCloud
project_key: frontend
type: frontend
- name: First backend module
sonar_config: SonarCloud
project_key: backend
branch: release-patch-1.0.1
type: backend
- name: Second backend module
sonar_config: SonarQube
project_key: backend
type: backend
- name: Other module
sonar_config: SonarQube
project_key: other
type: other
Proxy settings
The script relies on the proxy configuration defined by standard environment variables http_proxy, https_proxy, no_proxy, and all_proxy. Uppercase variants of these variables are also supported.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rte_sonar_reports-2025.3.1.tar.gz.
File metadata
- Download URL: rte_sonar_reports-2025.3.1.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0876b85c3f5f4197919b6445ed80b392374058be916e18e25cff1f8bab859bf4
|
|
| MD5 |
cb40de090697b44e0626351f500cb4c1
|
|
| BLAKE2b-256 |
248c5ca637c0b46d845287c0de5f843191507a7703aa47817b30bc0174876e8c
|
Provenance
The following attestation bundles were made for rte_sonar_reports-2025.3.1.tar.gz:
Publisher:
release-to-pypi.yml on rte-france/rte-sonar-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rte_sonar_reports-2025.3.1.tar.gz -
Subject digest:
0876b85c3f5f4197919b6445ed80b392374058be916e18e25cff1f8bab859bf4 - Sigstore transparency entry: 567715757
- Sigstore integration time:
-
Permalink:
rte-france/rte-sonar-report@920df269b26a948bff9619b228de6124df746985 -
Branch / Tag:
refs/tags/2025.3.1 - Owner: https://github.com/rte-france
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-to-pypi.yml@920df269b26a948bff9619b228de6124df746985 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rte_sonar_reports-2025.3.1-py3-none-any.whl.
File metadata
- Download URL: rte_sonar_reports-2025.3.1-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9dc0b5ff7e862348e0a985f0f497b95a79d3074876aacc8177d096c09393d9e
|
|
| MD5 |
32913f92db870b724249eb0b54af5fd4
|
|
| BLAKE2b-256 |
81f5184e2ef78c853b473f4ece87f65d26c9dcde32ce04d214b5765856700335
|
Provenance
The following attestation bundles were made for rte_sonar_reports-2025.3.1-py3-none-any.whl:
Publisher:
release-to-pypi.yml on rte-france/rte-sonar-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rte_sonar_reports-2025.3.1-py3-none-any.whl -
Subject digest:
c9dc0b5ff7e862348e0a985f0f497b95a79d3074876aacc8177d096c09393d9e - Sigstore transparency entry: 567715763
- Sigstore integration time:
-
Permalink:
rte-france/rte-sonar-report@920df269b26a948bff9619b228de6124df746985 -
Branch / Tag:
refs/tags/2025.3.1 - Owner: https://github.com/rte-france
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-to-pypi.yml@920df269b26a948bff9619b228de6124df746985 -
Trigger Event:
release
-
Statement type: