fix(cli): ignore null profile envelope metadata#2274
Merged
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
054bed2 to
2d60800
Compare
2d60800 to
a14d929
Compare
zhoujh01
approved these changes
May 28, 2026
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
profile: nullin success envelopes as absent when the Rust CLI unwraps dynamic JSON results.status/result/profileenvelope instead of nesting profile insideresult.ok/result) and existing table/text profile rendering behavior.ls-style list responses, profiled object responses, and null profile handling.Root Cause
PR #2125 (
e9e6ce5, "Feature/http profile middleware") added request-scoped HTTP profiling and introducedprofileon the standard server response model. The server currently exposes success responses in this envelope shape:{"status":"ok","result":[...],"error":null,"telemetry":null,"profile":null}When profiling is inactive,
profileis serialized asnull. The same PR also added CLI profile-preserving unwrap logic forserde_json::Value: if an envelope has anyprofilekey,unwrap_success_envelope()wraps or merges the payload withprofile. Because that check treatedprofile: nullas meaningful, commands likelsrendered an extra nestedresultlayer in compact JSON output:{"ok":true,"result":{"result":[...],"profile":null}}A real non-null profile should also remain envelope metadata rather than becoming business payload. With this PR:
profile: nullis treated as absent, so normal no-profile CLI output stays unchanged:{"ok":true,"result":[...]}{"status":"ok","result":[...],"profile":[...]}This keeps the existing CLI compact
ok/resultconvention for ordinary no-profile responses, but avoids inventing a second nested CLI envelope for profiled server metadata. This PR intentionally does not change the server response shape. PR #2215 only moved profile-aware table rendering order for component status output; it was not the source of this regression.Test Plan
cargo test -p ov_cligit diff --checkcargo run -q -p ov_cli -- ls viking:// --output jsonGET /api/v1/fs/ls?uri=viking://returnsstatus/result/error/telemetry/profileenvelope withprofile:nullwhen inactive.