-
Notifications
You must be signed in to change notification settings - Fork 28
feat(api-contract-guardian): prevent breaking OpenAPI/GraphQL changes with CI-ready agent #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…n with CI example and samples
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
New addition
User description
What’s included
Why
How it works
main)fail_onandexit_expressionKey features
Local usage
Diagram Walkthrough
flowchart TD A[Start: Run Agent] --> B[Load agent.toml config] B --> C{Discover schema globs provided?} C -->|Yes| D[Find OpenAPI/GraphQL files via globs] C -->|No| E[Use sensible default globs and discover files] D --> F[Checkout/read baseline from target_branch - default main] E --> F F --> G{Baseline available?} G -->|Yes| H[Parse schemas - current vs baseline] G -->|No| I[Treat as initial introduction; mark non-breaking unless configured] H --> J{Any parse errors?} J -->|Yes| K[Record critical findings and continue] J -->|No| L[Diff schemas with spec-aware rules] I --> M[Summarize as non-breaking introductions] L --> N{Breaking changes found?} N -->|Yes| O[Check allowlist IDs/expirations; downgrade/ignore where matched] N -->|No| M O --> P[Compile findings + migration guidance] M --> Q[Build summary: files, services, severities] P --> Q Q --> R[Emit structured JSON: summary, findings, approved, requires_changes] R --> S[Apply policy: fail_on + exit_expression] S --> T{Approved?} T -->|Yes| U[Pass CI/CD] T -->|No| V[Requires changes; block merge] U --> W[End] V --> W[End]PR Type
Enhancement
Description
Add API contract guardian agent for OpenAPI/GraphQL breaking changes
Include CI integration example for GitHub Actions
Provide sample schemas for testing and validation
Support allowlist exceptions with expiration dates
Diagram Walkthrough
File Walkthrough
README.md
Complete documentation for API contract guardianagents/api-contract-guardian/README.md
agent.toml
Core agent configuration and schema definitionagents/api-contract-guardian/agent.toml
github-actions.yml
GitHub Actions CI integration exampleagents/api-contract-guardian/examples/ci/github-actions.yml
openapi.yaml
Sample OpenAPI specification for testingagents/api-contract-guardian/examples/samples/openapi.yaml
schema.graphql
Sample GraphQL schema for testingagents/api-contract-guardian/examples/samples/schema.graphql