feat(sdk-review): add automated PR review skill (AFSDK-3937)#201
Closed
tiagoek wants to merge 1 commit into
Closed
feat(sdk-review): add automated PR review skill (AFSDK-3937)#201tiagoek wants to merge 1 commit into
tiagoek wants to merge 1 commit into
Conversation
Adds the SDK Module Review skill to this repository: ## What this PR adds **20 deterministic checks** (no LLM calls in CI): - secrets, license-spdx, disclosure, hardcode, telemetry, docs, bdd, patterns, versioning + BREAKING family, commits, errors-logging, testing-depth, http-hygiene, concurrency, deps-supply, deletion-hygiene, constants, binding-shape, quality-gate-parity, pr-size **Rule tiers:** SHADOW | FLAG | BLOCK | BLOCK_LOCKED, configured in `.claude/config/rules.yaml` **BLOCK_LOCKED rules cannot be suppressed:** - SEC-* (all secrets), HC-03 (SAP-internal URL leak), DIS-06 (internal artifactory), LIC-01/02 (SPDX headers), BND-02 (BTP token URL concat), BND-05 (binding logs credentials), BREAKING-* (all breaking-change declarations) **REUSE.toml aggregate exemption** — this repo uses REUSE.toml at root, so per-file SPDX rules are baseline-exempted automatically. **Cross-language BDD parity** — module-aliases.yaml seeded with `dms ↔ documentmanagement` (Java sibling). **4 PR signals posted per run:** 1. Inline comments per finding 2. Aggregated summary comment 3. GitHub check-run (Checks tab) 4. Status label (`sdk-review: ✅ passed` / `❌ blocked` / `⚠️ flagged`) **Idempotent re-runs:** HTML markers let subsequent runs replace prior artifacts rather than duplicate them. ## Structure - `.claude/scripts/`: 20 check-*.sh + orchestrate.sh + aggregate.sh - `.claude/scripts/lib/`: 12 shared libs (2 Python AST + 10 bash) - `.claude/config/`: rules.yaml, module-aliases.yaml, baseline.json - `.github/workflows/sdk-module-review.yml`: auto-trigger on every PR - `.github/workflows/sdk-skill-isolation-check.yml`: validates sub-PRs - `docs/PR-REVIEW.md`: user-facing docs - `docs/BRANCH-PROTECTION-SETUP.md`: admin guide for required-check config - `tests/sdk-review/`: 57 bats tests + 6 fixtures (placeholder secrets, not real credentials) - `CONTRIBUTING.md`: amended — sdk-module-review is required before review ## Validation - 57/57 bats tests passing - shellcheck clean on all bash scripts - E2E on 5 real PRs (#196, #191, #192, #185 in this repo + Java jv#9): zero false positives observed - Self-test on this PR: 0 BLOCK, 0 FLAG (skill correctly skips its own files) - Flagship BND-02 finding verified on Java new-module PR (token URL concat) ## Rollout Recommended SHADOW → FLAG → BLOCK progression, 2 weeks each. See `docs/BRANCH-PROTECTION-SETUP.md`. ## Note on test fixtures `tests/sdk-review/fixtures/secrets-*.diff` contain intentional placeholder strings that match secret regexes (e.g. `AKIATESTFIXTUREXXXXX`, `eyJTESTFIXTURE...`) so the check-secrets rule can be unit-tested. These are NOT real credentials. Ref: https://jira.tools.sap/browse/AFSDK-3937
0710032 to
025d15b
Compare
Contributor
Author
|
Superseded by 6 incremental sub-PRs (see AFSDK-3937/06-INCREMENTAL-DELIVERY.md). Original squash preserved on branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the SDK Module Review skill — an automated, deterministic PR review that runs on every PR in this repository. Its check-run (
sdk-module-review) is intended to become a required status check so PRs cannot be merged until the automated review is green.The skill runs 20 checks (secrets, license, disclosure, hardcode, telemetry, docs, BDD parity, patterns, versioning + BREAKING family, commits, errors/logging, testing-depth, HTTP hygiene, concurrency, deps supply, deletion hygiene, constants, binding shape, quality-gate parity, PR size) and posts four signals per run: inline comments, aggregated summary comment, GitHub check-run, and a status label.
Zero LLM calls in CI — same input, same output. Every run is reproducible. Cost is only GitHub Actions minutes.
Related Issue
Ref: AFSDK-3937
Type of Change
How to Test
Automated (in CI):
maintriggers.github/workflows/sdk-module-review.ymlLocal dry-run (against any open PR):
Or via the Claude Code slash command:
Unit tests:
57 tests pass; shellcheck is clean.
Structure
.claude/scripts/— 20 check scripts + orchestrator + aggregator.claude/scripts/lib/— 12 shared libs (2 Python AST + 10 bash).claude/config/—rules.yaml(tiers per rule),module-aliases.yaml,baseline.json.github/workflows/sdk-module-review.yml— auto-trigger on every PR.github/workflows/sdk-skill-isolation-check.yml— validates sub-PRs into this feature branchdocs/PR-REVIEW.md— user-facing docs for contributorsdocs/BRANCH-PROTECTION-SETUP.md— admin guide for configuring the required status checktests/sdk-review/— bats tests + fixture diffsCONTRIBUTING.md— amended:sdk-module-reviewmust pass before maintainer reviewChecklist
docs/PR-REVIEW.md,docs/BRANCH-PROTECTION-SETUP.md,CONTRIBUTING.mdamendment)Validation
E2E-tested against 5 real PRs in
cloud-sdk-pythonandcloud-sdk-java:DocumentManagementConfig.java:106Self-test on this PR: 0 BLOCK, 0 FLAG (skill correctly skips its own files via
lib/skill-self-skip.sh).Rollout
Recommended SHADOW → FLAG → BLOCK progression (2 weeks each). See
docs/BRANCH-PROTECTION-SETUP.md.Additional Notes
.claude/config/module-aliases.yaml(currentlydms ↔ documentmanagement).