Skip to content

Conversation

@benoit-nexthop
Copy link
Contributor

@benoit-nexthop benoit-nexthop commented Dec 18, 2025

Pre-submission checklist

  • 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
  • pre-commit run

Summary

This adds just the command fboss2-dev config session diff.

Note: this change is part of a series, the previous one is #756, the next one is #758.

Test Plan

Unit tests.

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/1/1 mtu 9000
Successfully set MTU for interface(s) eth1/1/1 to 9000
[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
@@ -369,7 +369,7 @@
         ],
         "isStateSyncDisabled": true,
         "isVirtual": false,
-        "mtu": 1500,
+        "mtu": 9000,
         "routerID": 0,
         "scope": 0,
         "type": 1,
@@ -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 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

You can also do fboss2-dev config diff r2 r4 or fboss2-dev config diff r1 current to compare committed revisions.

@meta-cla meta-cla bot added the CLA Signed label Dec 18, 2025
@benoit-nexthop benoit-nexthop marked this pull request as ready for review December 18, 2025 00:37
@benoit-nexthop benoit-nexthop force-pushed the fboss2-cli-prototype_part05 branch 2 times, most recently from f6831c4 to e2bf742 Compare December 23, 2025 21:38
@benoit-nexthop benoit-nexthop force-pushed the fboss2-cli-prototype_part05 branch 5 times, most recently from cecc63e to 5fda2b2 Compare December 30, 2025 15:50
@benoit-nexthop benoit-nexthop force-pushed the fboss2-cli-prototype_part05 branch 2 times, most recently from 7aaa0aa to 86c4d4c Compare January 6, 2026 00:22
meta-codesync bot pushed a commit that referenced this pull request Jan 6, 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 can handle only one session per user, the current live config is
copied into `~/.fboss2/agent.conf` and when committing an atomic symlink
update is performed on /etc/coop/agent.conf, which is the only config
file supported by this basic prototype.

Note: this change is part of a series, the previous one is #755, the next one is #757.

Pull Request resolved: #756

Test Plan: Unit tests.

Reviewed By: KevinYakar

Differential Revision: D90088260

Pulled By: joseph5wu

fbshipit-source-id: 14aacaae143bb6c70455e592512d6afb31a95fbe
@benoit-nexthop benoit-nexthop force-pushed the fboss2-cli-prototype_part05 branch from 86c4d4c to 43ab4b1 Compare January 7, 2026 06:28
@meta-codesync
Copy link

meta-codesync bot commented Jan 7, 2026

@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D90277033.

@meta-codesync
Copy link

meta-codesync bot commented Jan 10, 2026

@joseph5wu merged this pull request in adf3fa4.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants