[codex] Preserve raw log output for log operations#22
Merged
ChiragAgg5k merged 2 commits intomainfrom Apr 2, 2026
Merged
Conversation
Greptile SummaryThis PR restores the intended raw-body semantics for
Confidence Score: 5/5Safe to merge — targeted fix with no breaking changes and good regression coverage. All three changed files are clean with no logic, syntax, or security issues. The fix is a minimal addition to an existing match expression, HTTP error propagation is unaffected, and two new unit tests directly validate both the fixed path and the unchanged hydration path. No P0 or P1 findings. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix: address review feedback" | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix log operations to always return the raw response body instead of hydrating JSON-looking log payloads into resource objects.
Root Cause
runOperation(Operation::LOG, ...)stopped special-casing log responses and started routing them through the generic JSON hydration path. When a pod log body contained valid JSON,php-k8swould hydrate it into the current resource class, such asK8sPod, instead of returning the log text. That broke callers expectinglogs()andcontainerLogs()to return strings.Changes
Operation::LOGinKubernetesCluster::runOperation()Validation
vendor/bin/phpunit --no-coverage tests/KubernetesClusterTest.phpImpact
This preserves the intended Kubernetes pod log semantics for callers that consume structured JSON logs while keeping normal resource hydration unchanged.