Skip to content

Exclude repository maintenance scripts from Sonar coverage scope - #603

Merged
thomasturrell merged 2 commits into
mainfrom
copilot/ignore-github-scripts-coverage
Oct 27, 2026
Merged

thomasturrell merged 2 commits into
mainfrom
copilot/ignore-github-scripts-coverage

Conversation

Copilot AI commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Sonar coverage currently includes files under .github/scripts/, which adds non-application automation code to coverage metrics. This change narrows coverage scope so quality gates remain focused on production modules.

  • Scope adjustment
    • Added a Sonar coverage exclusion for repository maintenance scripts:
      • .github/scripts/**
  • Behavioral impact
    • Coverage reporting for application modules is unchanged.
    • Only chore/automation scripts are removed from coverage calculations.
<properties>
  <sonar.coverage.exclusions>.github/scripts/**</sonar.coverage.exclusions>
</properties>

Checklist:

  • Public methods are documented
  • Public methods are tested
  • New and existing tests pass when run locally
  • There are no new warnings or errors

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Sonar configuration to exclude .github/scripts from coverage Exclude repository maintenance scripts from Sonar coverage scope Oct 27, 2026
Copilot AI requested a review from thomasturrell October 27, 2026 10:22
@thomasturrell
thomasturrell marked this pull request as ready for review October 27, 2026 10:24
Copilot AI balanced review requested due to automatic review settings October 27, 2026 10:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is a single, correctly-scoped Sonar coverage-exclusion property that matches the existing script files and aligns with issue #602 without affecting application coverage.

No open issues 🎉

What changed in this PR

This PR adds a single Maven property, sonar.coverage.exclusions, to the root pom.xml to exclude repository maintenance scripts under .github/scripts/** from SonarCloud coverage analysis. This keeps coverage metrics and quality gates focused on production application modules rather than chore/automation scripts, addressing issue #602.

Changes:

  • Added <sonar.coverage.exclusions>.github/scripts/**</sonar.coverage.exclusions> to the aggregator POM's <properties> block.
File Description
pom.xml Introduces a Sonar coverage exclusion property so files under .github/scripts/ are omitted from coverage calculations.

I verified that the .github/scripts/ directory exists and contains the maintenance scripts (lrs-conformance-summary.cjs, update-example-versions.sh, etc.) the pattern targets, that no pre-existing sonar.coverage.exclusions property is being overridden, and that the relative path resolves correctly from the aggregator POM where the Sonar scan is invoked. The change is scoped to coverage only and leaves application code coverage unchanged, consistent with the issue's acceptance criteria.

Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

@thomasturrell
thomasturrell merged commit 2729cdc into main Oct 27, 2026
7 checks passed
@thomasturrell
thomasturrell deleted the copilot/ignore-github-scripts-coverage branch October 27, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore]: Ignore .github/scripts from Sonar coverage

3 participants