-
Notifications
You must be signed in to change notification settings - Fork 376
[Nexthop][fboss2-dev] Add a "fboss2 config history" command. #759
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
Closed
benoit-nexthop
wants to merge
1
commit into
facebook:main
from
nexthop-ai:fboss2-cli-prototype_part07
Closed
[Nexthop][fboss2-dev] Add a "fboss2 config history" command. #759
benoit-nexthop
wants to merge
1
commit into
facebook:main
from
nexthop-ai:fboss2-cli-prototype_part07
Conversation
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
0e8e5eb to
249c7cf
Compare
This was referenced Dec 23, 2025
Closed
a965dbb to
0fe0152
Compare
b57e4d2 to
2fe0271
Compare
f1b4246 to
575d211
Compare
meta-codesync bot
pushed a commit
that referenced
this pull request
Jan 15, 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` This adds just the command `fboss2-dev config rollback`. Note: this change is part of a series, the previous one is #757, the next one is #759. Pull Request resolved: #758 Test Plan: Unit tests. ## Sample usage In this state: ``` [admin@fboss101 benoit]$ ./fboss2-dev config history Revision Owner Commit Time ------------------------------------------ r1 root 2025-11-05 13:26:58 r2 root 2025-11-05 13:27:35 r3 root 2025-11-05 13:28:13 r4 admin 2025-11-05 14:37:51 r5 admin 2025-11-05 14:38:31 ``` One can do `fboss2 config rollback r3` or just `fboss2 config rollback` to just go back to whatever was the last revision. Doing so creates a new revision (`r6` in this example) that is identical to the one we rolled back to. Reviewed By: shiva-menta Differential Revision: D90739629 Pulled By: joseph5wu fbshipit-source-id: 5acef8e3a63a0bee5116526fb5baf47225a79c03
575d211 to
14fdc36
Compare
|
@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D90801711. |
|
@joseph5wu merged this pull request in 6f38394. |
meta-codesync bot
pushed a commit
that referenced
this pull request
Jan 21, 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` Add some helper code to process interface-list arguments. Note: this change is part of a series, the previous one is #759, the next one is #761. Pull Request resolved: #760 Test Plan: Unit tests. New end to end tests for this command are in #783. ## Sample usage ``` [admin@fboss101 benoit]$ ./fboss2-dev show interface | head +-----------+--------+-------+------+------+------------------------------+----------------------------+ | Interface | Status | Speed | VLAN | MTU | Addresses | Description | -------------------------------------------------------------------------------------------------------- | eth1/1/1 | down | 800G | 2001 | 1500 | 10.0.0.0/24 | Test port for diff command | | | | | | | 2400::/64 | | | | | | | | fe80::b4db:91ff:fe95:ff07/64 | | +-----------+--------+-------+------+------+------------------------------+----------------------------+ | eth1/2/1 | down | 200G | 2003 | 9216 | 11.0.0.0/24 | Another test description | | | | | | | 2401::/64 | | | | | | | | fe80::b4db:91ff:fe95:ff07/64 | | [admin@fboss101 benoit]$ ./fboss2-dev config interface eth1/2/1 description 'This is a test.' Successfully set description for interface(s) eth1/2/1 [admin@fboss101 benoit]$ ./fboss2-dev config session diff --- /etc/coop/agent.conf 2025-11-05 12:49:14.497415902 -0800 +++ /home/admin/.fboss2/agent.conf 2025-11-05 12:57:27.123758309 -0800 @@ -2230,7 +2230,7 @@ }, { "conditionalEntropyRehash": false, - "description": "Another test description", + "description": "This is a test.", "drainState": 0, "expectedLLDPValues": { "2": "eth1/6/1" [admin@fboss101 benoit]$ ./fboss2-dev config session commit Config session committed successfully and config reloaded. [admin@fboss101 benoit]$ ./fboss2-dev show interface | head +-----------+--------+-------+------+------+------------------------------+----------------------------+ | Interface | Status | Speed | VLAN | MTU | Addresses | Description | -------------------------------------------------------------------------------------------------------- | eth1/1/1 | down | 800G | 2001 | 1500 | 10.0.0.0/24 | Test port for diff command | | | | | | | 2400::/64 | | | | | | | | fe80::b4db:91ff:fe95:ff07/64 | | +-----------+--------+-------+------+------+------------------------------+----------------------------+ | eth1/2/1 | down | 200G | 2003 | 9216 | 11.0.0.0/24 | This is a test. | | | | | | | 2401::/64 | | | | | | | | fe80::b4db:91ff:fe95:ff07/64 | | ``` Changing two interfaces (or more) at the same time: ``` [admin@fboss101 benoit]$ ./fboss2-dev config interface eth1/1/1 eth1/2/1 description "two at once" Successfully set description for interface(s) eth1/1/1, eth1/2/1 [admin@fboss101 benoit]$ ./fboss2-dev config session diff --- current live config +++ session config @@ -2200,7 +2200,7 @@ "ports": [ { "conditionalEntropyRehash": false, - "description": "two", + "description": "two at once", "drainState": 0, "expectedLLDPValues": { "2": "eth1/5/1" @@ -2230,7 +2230,7 @@ }, { "conditionalEntropyRehash": false, - "description": "two", + "description": "two at once", "drainState": 0, "expectedLLDPValues": { "2": "eth1/6/1" [admin@fboss101 benoit]$ ./fboss2-dev config session commit Config session committed successfully as ede5a52 and config reloaded. [admin@fboss101 benoit]$ ./fboss2-dev show interface eth1/1/1 eth1/2/1 +-----------+--------+-------+------+------+------------------------------+-------------+ | Interface | Status | Speed | VLAN | MTU | Addresses | Description | ----------------------------------------------------------------------------------------- | eth1/1/1 | down | 800G | 2001 | 9000 | 10.0.0.0/24 | two at once | | | | | | | 2400::/64 | | | | | | | | fe80::b4db:91ff:fe95:ff07/64 | | +-----------+--------+-------+------+------+------------------------------+-------------+ | eth1/2/1 | down | 200G | 2003 | 9216 | 11.0.0.0/24 | two at once | | | | | | | 2401::/64 | | | | | | | | fe80::b4db:91ff:fe95:ff07/64 | | +-----------+--------+-------+------+------+------------------------------+-------------+ ``` Referencing an interface that doesn't exist: ``` [admin@fboss101 benoit]$ ./fboss2-dev config interface eth1/9/42 description oopsy Invalid argument: Port(s) or interface(s) not found in configuration: eth1/9/42. Ports must exist in the hardware platform mapping and be defined in the configuration before they can be configured. ``` Nothing changes when mixing valid and nonexistent interface names: ``` [admin@fboss101 benoit]$ ./fboss2-dev config interface eth1/1/1 eth1/9/42 description oopsy Invalid argument: Port(s) or interface(s) not found in configuration: eth1/9/42. Ports must exist in the hardware platform mapping and be defined in the configuration before they can be configured. E0120 14:32:19.177613 42717 CmdHandler.cpp:280] localhost - Error in command execution: Invalid argument: Port(s) or interface(s) not found in configuration: eth1/9/42. Ports must exist in the hardware platform mapping and be defined in the configuration before they can be configured. [admin@fboss101 benoit]$ ./fboss2-dev config session diff No differences between current live config and session config. ``` Reviewed By: shiva-menta Differential Revision: D91058688 Pulled By: joseph5wu fbshipit-source-id: 0d8cafe136f120a7b1163c3dfdb16fced8a2b605
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
This adds just the command
fboss2 config history.Note: this change is part of a series, the previous one is #758, the next one is #760.
Test Plan
Unit tests.
Sample usage