[APIE-989] Initial generated code for Symphony control plane APIs (Don't Merge)#3331
[APIE-989] Initial generated code for Symphony control plane APIs (Don't Merge)#3331Channing Dong (channingdong) wants to merge 5 commits intomainfrom
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Introduces initial generated CLI and client support for Symphony/RTCE control plane APIs, including RTCE regions and RTCE topic CRUD, plus corresponding test-server routes and tests.
Changes:
- Add RTCE API client wiring and list/create/get/update/delete helpers in
pkg/ccloudv2. - Add
confluent rtcecommand group withregion listandrtce-topicsubcommands. - Add test-server handlers/routes and new integration/live tests for RTCE commands.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/ccloudv2/client.go |
Wires an RTCE SDK client into the shared v2 client. |
pkg/ccloudv2/rtce.go |
Adds RTCE API wrapper methods (topics + regions). |
internal/command.go |
Registers the new rtce top-level command group. |
internal/rtce/* |
Implements RTCE CLI commands (regions + rtce-topic CRUD + autocomplete). |
test/test-server/ccloudv2_router.go |
Registers RTCE routes in the test server. |
test/test-server/region_handler.go |
Adds test-server handler for RTCE regions. |
test/test-server/rtce_topic_handler.go |
Adds test-server handlers for RTCE topics endpoints. |
test/region_test.go |
Adds integration tests for rtce region list. |
test/rtce_topic_test.go |
Adds integration tests for rtce rtce-topic commands. |
test/live/region_live_test.go |
Adds live test for RTCE region listing. |
test/live/rtce_topic_live_test.go |
Adds live CRUD test for RTCE topics. |
go.mod |
Adds RTCE SDK dependency (currently with a local replace). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Variables | ||
| regionName := uniqueName("region") | ||
|
|
||
| // Cleanup (LIFO) | ||
|
|
||
| steps := []CLILiveTest{ | ||
| { | ||
| Name: "List rtce regions", | ||
| Args: "rtce region list", | ||
| UseStateVars: true, | ||
| ExitCode: 0, | ||
| Contains: []string{regionName}, | ||
| }, |
There was a problem hiding this comment.
regionName is randomly generated but never used to create a region; asserting Contains: []string{regionName} will be flaky/always fail against real environments. Either assert on a known region value (from config) or remove the Contains check and only validate exit code/output structure.
There was a problem hiding this comment.
This is a live test specific issue, we will address it in the upcoming commits.
| switch topic_name { | ||
| case "invalid": | ||
| w.WriteHeader(http.StatusNotFound) | ||
| default: |
There was a problem hiding this comment.
For consistency with other test-server handlers (and to match CLI error parsing), the invalid-resource path should write a structured error body (e.g., via writeResourceNotFoundError(w)) rather than only setting a 404 status with an empty body.
| topic_name := mux.Vars(r)["topic_name"] | ||
| switch r.Method { |
There was a problem hiding this comment.
Use Go-style camelCase for local variables. topic_name is inconsistent with the rest of this package (e.g., most handlers use id, envId, etc.). Rename to topicName for readability.
| func readRtceV1RtceTopicFile(t *testing.T, filename string) rtcev1.RtceV1RtceTopic { | ||
| jsonPath := filepath.Join("..", "fixtures", "input", "rtce", "rtce_topic", filename) | ||
| jsonData, err := os.ReadFile(jsonPath) | ||
| require.NoError(t, err) |
There was a problem hiding this comment.
This handler reads RTCE topic fixtures from test/fixtures/input/rtce/..., but that fixtures directory/files are not present in the repo. Add the fixtures (and ensure the relative path matches the test runner working directory) or the test server will panic/fail when the endpoint is hit.
| func readRtceV1RegionFile(t *testing.T, filename string) rtcev1.RtceV1Region { | ||
| jsonPath := filepath.Join("..", "fixtures", "input", "rtce", "region", filename) | ||
| jsonData, err := os.ReadFile(jsonPath) | ||
| require.NoError(t, err) |
There was a problem hiding this comment.
This handler reads RTCE region fixtures from test/fixtures/input/rtce/..., but that fixtures directory/files are not present in the repo. Add the fixtures (and ensure the relative path matches the test runner working directory) or the test server will panic/fail when the endpoint is hit.
| *pcmd.AuthenticatedCLICommand | ||
| } | ||
|
|
||
| type regionOut struct { |
There was a problem hiding this comment.
I suppose the RTCE region output table looks good? We can always add more stuff in the future if we want, but adding more fields now and reducing later will be hard, so we recommend starting with these.
Release Notes
Breaking Changes
New Features
Bug Fixes
Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Blast Radius
References
Test & Review