Repository navigation
[Nexthop][fboss2-dev] Show only the user change in config session diff - #1991
Open
saty-nexthop wants to merge 1 commit into
Open
saty-nexthop wants to merge 1 commit into
saty-nexthop wants to merge 1 commit into
Conversation
"fboss2-dev config session diff" showed thousands of changed lines for one small change. saveConfig() writes the session file through the thrift struct, so the file has sorted keys and default values. The live file does not. - New ConfigSession::normalizedConfigJson() returns a config text in the form that saveConfig() writes, for the agent and BGP configs. Text that does not parse stays raw, with a warning on stderr. - The diff command normalizes both texts before "diff -u", in each mode. No file on disk changes. A normalized text gets the label suffix " (normalized)". - The normalized diff cannot show a key that the schema does not know. One warning line names each such key whose value differs between the two raw texts.
saty-nexthop
force-pushed
the
fboss2-session-diff-user-change
branch
from
November 16, 2026 10:30
814f50b to
eaf361e
Compare
This branch has not been deployed
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.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
fboss2-dev config session diffshows thousands of changed lines for one small change.saveConfig()writes the session file through the thrift struct, with sorted keys and default values. The live file has neither.ConfigSession::normalizedConfigJson()writes the agent or BGP config text assaveConfig()does. Text that does not parse stays raw, with a warning.config session diffnormalizes both texts beforediff -u, in each mode, and adds(normalized)to the label. No file on disk changes.WARNINGline names each key that the schema does not know and whose raw value differs, because the normalized diff cannot show it.Test Plan
pre-commitpasses. Local cmake build (fake SAI,mainat e7ab695, with my other open fixes):fboss2_cmd_config_test1279 of 1279, including 25CmdConfigSessionDiff*tests.nullvalue.