chore(go): use API executor for calling the API#660
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe Go API template is refactored to replace manual parameter handling, request component construction, and telemetry logic with a simplified executor-based pattern. Parameter validation is added upfront, and request building and execution are unified through an executor builder approach. Changes
Sequence DiagramsequenceDiagram
participant Client as Client Code
participant Template as Generated Operation
participant Validator as Parameter Validator
participant Executor as APIExecutor
participant API as Remote API
Client->>Template: Call Operation(params)
rect rgb(240, 248, 255)
Note over Template,Validator: Parameter Validation Phase
Template->>Validator: validatePathParameter()
Validator-->>Template: error or nil
Template->>Validator: validateParameter()
Validator-->>Template: error or nil
end
alt Validation Fails
Template-->>Client: Return early with error
else Validation Passes
rect rgb(245, 255, 250)
Note over Template,Executor: Request Building & Execution
Template->>Executor: NewAPIExecutorRequestBuilder()
Executor-->>Template: builder
Template->>Executor: ExecuteWithDecode() or Execute()
end
Executor->>API: Send HTTP Request
API-->>Executor: Response
Executor-->>Template: Decoded result or error
end
Template-->>Client: Return result/error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bb07d62 to
a48dfc4
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR performs cleanup by removing README generation from the base configuration and refactoring the Go SDK API template to use a centralized API executor pattern. The JS-specific OPEN_API_REF environment variable override is also removed from the GitHub workflow.
- Removes README.mustache from generated files in base config (file still exists in config/common/files/)
- Removes JS-specific OPEN_API_REF environment variable from test workflow
- Refactors Go API template to delegate HTTP execution to a centralized APIExecutor
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| config/common/config.base.json | Removes README.mustache file mapping from base configuration |
| .github/workflows/main.yaml | Removes OPEN_API_REF environment variable override for JS SDK tests |
| config/clients/go/template/api.mustache | Major refactoring to use APIExecutor pattern instead of inline HTTP handling |
a48dfc4 to
28b6b61
Compare
28b6b61 to
7ef8929
Compare
|
@rhamzeh
|
We moved those two to another PR (yours! :P) to get them merged faster. I'll remove them from the description here as they no longer apply |
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
mainSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.