You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "adityamparikh (via GitHub)" <gi...@apache.org> on 2026/06/13 21:14:47 UTC
[PR] feat(build): RAT license-header enforcement as a buildSrc convention plugin (stacked on #138) [solr-mcp]
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] feat(build): RAT license-header enforcement as a buildSrc convention plugin (stacked on #138) [solr-mcp]
Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh merged PR #150:
URL: https://github.com/apache/solr-mcp/pull/150
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] feat(build): RAT license-header enforcement as a buildSrc convention plugin (stacked on #138) [solr-mcp]
Posted by "adityamparikh (via GitHub)" <gi...@apache.org>.
adityamparikh commented on PR #150:
URL: https://github.com/apache/solr-mcp/pull/150#issuecomment-4699825785
Closing in favor of adityamparikh/solr-mcp#91, which is based on the #138 branch (`add-apache-license-notice`) so the diff is **only** the RAT changes (one commit) instead of #138 + RAT combined. Once #138 merges, I'll open the upstream PR against `main`.
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] feat(build): RAT license-header enforcement as a buildSrc convention plugin (stacked on #138) [solr-mcp]
Posted by "adityamparikh (via GitHub)" <gi...@apache.org>.
adityamparikh commented on PR #150:
URL: https://github.com/apache/solr-mcp/pull/150#issuecomment-4700153884
@epugh — reopening this as the apache-side PR for the **buildSrc / convention-plugin** take on RAT, so you can review it here. It's the alternative to the inline `tasks.rat { }` configuration in #149.
A couple of notes for reviewing:
- It's stacked on #138 (the `buildSrc` infra), so the **Files changed** tab includes #138's commits. The RAT-only delta is the single commit `9ec8521` — easiest to review from the **Commits** tab.
- Kept as a **draft** because it shouldn't merge until #138 lands; the goal right now is a review of the approach. Once #138 merges I'll rebase this down to just the RAT commit and mark it ready.
What it does differently from #149: adds an `org.apache.solr.mcp.rat` convention plugin alongside #138's `license-notice`, and moves the `.gitignore`→glob translation into a pure, unit-tested `RatExcludes` helper. That testability caught a bug in the inline version — interior-slash patterns like `src/generated` were matched at any depth instead of being root-anchored.
`./gradlew build` passes (incl. Testcontainers integration tests) and `./gradlew rat` is a clean audit. Happy to go whichever way you prefer — inline (#149) or buildSrc (here).
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] feat(build): RAT license-header enforcement as a buildSrc convention plugin (stacked on #138) [solr-mcp]
Posted by "adityamparikh (via GitHub)" <gi...@apache.org>.
adityamparikh closed pull request #150: feat(build): RAT license-header enforcement as a buildSrc convention plugin (stacked on #138)
URL: https://github.com/apache/solr-mcp/pull/150
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org