Skip to content

fix(ci): generated skill bundles still analysed by SonarCloud despite the exclusion #23

Description

@amondnet

Observation

.sonarcloud.properties on main excludes the committed bundles:

sonar.exclusions=skills/spring-docs/scripts/
sonar.cpd.exclusions=skills/spring-docs/scripts/

That landed in ee09832 ("chore(ci): scope Sonar and Codacy off the generated skill bundles"). Yet the SonarCloud analysis of #21 still reported five issues inside the excluded directory:

[CRITICAL/BUG]        skills/spring-docs/scripts/docs.mjs:92  — sort without a compare function
[CRITICAL/CODE_SMELL] skills/spring-docs/scripts/docs.mjs:108 — Unexpected var, use let or const
[CRITICAL/CODE_SMELL] skills/spring-docs/scripts/docs.mjs:109 — Unexpected var, use let or const
[MAJOR/CODE_SMELL]    skills/spring-docs/scripts/docs.mjs:123 — nested ternary
[CRITICAL/CODE_SMELL] skills/spring-docs/scripts/docs.mjs:417 — Unexpected var, use let or const

The var findings are Bun's output, not anything a person wrote — bun run build:skill:check byte-compares the bundle against a fresh build, so they cannot be edited away. That is exactly the situation the exclusion exists to prevent, and it is the reason the file's own header warns the rating "no edit can recover".

Why it matters

A bundled copy of every source finding double-counts the same program, and a BUG in generated output can hold the quality gate at a D reliability rating on new code that nothing in the repository can fix.

Candidate causes, unverified

  • The file's header notes that Automatic Analysis "accepts no wildcards in these values, so paths are written as plain directory prefixes". Whether a trailing-slash directory prefix is honoured, or whether Automatic Analysis expects a glob such as skills/spring-docs/scripts/**/*, is the first thing to check.
  • The same header notes that only the copy on the default branch takes effect. The exclusion is on main, so that does not explain it — but it is worth re-confirming that the analysis of a PR inherits the default branch's properties rather than the PR head's.

Codacy is configured separately in .codacy.yml with skills/*/scripts/** and should be checked the same way; its check is also failing on #21.

Definition of done

A PR that touches scripts/docs.ts produces no SonarCloud or Codacy finding under skills/*/scripts/, verified on a real PR rather than from configuration alone — the previous attempt looked correct too.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't workingtype:ciCI/CD configuration changes

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions