Skip to content

feat: breaking schema change detection with governance webhooks#2371

Open
boyney123 wants to merge 16 commits intomainfrom
feature/breaking-schema-changes
Open

feat: breaking schema change detection with governance webhooks#2371
boyney123 wants to merge 16 commits intomainfrom
feature/breaking-schema-changes

Conversation

@boyney123
Copy link
Copy Markdown
Collaborator

Summary

  • New @eventcatalog/breaking-changes package that detects breaking JSON Schema changes (added/removed required fields, type changes, required status changes) per compatibility strategy (BACKWARD, FORWARD, FULL, NONE)
  • New schema_breaking_change governance trigger — fires when a schema change is detected as breaking per the configured strategy
  • Users configure their compatibility strategy globally in governance.yaml via a new compatibility.strategy field
  • CloudEvents-compliant webhook payload includes detailed breaking change info (field, change type, human-readable message), impacted consumers/producers, and schema hashes

Example governance.yaml:

compatibility:
  strategy: BACKWARD

rules:
  - name: notify-on-breaking-schema
    when: [schema_breaking_change]
    resources:
      - type: event
        id: "*"
    actions:
      - type: webhook
        url: https://example.com/breaking-changes

Test plan

  • 40 tests for @eventcatalog/breaking-changes package (differ + rules + integration)
  • 104 governance tests in CLI package (all existing + 8 new for breaking change detection)
  • Package builds successfully with tsup
  • Manual test with a real catalog and governance.yaml

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

boyney123 and others added 12 commits March 23, 2026 15:13
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…velope

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: cb74d30

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@eventcatalog/breaking-changes Minor
@eventcatalog/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
eventcatalog-playground Ignored Ignored Mar 23, 2026 4:03pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f81bff4f48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…bjects

- Detect root-level type changes (e.g., object → array)
- Recurse into nested schemas that have properties/required but no explicit type

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea7e4b0fa0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

boyney123 and others added 2 commits March 23, 2026 16:28
- Validate strategy against BACKWARD/FORWARD/FULL/NONE on config load
- Narrow try/catch to only JSON.parse so detectBreakingChanges errors propagate

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03fb605ebf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb74d30a7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

return { rules };
if (parsed?.compatibility?.strategy) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject empty compatibility strategy values

The compatibility strategy validation only runs when parsed?.compatibility?.strategy is truthy, so malformed configs like compatibility: { strategy: "" } (or other falsy non-enum values) bypass validation and are returned as-is. Downstream, evaluateBreakingSchemaChangeRules treats this as “no strategy,” so schema_breaking_change rules silently never fire and fail/webhook enforcement can be skipped by an invalid config instead of producing a clear error.

Useful? React with 👍 / 👎.

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