feat: add composedSchemaBreakingChanges to UpdateProposalResponse#2627
Conversation
WalkthroughA new repeated field Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2627 +/- ##
==========================================
- Coverage 41.42% 38.38% -3.04%
==========================================
Files 799 969 +170
Lines 118919 125253 +6334
Branches 9618 5419 -4199
==========================================
- Hits 49259 48077 -1182
- Misses 69298 75490 +6192
- Partials 362 1686 +1324
🚀 New features to boost your workflow:
|
Router image scan passed✅ No security vulnerabilities found in image: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
controlplane/src/core/bufservices/proposal/updateProposal.ts (1)
61-81: Consider extracting a helper for error responses to reduce duplication.There are ~15 similar error response objects in this file. A helper function like
createErrorResponse(code, details)would reduce duplication and make future field additions easier. This is a nice-to-have for a future cleanup.♻️ Example helper function
function createErrorResponse( code: EnumStatusCode, details: string, ): PlainMessage<UpdateProposalResponse> { return { response: { code, details }, breakingChanges: [], nonBreakingChanges: [], compositionErrors: [], checkId: '', lintWarnings: [], lintErrors: [], graphPruneWarnings: [], graphPruneErrors: [], compositionWarnings: [], lintingSkipped: false, graphPruningSkipped: false, checkUrl: '', composedSchemaBreakingChanges: [], }; }Usage:
- return { - response: { - code: EnumStatusCode.ERR_NOT_FOUND, - details: `Namespace ${req.namespace} not found`, - }, - breakingChanges: [], - ... - composedSchemaBreakingChanges: [], - }; + return createErrorResponse( + EnumStatusCode.ERR_NOT_FOUND, + `Namespace ${req.namespace} not found`, + );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@controlplane/src/core/bufservices/proposal/updateProposal.ts` around lines 61 - 81, There are many duplicated error response objects in updateProposal.ts (e.g., the block returning a PlainMessage with response: { code: EnumStatusCode.ERR_NOT_FOUND, details: `Namespace ${req.namespace} not found` }) — add a helper function (e.g., createErrorResponse(code: EnumStatusCode, details: string): PlainMessage<UpdateProposalResponse>) and replace each duplicated return with a call to createErrorResponse(...) so all fields (breakingChanges, nonBreakingChanges, compositionErrors, etc.) are populated consistently from one place; update uses in the updateProposal handler where req.namespace and other checks occur.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@controlplane/src/core/bufservices/proposal/updateProposal.ts`:
- Around line 61-81: There are many duplicated error response objects in
updateProposal.ts (e.g., the block returning a PlainMessage with response: {
code: EnumStatusCode.ERR_NOT_FOUND, details: `Namespace ${req.namespace} not
found` }) — add a helper function (e.g., createErrorResponse(code:
EnumStatusCode, details: string): PlainMessage<UpdateProposalResponse>) and
replace each duplicated return with a call to createErrorResponse(...) so all
fields (breakingChanges, nonBreakingChanges, compositionErrors, etc.) are
populated consistently from one place; update uses in the updateProposal handler
where req.namespace and other checks occur.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6da51a4b-14e0-424e-8e10-f834fa239307
⛔ Files ignored due to path filters (1)
connect-go/gen/proto/wg/cosmo/platform/v1/platform.pb.gois excluded by!**/*.pb.go,!**/gen/**
📒 Files selected for processing (3)
connect/src/wg/cosmo/platform/v1/platform_pb.tscontrolplane/src/core/bufservices/proposal/updateProposal.tsproto/wg/cosmo/platform/v1/platform.proto
This PR returns the composedSchema breaking changes on updating a proposal. This would help hub with evaluating the check on its ui.
Summary by CodeRabbit
Release Notes
Checklist