[Nexthop][fboss2-dev] Save the config commands to CLI metadata and in session commit.#809
Closed
benoit-nexthop wants to merge 2 commits intofacebook:mainfrom
Closed
[Nexthop][fboss2-dev] Save the config commands to CLI metadata and in session commit.#809benoit-nexthop wants to merge 2 commits intofacebook:mainfrom
benoit-nexthop wants to merge 2 commits intofacebook:mainfrom
Conversation
2 tasks
42fe595 to
58cf5a1
Compare
2 tasks
e88c524 to
0304b7c
Compare
0304b7c to
31eb904
Compare
meta-codesync bot
pushed a commit
that referenced
this pull request
Feb 18, 2026
Summary: **Pre-submission checklist** - [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install` - [x] `pre-commit run` A recent merge introduced a duplicate command by mistake (bad merge on my part) and this escaped because of lack of test coverage. Also make sure we keep `cmake/CliFboss2Test.cmake` sorted. Note: this change is part of a series, the previous one is #791, the next one is #809. Pull Request resolved: #805 Test Plan: New regression unit test. Reviewed By: AarjunC Differential Revision: D93523408 Pulled By: joseph5wu fbshipit-source-id: 87c4920c1fa1730631eafbf0a31e8c179145dc0d
d3095ec to
aaed4ff
Compare
|
@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D93669865. |
joseph5wu
requested changes
Feb 19, 2026
Contributor
joseph5wu
left a comment
There was a problem hiding this comment.
Please address the unit test failure from the github action
https://github.com/facebook/fboss/actions/runs/22161929622/job/64082894482
| fs::create_directories(sessionDir); | ||
| std::ofstream metaFile(metadataFile); | ||
| metaFile << R"({ | ||
| "action": {"WEDGE_AGENT": "HITLESS"}, |
Contributor
There was a problem hiding this comment.
"WEDGE_AGENT" -> "AGENT"
|
|
||
| // Setup mock agent server | ||
| setupMockedAgentServer(); | ||
| EXPECT_CALL(getMockAgent(), reloadConfig()).Times(1); |
Contributor
There was a problem hiding this comment.
Our internal run failed on this unit test:
❯❯❯ buck test //fboss/cli/fboss2/test:cmd_test
File changed: fbcode//fboss/cli/fboss2/test/CmdConfigSessionTest.cpp
✗ Fail: fbcode//fboss/cli/fboss2/test:cmd_test - ConfigSessionTestFixture.commitOnNewlyInitializedSession (3.9s)
Note: Google Test filter = ConfigSessionTestFixture.commitOnNewlyInitializedSession
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ConfigSessionTestFixture
[ RUN ] ConfigSessionTestFixture.commitOnNewlyInitializedSession
fbcode/fboss/cli/fboss2/test/CmdConfigSessionTest.cpp:284: Failure
Actual function call count doesn't match EXPECT_CALL(getMockAgent(), reloadConfig())...
Expected: to be called once
Actual: never called - unsatisfied and active
[ FAILED ] ConfigSessionTestFixture.commitOnNewlyInitializedSession (3921 ms)
Now every config command is saved in the CLI session metadata so we can easily tell what commands were used in a given session. The metadata is now also saved along the config when we commit the session. A future commit will make rollback also rely on this metadata to decide whether or not to restart the agent.
aaed4ff to
17e16c5
Compare
Contributor
|
@benoit-nexthop has updated the pull request. You must reimport the pull request before landing. |
|
@joseph5wu merged this pull request in 9816430. |
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
Now every config command is saved in the CLI session metadata so we can
easily tell what commands were used in a given session. The metadata is
now also saved along the config when we commit the session. A future
commit will make rollback also rely on this metadata to decide whether
or not to restart the agent.
Note: this change is part of a series, the previous one is #805, the next one is #825.
Test Plan
New unit tests added.
Sample usage