-
Notifications
You must be signed in to change notification settings - Fork 170
fix: correct transport type reporting in workload list endpoint #3313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Sanskarzz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where the /api/v1beta/workloads list endpoint incorrectly reported transport_type as streamable-http for workloads actually using stdio transport. The fix ensures the transport type is loaded from the stored run configuration (the source of truth) rather than relying solely on container labels.
Changes:
- Added
Transportfield tominimalRunConfigstruct to capture the transport type from stored configurations - Updated
WorkloadFromContainerInfoto use the transport type from the run configuration when available, falling back to labels only if the configuration is missing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkg/workloads/types/types.go
Outdated
| if runConfig.Transport != "" { | ||
| tType = runConfig.Transport | ||
| } |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transportType variable from line 69 is now unused after this change. The code first parses the label into transportType, then parses it again into tType, and then overwrites tType with the value from runConfig.Transport. Consider removing the transportType variable entirely and just using tType throughout, or rename the variable from line 69 to make it clear it's only used as a fallback.
pkg/workloads/types/types.go
Outdated
| if runConfig.Transport != "" { | ||
| tType = runConfig.Transport | ||
| } |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to the WorkloadFromContainerInfo function introduce new behavior for loading and using the transport type from the run configuration, but there are no tests covering this function. Consider adding unit tests to verify that:
- The transport type is correctly loaded from the run configuration when available
- The function falls back to the label-based transport type when the run configuration is missing or doesn't contain a transport field
- The URL is generated with the correct transport type from the run configuration
Signed-off-by: Sanskarzz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
amirejaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Sanskarzz, thanks for the contribution! The fix works, but we need to adjust how the container transport label is set.
Right now, the transport label stored on the container is using the proxy-mode value instead of the actual transport type. Because of that, we had to read the transport from runConfig. If we update the container label to correctly reflect the transport type, this additional logic can be removed and the correct value will already be available via the container labels.
…onfig Signed-off-by: Sanskarzz <[email protected]>
|
@Sanskarzz this looks good. There are some CI test failures and a few lint errors to address. |
Signed-off-by: Sanskarzz <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3313 +/- ##
==========================================
+ Coverage 64.78% 64.85% +0.06%
==========================================
Files 372 372
Lines 36292 36288 -4
==========================================
+ Hits 23513 23534 +21
+ Misses 10932 10905 -27
- Partials 1847 1849 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Issue: #3178
Description
This PR fixes a bug where the /api/v1beta/workloads (list) endpoint incorrectly reported the transport_type as streamable-http for workloads that were actually using stdio transport.
Changes
minimalRunConfigstruct inpkg/workloads/types/types.goto include the Transport field.WorkloadFromContainerInfoto:Load the actual transport type from the stored
RunConfig.Use state-of-truth transport type for both the domain model and URL generation.
Fall back to labels only if the run configuration is missing.