Skip to content

Add API contract validation example (example 12)#974

Open
kelos-bot[bot] wants to merge 2 commits intomainfrom
kelos-task-972
Open

Add API contract validation example (example 12)#974
kelos-bot[bot] wants to merge 2 commits intomainfrom
kelos-task-972

Conversation

@kelos-bot
Copy link
Copy Markdown

@kelos-bot kelos-bot Bot commented Apr 12, 2026

What type of PR is this?

/kind docs

What this PR does / why we need it:

Adds a new example (examples/12-api-contract-validation/) demonstrating an end-to-end API contract validation pipeline using current Kelos primitives. The example includes:

  • PR-triggered validation — A webhook TaskSpawner that listens for /validate-api comments on PRs, runs structural diff tools, classifies changes (non-breaking/potentially breaking/breaking), and posts review findings.
  • Scheduled compatibility audit — A cron TaskSpawner that runs weekly to detect unreleased API drift and creates GitHub issues with findings.
  • Consumer update pipeline — A two-stage task pipeline using dependsOn that identifies affected consumers and generates migration guides when intentional breaking changes are approved.
  • AgentConfig — Shared instructions for the API validator agent with classification conventions and tool guidance.

Also updates the examples README index with the new entry.

Which issue(s) this PR is related to:

Fixes #972

Special notes for your reviewer:

This is a documentation-only PR — all files are YAML configs, Markdown, or Kubernetes Secret templates. No Go code changes. The YAML files pass yamlfmt -lint formatting checks.

The configurations use existing Kelos API primitives (githubWebhook, cron, dependsOn, AgentConfig, bodyContains). The README notes complementary issues (#778, #884, #842, #881) that would enhance the workflow.

Does this PR introduce a user-facing change?

NONE

Summary by cubic

Adds example 12: an end-to-end API contract validation pipeline with PR-triggered checks, a weekly audit, and a consumer migration flow. Improves coverage for JSON OpenAPI files and simplifies setup.

  • New Features

    • New example at examples/12-api-contract-validation/ with README and manifests
    • Webhook TaskSpawner listens for /validate-api PR comments and posts validation results
    • Cron TaskSpawner runs a weekly compatibility audit and files GitHub issues
    • Two-stage migration pipeline (identify-consumersgenerate-migration-guide) using dependsOn
    • Shared AgentConfig with tool guidance (oasdiff, buf, graphql-inspector, gh); includes secrets and workspace templates, plus examples index update
  • Refinements

    • Cron audit diff includes *.json to cover JSON OpenAPI specs
    • Removed manual PR branch checkout step; Kelos handles checkout automatically

Written for commit 1a41397. Summary will update on new commits.

@github-actions github-actions Bot added needs-triage needs-kind Indicates an issue or PR lacks a kind/* label needs-priority kind/docs needs-actor release-note-none and removed needs-kind Indicates an issue or PR lacks a kind/* label labels Apr 12, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="examples/12-api-contract-validation/taskspawner-cron.yaml">

<violation number="1" location="examples/12-api-contract-validation/taskspawner-cron.yaml:27">
P2: Include `*.json` in the diff command; the current command skips JSON OpenAPI files despite the stated scope.</violation>
</file>

<file name="examples/12-api-contract-validation/taskspawner-webhook.yaml">

<violation number="1" location="examples/12-api-contract-validation/taskspawner-webhook.yaml:35">
P2: Remove the manual PR branch checkout instruction; Kelos already handles PR branch checkout automatically.

(Based on your team's feedback about avoiding manual git checkout steps in Kelos prompts.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread examples/12-api-contract-validation/taskspawner-cron.yaml Outdated
Comment thread examples/12-api-contract-validation/taskspawner-webhook.yaml Outdated
gjkim42 and others added 2 commits April 12, 2026 12:54
Add a new example demonstrating an end-to-end API contract validation
pipeline using current Kelos primitives. Includes:
- PR-triggered validation via /validate-api comment (webhook TaskSpawner)
- Weekly cross-service compatibility audit (cron TaskSpawner)
- Consumer update pipeline with dependsOn task chaining
- AgentConfig with API validation specialist instructions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Include *.json in the cron audit git diff command to cover JSON OpenAPI files
- Remove manual PR branch checkout instruction since Kelos handles this automatically

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kelos-bot kelos-bot Bot force-pushed the kelos-task-972 branch from 43120f7 to 1a41397 Compare April 12, 2026 13:06
kelos-bot Bot pushed a commit that referenced this pull request Apr 14, 2026
…eedback

Adds conventions learned from recent PR reviews:

1. Fail fast on invalid configuration (PR #971): three P1 and four P2
   issues flagged silent degradation when credentials or config were
   invalid, falling back to unauthenticated requests instead of
   erroring.

2. No manual PR branch checkout in TaskSpawner prompts (PR #974): Kelos
   already checks out the PR branch automatically; manual checkout
   instructions are redundant and confusing.

Also carries forward the previously proposed changes from PR #786:
- os.Getenv() secret-in-flag-defaults convention (PR #971)
- TaskSpawner creation conventions (PR #965)
- Branch template variable documentation fix (PR #965)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New use case: API contract validation and backward-compatibility enforcement pipeline via PR-triggered and scheduled agent workflows

1 participant