From b586a6701822eb71d59395e57040f983b0ce4b80 Mon Sep 17 00:00:00 2001 From: Marco De Pascale Date: Fri, 27 Nov 2026 11:39:10 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=AA=9D=20Add=20zizmor=20and=20Renovat?= =?UTF-8?q?e=20schema=20check=20to=20pre-commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco De Pascale --- .pre-commit-config.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 639f900..28c345e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -96,5 +96,12 @@ repos: - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.37.2 hooks: - - id: check-dependabot + - id: check-renovate + additional_dependencies: [json5] - id: check-github-workflows + + ## Check for security issues in GitHub Actions workflows + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.33.0 + hooks: + - id: zizmor From d21f3ceb10a222ee40082d2b81005925eb0b0b3a Mon Sep 17 00:00:00 2001 From: Marco De Pascale Date: Fri, 27 Nov 2026 11:39:30 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=94=A7=20Add=20Renovate=20and=20Relea?= =?UTF-8?q?se=20Drafter=20configs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco De Pascale --- .github/release-drafter.yml | 52 +++++++++++++++++++++++++++++++++++++ .github/renovate.json5 | 51 ++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/renovate.json5 diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..24b879b --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,52 @@ +name-template: "MQSS Client $RESOLVED_VERSION Release" +tag-template: "v$RESOLVED_VERSION" +categories: + - title: "๐Ÿš€ Features and Enhancements" + labels: + - "enhancement" + - "feature" + - "refactor" + - "usability" + - title: "๐Ÿ› Bug Fixes" + labels: + - "bug" + - "fix" + - title: "๐Ÿ“„ Documentation" + labels: + - "documentation" + - title: "๐Ÿค– CI" + labels: + - "continuous integration" + - title: "๐Ÿ“ฆ Packaging" + labels: + - "packaging" + - title: "๐Ÿงน Code Quality" + labels: + - "code quality" + - title: "โฌ†๏ธ Dependencies" + collapse-after: 5 + labels: + - "dependencies" + - "github-actions" + - "pre-commit" + - "submodules" +change-template: "- $TITLE ([#$NUMBER]($URL)) (**@$AUTHOR**)" +change-title-escapes: '\<*_&' +version-resolver: + major: + labels: + - "major" + minor: + labels: + - "minor" + patch: + labels: + - "patch" + default: patch + +template: | + ## ๐Ÿ‘€ What Changed + + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..be699b8 --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,51 @@ +{ + $schema: "https://docs.renovatebot.com/renovate-schema.json", + extends: [ + "config:recommended", + ":gitSignOff", + "helpers:pinGitHubActionDigestsToSemver", + ":automergeDigest", + ":automergeStableNonMajor", + ":combinePatchMinorReleases", + ":configMigration", + ":enablePreCommit", + ":prConcurrentLimitNone", + ":prHourlyLimitNone", + ], + enabledManagers: ["github-actions", "pep621", "pre-commit"], + lockFileMaintenance: { + enabled: true, + automerge: true, + }, + labels: ["dependencies"], + schedule: ["every weekend"], + packageRules: [ + { + matchManagers: ["github-actions"], + addLabels: ["github-actions"], + commitMessagePrefix: "โฌ†\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB", + }, + { + matchManagers: ["pep621"], + addLabels: ["python"], + commitMessagePrefix: "โฌ†\uFE0F\uD83D\uDC0D", + }, + { + matchManagers: ["pre-commit"], + addLabels: ["pre-commit"], + commitMessagePrefix: "โฌ†\uFE0F\uD83E\uDE9D", + versioning: "pep440", + }, + { + matchUpdateTypes: ["lockFileMaintenance"], + commitMessagePrefix: "โฌ†\uFE0F\uD83D\uDD12\uFE0F", + }, + { + description: "Group and automerge all patch updates", + groupName: "patch updates", + groupSlug: "all-patch", + matchUpdateTypes: ["patch"], + automerge: true, + }, + ], +} From fa6c911b00befcafb83054f0233ef376945c4546 Mon Sep 17 00:00:00 2001 From: Marco De Pascale Date: Fri, 27 Nov 2026 11:39:51 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=91=B7=20Add=20coverage=20job=20and?= =?UTF-8?q?=20align=20CI=20workflows=20with=20QDMI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco De Pascale --- .github/workflows/mqss_client-test.yml | 72 +++++++++++++++++++++++++- .github/workflows/publish.yml | 11 ++-- .github/workflows/release-drafter.yml | 17 ++++++ 3 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/workflows/mqss_client-test.yml b/.github/workflows/mqss_client-test.yml index a5e3b97..f3c27d2 100644 --- a/.github/workflows/mqss_client-test.yml +++ b/.github/workflows/mqss_client-test.yml @@ -5,17 +5,25 @@ on: branches: ["develop"] pull_request: branches: ["develop"] + merge_group: + workflow_dispatch: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Install dependencies run: | @@ -48,3 +56,65 @@ jobs: - name: Run tests run: | ctest --test-dir build --output-on-failure --no-tests=error + + coverage: + name: Coverage + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # Codecov upload via OIDC + steps: + - name: Checkout repository + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false + + - name: Install dependencies + run: | + sudo apt update -y + sudo apt-get install -y \ + cmake \ + librabbitmq-dev \ + libboost-dev \ + libgtest-dev \ + libgmock-dev \ + libcurl4-openssl-dev \ + gcovr + + # Instrument the whole build (library and tests); MQSSCLIENT_ENABLE_COVERAGE + # only instruments the test executables. + - name: Configure with coverage instrumentation + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DMQSSCLIENT_BUILD_UNIT_TESTS=ON \ + -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage \ + -DCMAKE_EXE_LINKER_FLAGS=--coverage -DCMAKE_SHARED_LINKER_FLAGS=--coverage + + - name: Build + run: cmake --build build --parallel + + - name: Run tests + run: ctest --test-dir build --output-on-failure --no-tests=error + + - name: Collect coverage + run: gcovr --root . --filter src/ --filter include/ --xml coverage.xml --print-summary build + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 + with: + # Switch to true (as in QDMI) once the repository is registered with Codecov. + fail_ci_if_error: false + files: coverage.xml + flags: cpp + + required-checks-pass: # This job does nothing and is only used for branch protection + name: ๐Ÿšฆ Check + if: always() + needs: + - build + - coverage + runs-on: ubuntu-latest + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e7fc0dd..07d2a37 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,16 +6,21 @@ on: tags: - "v*.*.*" # Trigger on version tags +permissions: + contents: read + jobs: publish: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2.8.0 + with: + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2.3.4 with: python-version: "3.x" @@ -31,6 +36,6 @@ jobs: env: PYPI_USERNAME: __token__ PYPI_PASSWORD: ${{ secrets.MQSS_PYPI_API_TOKEN }} - run: uv publish -v -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} + run: uv publish -v -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} # zizmor: ignore[use-trusted-publishing] TODO: switch to PyPI trusted publishing - name: Test package installation run: uv run --with mqss-client --no-project -- python -c "import mqss_client" diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..fb1b3ae --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,17 @@ +name: Release Drafter + +on: + push: + branches: + - develop + +permissions: {} + +jobs: + update_release_draft: + name: Run + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@d1a19e60e81a7e650d00a7de9277f87e439117ea # v7.11.0