Skip to content

feat(ci): add sonar-exclusions input to reusable-ci-node - #441

Merged
BryanFRD merged 1 commit into
mainfrom
feat/ci-node-sonar-exclusions
Nov 27, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
feat/ci-node-sonar-exclusions

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Adds an optional sonar-exclusions string input to reusable-ci-node.yml, forwarded as exclusions to reusable-sonarqube-scan.yml.

The scan passes -Dsonar.exclusions on the command line, which overrides sonar-project.properties. Repos with colocated tests (**/__tests__/**) therefore could not keep tests out of the Sonar main source set, so tests counted as 0%-covered source (FerrLabs/MCP issue 502).

  • Input: sonar-exclusions, string, default ``.
  • Empty (or omitted) falls back to the scan workflow default list, so existing callers are unchanged.
  • A non-empty value replaces the default list, it is not appended. Callers must repeat the defaults they still want, e.g. **/node_modules/**,**/dist/**,**/coverage/**,**/__tests__/**.

Callers repin to the merge commit to use it.

@BryanFRD
BryanFRD enabled auto-merge (squash) November 27, 2026 16:05

@ferrfleet-interne ferrfleet-interne Bot 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.

Approve. The change forwards a new sonar-exclusions input to reusable-sonarqube-scan. The inline fallback list is needed (an explicit '' would override the callee default) and matches the pinned scan workflow's default (efe7f97). Two non-blocking points below.

Findings

  • minor .github/workflows/reusable-ci-node.yml:127: a non-empty sonar-exclusions replaces the default list, but the description's example (**/__tests__/**) implies passing only the extra glob. A caller doing that loses node_modules, dist, build, coverage, .next, *.min.js and the rest, so Sonar starts analysing build output and vendored code. Fix: either append on line 333, e.g. exclusions: ${{ format('{0}{1}', '**/node_modules/**,**/dist/**,**/build/**,**/target/**,**/coverage/**,**/.next/**,**/out/**,**/vendor/**,**/*.min.js,**/*.min.css', inputs.sonar-exclusions != '' && format(',{0}', inputs.sonar-exclusions) || '') }} and say "appended to the default list" in the description, or keep replace semantics and state in the description that the caller must repeat the defaults.
  • suggestion .github/workflows/reusable-ci-node.yml:333: the default list is a copy of the scan workflow's input default. Bumping the pinned SHA after that default changes will silently keep the old list here. Add a comment noting it must mirror reusable-sonarqube-scan.yml.

Formal verification was not run for this pull request.

@BryanFRD
BryanFRD merged commit 0e16caa into main Nov 27, 2026
13 checks passed
@BryanFRD
BryanFRD deleted the feat/ci-node-sonar-exclusions branch November 27, 2026 16:07
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.

1 participant