Skip to content

feat: examples, smoke test, Makefile, dependabot#1

Merged
kanywst merged 8 commits into
mainfrom
feat/examples
May 27, 2026
Merged

feat: examples, smoke test, Makefile, dependabot#1
kanywst merged 8 commits into
mainfrom
feat/examples

Conversation

@kanywst
Copy link
Copy Markdown
Member

@kanywst kanywst commented May 27, 2026

Summary

  • examples/ with reference Rego policies (RBAC, ABAC, Kubernetes admission)
  • scripts/smoke.sh drives a real MCP handshake over stdio (initialize → tools/list → tools/call) and asserts the policy returns the expected decision. Non-zero exit on protocol failure.
  • Makefile with build / test / vet / lint / smoke / fmt / tidy / clean
  • .github/dependabot.yml for gomod and github-actions (weekly, grouped)
  • README trimmed; adds a short "Layout" rationale (flat is on purpose for a single-tool MCP server)

Test plan

  • go vet ./... clean
  • golangci-lint run ./... → 0 issues
  • go test -race ./... passes
  • make smoke → ✓ smoke: allow=true
  • CI green on this PR

- examples/ with reference Rego policies (RBAC, ABAC, k8s admission)
- scripts/smoke.sh drives a full MCP handshake over stdio and asserts
  the policy returns allow=true; exits non-zero on protocol failure
- Makefile targets: build, test, vet, lint, smoke, fmt, tidy, clean
- Dependabot for gomod + github-actions (weekly, grouped)
- README trimmed; adds layout rationale (flat is intentional)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Warning

Review limit reached

@kanywst, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 26 minutes and 5 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e1f5082-c127-4065-a300-8bf7d06f20f6

📥 Commits

Reviewing files that changed from the base of the PR and between 6041a54 and 99538b8.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (12)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .goreleaser.yml
  • Makefile
  • README.md
  • examples/README.md
  • examples/abac.rego
  • examples/k8s_admission.rego
  • examples/rbac.rego
  • go.mod
  • scripts/smoke.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/examples

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces project infrastructure and documentation improvements, including a Dependabot configuration, a Makefile, a smoke test script, and an examples directory with sample Rego policies (RBAC, ABAC, and Kubernetes admission control). The code review feedback highlights three key areas for improvement: correcting a misleading reference to curl in the examples documentation, refactoring the Kubernetes admission policy to use object.get with fallbacks to prevent silent evaluation failures on missing metadata, and making the smoke test script more robust by selecting the JSON-RPC response by ID using jq instead of relying on tail -1.

Comment thread examples/README.md Outdated
Comment thread examples/k8s_admission.rego
Comment thread scripts/smoke.sh Outdated
kanywst added 7 commits May 27, 2026 23:36
- examples/README.md: drop misleading "curl" wording in the stdio note
- examples/k8s_admission.rego: use object.get with fallbacks so an
  undefined namespace/name doesn't make sprintf evaluate to undefined and
  silently swallow the violation
- scripts/smoke.sh: select the tools/call response by id=2 instead of
  tail -1 (more robust against stray output lines)
- workflows: pin actions to full commit SHAs and set
  persist-credentials: false on checkout (zizmor / CodeRabbit hardening)
- smoke: build and run the full MCP handshake via `make smoke`. Catches
  regressions in the actual server, not just unit tests.
- vuln: govulncheck (Go reachable-CVE scan) + osv-scanner (OSV.dev cross-
  ecosystem scan).
- actionlint: lint the workflow files themselves (catches typos, bad
  refs, missing inputs).
- test: emit coverage with -covermode=atomic and print the function-level
  summary in the job output.

All actions pinned to SHAs with version comments for Dependabot tracking.
…sv-scanner findings

Pulled forward via OPA's transitive graph. 14 OSV advisories against
v0.50.0 / v0.43.0 (all unrated/Unknown severity, none reachable by our
code per govulncheck). Bumping clears the noise so osv-scanner doesn't
gate the PR.
@kanywst kanywst merged commit 987cc01 into main May 27, 2026
6 checks passed
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