feat(phase6-7-8): AI explain, cache, expanded coverage, server/mcp mode#129
Conversation
…server & MCP Phase 6 - AI Explain Mode: - Add prompt template system (src/ai/prompts.ts) with language selection - Add text anonymization utilities (src/utils/text.ts) for K8s name masking - Extend AnalysisOptions with explain, backend, language, anonymize flags - Integrate explain flow into analysis engine with cache-check pipeline - Add --explain, --backend, --language, --anonymize, --no-cache CLI flags - Add 9 new AI providers: Azure OpenAI, Cohere, Google Gemini, Vertex AI, Amazon Bedrock, Hugging Face, Groq, IBM watsonx, OCI GenAI Phase 7 - Cache System: - Add CacheProvider interface and FileCacheProvider implementation - Add cache factory with config-driven provider selection - Add cache CLI commands: list, get, remove, purge - Integrate cache into AI explain pipeline with SHA-256 keying Phase 8 - Expanded Coverage: - Add 17 new analyzers: ReplicaSet, StatefulSet, DaemonSet, Job, CronJob, Ingress, ConfigMap, HPA, PDB, NetworkPolicy, Events, Logs, Security, Storage, GatewayClass, Gateway, HTTPRoute - Extend K8s client with Batch, Networking, Autoscaling, Policy, Storage, CustomObjects API accessors - Add HTTP server mode with /health, /analyze, /filters, /config endpoints - Add MCP server with stdio JSON-RPC protocol and 4 analysis tools - Add integration registry with KEDA, Kyverno, Prometheus analyzers - Add custom analyzer framework (command/HTTP execution modes) - Add serve and custom-analyzer CLI commands Tests: 191 passing across 20 test files (58 new tests added)
Test improvements: - Complete rewrite of phase8-analyzers.test.ts (26 → 76 tests) - Add missing SecurityAnalyzer and LogAnalyzer test coverage - Add healthy-resource green-path tests for every analyzer - Add API failure propagation tests via parameterized it.each - Add result metadata assertions (kind, name, namespace) - Add edge case tests: conditions with messages, singular/plural, multi-rule scenarios, pod-level vs container-level security - Follow coding_style.md: it.each for structural deduplication, JSDoc Cleanup: - Remove tracked .DS_Store from git - Add .DS_Store to .gitignore
|
Warning Review limit reached
More reviews will be available in 27 minutes and 11 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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (64)
Note
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…ov patch coverage - Extracted helper functions in log-analyzer.ts and server.ts to reduce nesting depth/complexity. - Deduplicated custom resource integrations in integrations.ts using analyzeCustomObjects helper. - Added JSDocs to networkpolicy.ts. - Consolidated phase8 healthy green path test cases in phase8-analyzers.test.ts into a parameterized block to avoid duplicate test assertions and reduce file size. - Wrote full unit/integration test coverage for kubernetes-resources.test.ts, server.test.ts, mcp.test.ts, and explain.test.ts cache/anonymize paths. - Global statement coverage is now 90.08%, and all 298 tests pass.
… for CodeScene - Extracted routing check in server.ts to routeRequest to reduce createServer complexity. - Extracted unhealthy check in log-analyzer.ts to reduce analyze complexity. - Refactored custom objects integrations in integrations.ts to use map/fetch helpers and a factory. - Extracted verifyAnalyzerFailure assertion helper in phase8-analyzers.test.ts to remove test duplication.
…plex checks, remove empty describes
…guments in phase8 tests
There was a problem hiding this comment.
Our agent can fix these. Install it.
Gates Passed
3 Quality Gates Passed
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
This PR contains implementation for Phase 6, 7, and 8 including AI explain mode, cache system, 17 new analyzers, server mode, MCP server, and integrations.