Skip to main content

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.

PDF report example

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rte_sonar_reports-2025.3.1.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rte_sonar_reports-2025.3.1-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

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

Hashes for rte_sonar_reports-2025.3.1.tar.gz
Algorithm Hash digest
SHA256 0876b85c3f5f4197919b6445ed80b392374058be916e18e25cff1f8bab859bf4
MD5 cb40de090697b44e0626351f500cb4c1
BLAKE2b-256 248c5ca637c0b46d845287c0de5f843191507a7703aa47817b30bc0174876e8c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rte_sonar_reports-2025.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rte_sonar_reports-2025.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9dc0b5ff7e862348e0a985f0f497b95a79d3074876aacc8177d096c09393d9e
MD5 32913f92db870b724249eb0b54af5fd4
BLAKE2b-256 81f5184e2ef78c853b473f4ece87f65d26c9dcde32ce04d214b5765856700335

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page