feat: include schema version in graph update webhook#2467
Conversation
…roposals-in-graph-updated
WalkthroughRefactors proposal matching to return multiple matches, refreshes federated graphs after compose/deploy to update composedSchemaVersionId, accumulates published proposal details, and expands webhook payloads and emissions to include composedSchemaVersionId, published_proposals, and per-proposal PROPOSAL_STATE_UPDATED events. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@controlplane/src/core/bufservices/subgraph/deleteFederatedSubgraph.ts`:
- Around line 239-255: The published_proposals list currently includes proposals
from all graphs; restrict it to only proposals for the federated graph being
notified by filtering proposalDetailsList to proposals whose federated graph
identifier matches affectedFederatedGraph.id (e.g. proposalDetailsList.filter(p
=> p.federated_graph_id === affectedFederatedGraph.id || p.federatedGraphId ===
affectedFederatedGraph.id).map(...)) so that published_proposals only contains
id/name/namespace for proposals belonging to the targeted federated graph.
In `@controlplane/src/core/bufservices/subgraph/publishFederatedSubgraph.ts`:
- Around line 617-633: published_proposals is currently built from the entire
proposalDetailsList which can include proposals from other graphs; filter
proposalDetailsList to only include proposals belonging to the federated graph
being notified (e.g., proposalDetailsList.filter(p => p.graphId === graph.id)
or, if your data model uses namespace, filter by p.namespace ===
graph.namespace) before mapping to {id, name, namespace} so only graph-scoped
proposals are included in the published_proposals payload.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2467 +/- ##
==========================================
+ Coverage 1.50% 63.21% +61.71%
==========================================
Files 292 296 +4
Lines 46748 41474 -5274
Branches 431 4312 +3881
==========================================
+ Hits 703 26219 +25516
+ Misses 45762 15233 -30529
+ Partials 283 22 -261
🚀 New features to boost your workflow:
|
controlplane/src/core/bufservices/subgraph/deleteFederatedSubgraph.ts
Outdated
Show resolved
Hide resolved
…unctions by using Promise.all
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
…roposals-in-graph-updated
…d subgraph functions
…roposals-in-graph-updated
controlplane/src/core/bufservices/subgraph/publishFederatedSubgraph.ts
Outdated
Show resolved
Hide resolved
…tions to use local arrays
…-graph-updated' of github.com:wundergraph/cosmo into nithin/eng-8809-include-schema-version-and-proposals-in-graph-updated
…roposals-in-graph-updated
Summary by CodeRabbit
New Features
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.
Checklist