adityamparikh opened a new pull request, #150:
URL: https://github.com/apache/solr-mcp/pull/150

   ## What
   
   Adds Apache RAT (Release Audit Tool) license-header enforcement, implemented 
as an
   `org.apache.solr.mcp.rat` **buildSrc convention plugin** rather than inline 
build logic.
   RAT is wired into `check`, so `./gradlew build` audits that every scanned 
file carries an
   ASF license header (report at `build/reports/rat/index.html`).
   
   Fixes #141.
   
   ## Relationship to other PRs
   
   - **Stacked on #138**, which introduces the `buildSrc/` convention-plugin 
infrastructure
     (the `license-notice` plugin). This PR adds a sibling `rat` convention 
plugin there.
   - **Supersedes #149**, which added the same RAT enforcement inline in 
`build.gradle.kts`.
   
   > ⚠️ **Draft until #138 merges.** Because #138 isn't merged yet, the "Files 
changed" diff
   > here includes #138's commits too. The RAT-only delta is the single commit 
`9ec8521`
   > (see the **Commits** tab). After #138 merges this will rebase down to just 
that commit.
   
   ## Design
   
   | Piece | Role |
   |-------|------|
   | `buildSrc/src/main/kotlin/org.apache.solr.mcp.rat.gradle.kts` | Convention 
plugin: applies RAT and configures its excludes. |
   | `buildSrc/src/main/kotlin/.../RatExcludes.kt` | **Pure, Gradle-free** 
helper that translates `.gitignore` entries into RAT (Ant) globs. |
   | `buildSrc/src/test/kotlin/.../RatExcludesTest.kt` | Unit tests for the 
translation. |
   
   Exclusions come from two sources (same approach as the inline version): 
`.gitignore`
   reused as the single source of truth for ignored/build output, plus an 
explicit list of
   tracked files that legitimately carry no header (binaries, data, docs, infra 
config,
   LICENSE/NOTICE).
   
   ## Improvements over the inline approach (#149)
   
   Extracting the translation into a testable helper surfaced and fixed two 
`.gitignore`
   semantics gaps:
   
   1. **Interior-slash anchoring.** Git anchors a pattern with an interior 
slash (e.g.
      `src/generated`) to the repo root. The inline version prefixed *every* 
non-`/`-leading
      entry with `**/`, turning it into an any-depth match. The helper now 
distinguishes
      root-anchored (leading or interior slash) from any-depth (no separator / 
trailing
      slash only). Covered by tests.
   2. **Local developer-tooling dirs.** Added `.claude/**` and `**/.kotlin/**` 
excludes
      (Claude Code worktrees + Kotlin compiler caches) so a local `./gradlew 
build` doesn't
      fail on untracked tooling dirs — analogous to the already-gitignored 
`.idea`/`.gradle`.
   
   ASF headers were added to the three `application*.properties` and 
`gradle/libs.versions.toml`
   so they pass the audit.
   
   ## Verification
   
   - `./gradlew build` — **passing** (full suite, incl. Testcontainers 
integration tests).
   - `./gradlew rat` — clean audit, 0 unapproved.
   - `./gradlew :buildSrc:test` — `RatExcludes` translation tests pass.
   - `./gradlew spotlessCheck` — passing.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to