Developer
Ron He
zecheng@meta.com
Performance
YoY:+481%Key patterns and highlights from this developer's activity.
Breakdown of growth, maintenance, and fixes effort over time.
Bugs introduced vs. fixed over time.
Reclassifies engineering effort based on bug attribution. Commits that introduced bugs are retrospectively counted as poor investments.
Investment Quality reclassifies engineering effort based on bug attribution data. Commits identified as buggy origins (those that introduced bugs later fixed by someone) have their grow and maintenance time moved into the Wasted Time category. Their waste (fix commits) remains counted as productive. All other commits retain their standard classification: grow is productive, maintenance is maintenance, and waste (fixes) is productive.
The standard model classifies commits as Growth, Maintenance, or Fixes. Investment Quality adds a quality lens: a commit that introduced a bug is retrospectively counted as a poor investment — the engineering time spent on it was wasted because it ultimately required additional fix work. Fix commits (Fixes in the standard model) are reframed as productive, because fixing bugs is valuable work.
Currently computed client-side from commit and bug attribution data. Ideal server-side endpoint:
POST /v1/organizations/{orgId}/investment-quality
Content-Type: application/json
Request:
{
"startTime": "2025-01-01T00:00:00Z",
"endTime": "2025-12-31T23:59:59Z",
"bucketSize": "BUCKET_SIZE_MONTH",
"groupBy": ["repository_id" | "deliverer_email"]
}
Response:
{
"productivePct": 74,
"maintenancePct": 18,
"wastedPct": 8,
"buckets": [
{
"bucketStart": "2025-01-01T00:00:00Z",
"productive": 4.2,
"maintenance": 1.8,
"wasted": 0.6
}
]
}Latest analyzed commits from this developer.
| Hash | Message | Date | Files |
|---|
Commit activity distribution by hour and day of week. Shows when this developer is most active.
Developers who frequently work on the same files and symbols. Higher score means stronger code collaboration.
| Effort |
|---|
| 9a6dfd00 | This commit **refactors** the **SRv6 encapsulation packet verification helpers**, `verifyEncapPacket` and `verifyEncapPacketCpuAndFrontPanel`, to accept an optional vector of expected SIDs. This enhancement allows the outer IPv6 Destination Address (DA) to be verified against any SID within the provided list, offering greater flexibility in test scenarios. The change primarily impacts **ECMP tests** by enabling them to reuse these shared helpers for verifying packets with multiple distinct SID lists. This is a **test infrastructure improvement** that enhances the reusability and robustness of SRv6 test cases within the `fboss/agent/test/agent_hw_tests` module. | Mar 18 | 1 | maint |
| 7d63df63 | This commit **introduces a new unit test**, `NewUpdateAfterProcessingSchedulesNewLambda`, to enhance the **test coverage** for the **`DsfSubscription` module**. The test specifically verifies the critical re-scheduling logic within the `queueDsfUpdate` function, ensuring that after a `DsfSubscription` has fully processed an update and `nextDsfUpdate_` becomes null, any subsequent new updates correctly trigger `needsScheduling=true` and schedule a new lambda on `hwUpdateEvb_`. This **new test case** improves the **robustness** of the DSF update mechanism by confirming that updates are consistently processed even after previous updates complete. A `FRIEND_TEST` declaration was added to `fboss/agent/DsfSubscription.h` to facilitate access to private members for testing. | Mar 18 | 2 | maint |
| a34d7040 | This commit introduces a **new test case**, `GROverwritesPendingRegularUpdate`, within the **DSF Subscription** module to validate critical state management behavior. This **test** specifically verifies the **last-writer-wins semantics** when a **Graceful Restart (GR)** event occurs concurrently with a pending regular update. It ensures that the GR's effects, such as marking ports `STALE` and clearing neighbor tables, correctly override any conflicting changes from the regular update. This addition improves the **robustness and correctness** of the agent's update processing by confirming expected behavior during complex state transitions involving GR. | Mar 18 | 2 | maint |
| 088a2809 | This commit introduces a **new unit test** to the **`DsfSubscription`** component, specifically verifying the behavior of its `stop()` method. The test, named `StopCancelsPendingDsfUpdate`, ensures that calling `stop()` effectively **cancels any pending DSF updates** by resetting the `nextDsfUpdate_` member to null. This prevents already-scheduled update lambdas from applying stale or unwanted updates, thereby improving the **robustness** and **correctness** of the DSF update mechanism within `fboss/agent`. A `FRIEND_TEST` declaration was added to `DsfSubscription.h` to facilitate this testing of private members. | Mar 18 | 2 | maint |
| ea5466b2 | This commit performs a **refactoring** within the **SRv6 encapsulation test suite** by extracting hardcoded values into constants. Specifically, it moves the repeated SRv6 route prefix "2800:2::" and its length 64 into class constants `kEncapRoutePrefix` and `kEncapRoutePrefixLen` within `AgentSrv6EncapTest.cpp`. This change **reduces code duplication** across multiple test methods like `sendPacketToEncapRoute` and `verifyEncapPacket`, thereby improving the **maintainability and readability** of the test code. The core functionality of the SRv6 encapsulation tests remains unchanged, as this is a purely internal code organization improvement. | Mar 17 | 1 | maint |
| 351dd726 | This commit introduces a **new hardware test** within `AgentTrunkLoadBalancerTests.cpp` to verify **SRv6 ECMP load balancing** over **LAG (Trunk) interfaces**. The test specifically validates that traffic is correctly distributed across all member ports of two distinct LAGs when SRv6 next hops resolve to these aggregate ports, using a configuration designed to prevent hash polarization. This **enhances the test coverage** for the **network agent's SRv6 and load balancing features**, ensuring robust traffic distribution for complex routing scenarios. The new `AgentSrv6TrunkLoadBalancerTest` class and its test case confirm proper behavior for SRv6 next hops resolving to aggregate ports. | Mar 14 | 1 | maint |
| e5dcb6ed | This commit introduces new **load balancer configurations** within the `fboss/agent/test/utils/LoadBalancerTestUtils` module. It adds utility functions `getTrunkFullWithFlowLabelHashConfig()` and `getEcmpFullWithFlowLabelTrunkFullWithFlowLabelHashConfig()` to support **full hash with IPv6 flow label** for both **LAG (trunk) and ECMP** load balancing. This **new capability** allows for more specific testing of how traffic is distributed across aggregated links when IPv6 flow labels are present. The change enhances the testing framework's ability to validate advanced load balancing behaviors. | Mar 14 | 2 | grow |
| d1d9652d | This commit introduces a **new hardware test**, `AgentSrv6EcmpLoadBalancerTest`, to the **Agent hardware test suite**. This **new capability** verifies the correct **ECMP load balancing behavior** for **SRv6 next hops**, specifically ensuring proper hashing using **IPv6 flow labels** in the data plane. The test extends `AgentLoadBalancerTest<HwSrv6EcmpDataPlaneTestUtil>` and utilizes the `RUN_HW_LOAD_BALANCER_TEST_CPU` macro with a `FullWithFlowLabel` hash configuration to validate the `fboss/agent`'s SRv6 ECMP implementation. | Mar 14 | 1 | maint |
| 16f90623 | This commit introduces a **new testing utility**, `HwSrv6EcmpDataPlaneTestUtil`, within the `fboss/agent/test/utils` module to specifically support **SRv6 ECMP data plane testing**. It extends `HwIpEcmpDataPlaneTestUtil` and overrides the `programRoutes()` method to configure **SRv6 ECMP routes** with unique Segment Identifier (SID) lists and tunnel IDs for each next hop. This enhancement provides a **new capability** for the testing infrastructure, enabling comprehensive **hardware data plane validation** for SRv6 load balancing. The utility reuses existing IPv6 traffic generation mechanisms, streamlining the testing process for SRv6 deployments and ensuring proper traffic distribution. | Mar 14 | 2 | maint |
| 8b60cc33 | This commit **introduces comprehensive unit tests** for the `SaiHashManager` component, specifically validating its **hash field conversion logic**. The new `HashManagerTest` suite covers various scenarios, including IPv4 and IPv6 source/destination addresses, transport layer ports, and critically, the correct mapping of the **IPv6 FLOW_LABEL** to `SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL`. This **enhances the robustness** of the hashing implementation, ensuring accurate hardware configuration for diverse network traffic. These **test additions** are crucial for verifying the correct functionality of SRv6 hash configurations and preventing regressions in the `SaiHashManager` module. | Mar 13 | 2 | maint |
| f93e0bd8 | This commit **refactors** the **SRv6 testing infrastructure** by extracting the `makeSrv6TunnelConfig` method from `AgentSrv6EncapTests.cpp` into a new shared utility module, `fboss/agent/test/utils/Srv6TestUtils.h/cpp`. This **improves code reuse** by allowing other test suites, such as `AgentLoadBalancerTests`, to leverage this function for creating SRv6 tunnel configurations. Additionally, new utility functions like `srv6EcmpInitialConfig` are introduced to further streamline **SRv6 test setup**. This change simplifies the creation of complex SRv6 test scenarios across various agent hardware tests, enhancing maintainability and reducing duplication in **FBOSS agent tests**. | Mar 13 | 7 | grow |
| 305fc1a8 | This commit **adds support for IPv6 flow label hashing** within the **`SaiHashManager`** by mapping `cfg::IPv6Field::FLOW_LABEL` to `SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL` in the `toNativeHashFieldList()` function. This **new capability** resolves a previous error where hashing on flow labels was unsupported. The change is crucial for **SRv6 encapsulated traffic**, enabling the use of the outer IPv6 header's flow label to provide entropy for **ECMP load balancing**. This ensures effective load distribution even when inner packet L4 ports are not visible to the ASIC after encapsulation. | Mar 13 | 1 | grow |
| 9c44f843 | This commit introduces a **new capability** to the `fboss/agent` system by adding the `getEcmpFullWithFlowLabelHashConfig` utility function. This function generates a **load balancer hash configuration** that explicitly includes the **IPv6 flow label** alongside standard full hash fields such as source/destination IP and L4 ports. This enhancement is crucial for improving **ECMP load balancing** for **SRv6 encapsulated traffic**, as the IPv6 flow label provides essential entropy to ensure proper traffic distribution. The changes are implemented within the `fboss/agent/test/utils/LoadBalancerTestUtils` module, providing new configuration options for network engineers. | Mar 13 | 2 | maint |
| a8636ead | This commit **adds comprehensive unit tests** for the `parse_diff_num` helper function, which is part of the **`fboss/util` module's `process_known_bad_test` utility**. The tests validate correct parsing of both plain and D-prefixed differential numbers, ensure proper rejection of reserved row identifiers like `0` and `D0`, and handle various invalid input formats. This **quality assurance** effort enhances the robustness and reliability of differential number parsing, preventing potential issues in downstream processing. A new `python_unittest` rule is also added to the `fboss/util/BUCK` file to incorporate these tests into the build system. | Mar 12 | 1 | maint |
| ebc58402 | This commit introduces a **new test case**, `GRExpiryProcessedViaQueueDsfUpdate`, within the **DsfSubscriptionTests** to enhance validation of the **FBOSS agent's** behavior. It specifically verifies that **Graceful Restart (GR) expiry**, when processed through the unified `queueDsfUpdate` path, correctly marks remote ports/interfaces as `STALE` and clears associated neighbor tables. This **improves test coverage** for a critical network control plane mechanism, ensuring the agent properly cleans up state after GR expiry. The addition of this test helps guarantee the robustness and reliability of the **DsfSubscription** module's handling of GR events, preventing stale network state. | Mar 12 | 2 | maint |
| e0398322 | This commit performs a **refactoring** within the **`fboss/agent`** component, specifically in the **`DsfSubscription`** module, to simplify how Distributed State Fabric (DSF) updates are managed. It reverts a previous design, switching from a queue-based approach back to storing only the latest `DsfUpdate` for both neighbor state changes and Graceful Restart (GR) events. This change unifies the handling of these two event types, aiming to simplify logic and prevent race conditions by ensuring a common locking direction. The `DsfSubscription.cpp` and `DsfSubscription.h` files are updated to reflect this single-update storage mechanism, and **tests** in `DsfSubscriptionTests.cpp` are adjusted to validate the new behavior. | Mar 11 | 3 | maint |
| 7033636e | This commit introduces an **architectural refinement** to the **`DsfSubscription`** system by integrating Graceful Restart (GR) expiry events directly into the `DsfUpdate` mechanism. A `grExpiry` boolean field is added to the `DsfUpdate` struct in `fboss/agent/DsfSubscription.h`, allowing GR events to be processed as standard updates rather than through a separate queue. This change **unifies the handling of neighbor updates and GR events**, simplifying event processing logic and ensuring a common locking direction to prevent race conditions. The `isEmpty()` and `clear()` methods are updated to properly manage the new `grExpiry` state, streamlining how the system tracks and clears pending updates. | Mar 11 | 1 | grow |
| 419e4600 | This commit **enhances the `DsfSubscription` mechanism** by integrating GR (Graceful Restart) expiry handling directly into the `updateWithRollbackProtection()` function. It **refactors** the `DsfSubscription` logic to store only the latest `DsfUpdate`, unifying the processing of both neighbor updates and GR events to prevent race conditions. Specifically, `updateWithRollbackProtection()` now processes GR expiry by marking or removing remote system ports and interfaces, with `queueDsfUpdate()` passing a new `grExpiry` flag. This change improves the robustness of the **Distributed State Fabric (DSF) subscription** by ensuring consistent state management during GR events. | Mar 11 | 3 | grow |
| 59966245 | This commit **refactors** the **test infrastructure** by moving the `HwSwitchThriftClientTableForTesting` mock class. Previously defined within `fboss/agent/test/ThriftBasedWarmbootUtilsTest.cpp`, this utility is now relocated to `fboss/agent/test/TestUtils.h`. This change centralizes a crucial mock for `HwSwitchThriftClientTable`, enabling its **reusability** across various **unit tests** that require controlling or simulating hardware switch thrift client behavior. The move improves the organization and maintainability of the **FBOSS testing suite** by providing a common, controllable mock for testing state and run state interactions. | Jan 10 | 2 | maint |
| 14897ed7 | This commit **refactors** the **FBOSS agent's warmboot detection logic** by introducing a unified `canWarmBoot()` method. This new method consolidates checks for both file-based and thrift-based warmboot sources, simplifying how clients determine if a warmboot is possible. The `SwSwitch::preInit` function and various **test utilities** are updated to use this consolidated approach. This **refactoring** is a foundational step towards enabling **hitless restarts** in multi-NPU environments by allowing the agent to recover state directly from a running hardware switch. | Jan 10 | 4 | maint |
This commit **refactors** the **SRv6 encapsulation packet verification helpers**, `verifyEncapPacket` and `verifyEncapPacketCpuAndFrontPanel`, to accept an optional vector of expected SIDs. This enhancement allows the outer IPv6 Destination Address (DA) to be verified against any SID within the provided list, offering greater flexibility in test scenarios. The change primarily impacts **ECMP tests** by enabling them to reuse these shared helpers for verifying packets with multiple distinct SID lists. This is a **test infrastructure improvement** that enhances the reusability and robustness of SRv6 test cases within the `fboss/agent/test/agent_hw_tests` module.
This commit **introduces a new unit test**, `NewUpdateAfterProcessingSchedulesNewLambda`, to enhance the **test coverage** for the **`DsfSubscription` module**. The test specifically verifies the critical re-scheduling logic within the `queueDsfUpdate` function, ensuring that after a `DsfSubscription` has fully processed an update and `nextDsfUpdate_` becomes null, any subsequent new updates correctly trigger `needsScheduling=true` and schedule a new lambda on `hwUpdateEvb_`. This **new test case** improves the **robustness** of the DSF update mechanism by confirming that updates are consistently processed even after previous updates complete. A `FRIEND_TEST` declaration was added to `fboss/agent/DsfSubscription.h` to facilitate access to private members for testing.
This commit introduces a **new test case**, `GROverwritesPendingRegularUpdate`, within the **DSF Subscription** module to validate critical state management behavior. This **test** specifically verifies the **last-writer-wins semantics** when a **Graceful Restart (GR)** event occurs concurrently with a pending regular update. It ensures that the GR's effects, such as marking ports `STALE` and clearing neighbor tables, correctly override any conflicting changes from the regular update. This addition improves the **robustness and correctness** of the agent's update processing by confirming expected behavior during complex state transitions involving GR.
This commit introduces a **new unit test** to the **`DsfSubscription`** component, specifically verifying the behavior of its `stop()` method. The test, named `StopCancelsPendingDsfUpdate`, ensures that calling `stop()` effectively **cancels any pending DSF updates** by resetting the `nextDsfUpdate_` member to null. This prevents already-scheduled update lambdas from applying stale or unwanted updates, thereby improving the **robustness** and **correctness** of the DSF update mechanism within `fboss/agent`. A `FRIEND_TEST` declaration was added to `DsfSubscription.h` to facilitate this testing of private members.
This commit performs a **refactoring** within the **SRv6 encapsulation test suite** by extracting hardcoded values into constants. Specifically, it moves the repeated SRv6 route prefix "2800:2::" and its length 64 into class constants `kEncapRoutePrefix` and `kEncapRoutePrefixLen` within `AgentSrv6EncapTest.cpp`. This change **reduces code duplication** across multiple test methods like `sendPacketToEncapRoute` and `verifyEncapPacket`, thereby improving the **maintainability and readability** of the test code. The core functionality of the SRv6 encapsulation tests remains unchanged, as this is a purely internal code organization improvement.
This commit introduces a **new hardware test** within `AgentTrunkLoadBalancerTests.cpp` to verify **SRv6 ECMP load balancing** over **LAG (Trunk) interfaces**. The test specifically validates that traffic is correctly distributed across all member ports of two distinct LAGs when SRv6 next hops resolve to these aggregate ports, using a configuration designed to prevent hash polarization. This **enhances the test coverage** for the **network agent's SRv6 and load balancing features**, ensuring robust traffic distribution for complex routing scenarios. The new `AgentSrv6TrunkLoadBalancerTest` class and its test case confirm proper behavior for SRv6 next hops resolving to aggregate ports.
This commit introduces new **load balancer configurations** within the `fboss/agent/test/utils/LoadBalancerTestUtils` module. It adds utility functions `getTrunkFullWithFlowLabelHashConfig()` and `getEcmpFullWithFlowLabelTrunkFullWithFlowLabelHashConfig()` to support **full hash with IPv6 flow label** for both **LAG (trunk) and ECMP** load balancing. This **new capability** allows for more specific testing of how traffic is distributed across aggregated links when IPv6 flow labels are present. The change enhances the testing framework's ability to validate advanced load balancing behaviors.
This commit introduces a **new hardware test**, `AgentSrv6EcmpLoadBalancerTest`, to the **Agent hardware test suite**. This **new capability** verifies the correct **ECMP load balancing behavior** for **SRv6 next hops**, specifically ensuring proper hashing using **IPv6 flow labels** in the data plane. The test extends `AgentLoadBalancerTest<HwSrv6EcmpDataPlaneTestUtil>` and utilizes the `RUN_HW_LOAD_BALANCER_TEST_CPU` macro with a `FullWithFlowLabel` hash configuration to validate the `fboss/agent`'s SRv6 ECMP implementation.
This commit introduces a **new testing utility**, `HwSrv6EcmpDataPlaneTestUtil`, within the `fboss/agent/test/utils` module to specifically support **SRv6 ECMP data plane testing**. It extends `HwIpEcmpDataPlaneTestUtil` and overrides the `programRoutes()` method to configure **SRv6 ECMP routes** with unique Segment Identifier (SID) lists and tunnel IDs for each next hop. This enhancement provides a **new capability** for the testing infrastructure, enabling comprehensive **hardware data plane validation** for SRv6 load balancing. The utility reuses existing IPv6 traffic generation mechanisms, streamlining the testing process for SRv6 deployments and ensuring proper traffic distribution.
This commit **introduces comprehensive unit tests** for the `SaiHashManager` component, specifically validating its **hash field conversion logic**. The new `HashManagerTest` suite covers various scenarios, including IPv4 and IPv6 source/destination addresses, transport layer ports, and critically, the correct mapping of the **IPv6 FLOW_LABEL** to `SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL`. This **enhances the robustness** of the hashing implementation, ensuring accurate hardware configuration for diverse network traffic. These **test additions** are crucial for verifying the correct functionality of SRv6 hash configurations and preventing regressions in the `SaiHashManager` module.
This commit **refactors** the **SRv6 testing infrastructure** by extracting the `makeSrv6TunnelConfig` method from `AgentSrv6EncapTests.cpp` into a new shared utility module, `fboss/agent/test/utils/Srv6TestUtils.h/cpp`. This **improves code reuse** by allowing other test suites, such as `AgentLoadBalancerTests`, to leverage this function for creating SRv6 tunnel configurations. Additionally, new utility functions like `srv6EcmpInitialConfig` are introduced to further streamline **SRv6 test setup**. This change simplifies the creation of complex SRv6 test scenarios across various agent hardware tests, enhancing maintainability and reducing duplication in **FBOSS agent tests**.
This commit **adds support for IPv6 flow label hashing** within the **`SaiHashManager`** by mapping `cfg::IPv6Field::FLOW_LABEL` to `SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL` in the `toNativeHashFieldList()` function. This **new capability** resolves a previous error where hashing on flow labels was unsupported. The change is crucial for **SRv6 encapsulated traffic**, enabling the use of the outer IPv6 header's flow label to provide entropy for **ECMP load balancing**. This ensures effective load distribution even when inner packet L4 ports are not visible to the ASIC after encapsulation.
This commit introduces a **new capability** to the `fboss/agent` system by adding the `getEcmpFullWithFlowLabelHashConfig` utility function. This function generates a **load balancer hash configuration** that explicitly includes the **IPv6 flow label** alongside standard full hash fields such as source/destination IP and L4 ports. This enhancement is crucial for improving **ECMP load balancing** for **SRv6 encapsulated traffic**, as the IPv6 flow label provides essential entropy to ensure proper traffic distribution. The changes are implemented within the `fboss/agent/test/utils/LoadBalancerTestUtils` module, providing new configuration options for network engineers.
This commit **adds comprehensive unit tests** for the `parse_diff_num` helper function, which is part of the **`fboss/util` module's `process_known_bad_test` utility**. The tests validate correct parsing of both plain and D-prefixed differential numbers, ensure proper rejection of reserved row identifiers like `0` and `D0`, and handle various invalid input formats. This **quality assurance** effort enhances the robustness and reliability of differential number parsing, preventing potential issues in downstream processing. A new `python_unittest` rule is also added to the `fboss/util/BUCK` file to incorporate these tests into the build system.
This commit introduces a **new test case**, `GRExpiryProcessedViaQueueDsfUpdate`, within the **DsfSubscriptionTests** to enhance validation of the **FBOSS agent's** behavior. It specifically verifies that **Graceful Restart (GR) expiry**, when processed through the unified `queueDsfUpdate` path, correctly marks remote ports/interfaces as `STALE` and clears associated neighbor tables. This **improves test coverage** for a critical network control plane mechanism, ensuring the agent properly cleans up state after GR expiry. The addition of this test helps guarantee the robustness and reliability of the **DsfSubscription** module's handling of GR events, preventing stale network state.
This commit performs a **refactoring** within the **`fboss/agent`** component, specifically in the **`DsfSubscription`** module, to simplify how Distributed State Fabric (DSF) updates are managed. It reverts a previous design, switching from a queue-based approach back to storing only the latest `DsfUpdate` for both neighbor state changes and Graceful Restart (GR) events. This change unifies the handling of these two event types, aiming to simplify logic and prevent race conditions by ensuring a common locking direction. The `DsfSubscription.cpp` and `DsfSubscription.h` files are updated to reflect this single-update storage mechanism, and **tests** in `DsfSubscriptionTests.cpp` are adjusted to validate the new behavior.
This commit introduces an **architectural refinement** to the **`DsfSubscription`** system by integrating Graceful Restart (GR) expiry events directly into the `DsfUpdate` mechanism. A `grExpiry` boolean field is added to the `DsfUpdate` struct in `fboss/agent/DsfSubscription.h`, allowing GR events to be processed as standard updates rather than through a separate queue. This change **unifies the handling of neighbor updates and GR events**, simplifying event processing logic and ensuring a common locking direction to prevent race conditions. The `isEmpty()` and `clear()` methods are updated to properly manage the new `grExpiry` state, streamlining how the system tracks and clears pending updates.
This commit **enhances the `DsfSubscription` mechanism** by integrating GR (Graceful Restart) expiry handling directly into the `updateWithRollbackProtection()` function. It **refactors** the `DsfSubscription` logic to store only the latest `DsfUpdate`, unifying the processing of both neighbor updates and GR events to prevent race conditions. Specifically, `updateWithRollbackProtection()` now processes GR expiry by marking or removing remote system ports and interfaces, with `queueDsfUpdate()` passing a new `grExpiry` flag. This change improves the robustness of the **Distributed State Fabric (DSF) subscription** by ensuring consistent state management during GR events.
This commit **refactors** the **test infrastructure** by moving the `HwSwitchThriftClientTableForTesting` mock class. Previously defined within `fboss/agent/test/ThriftBasedWarmbootUtilsTest.cpp`, this utility is now relocated to `fboss/agent/test/TestUtils.h`. This change centralizes a crucial mock for `HwSwitchThriftClientTable`, enabling its **reusability** across various **unit tests** that require controlling or simulating hardware switch thrift client behavior. The move improves the organization and maintainability of the **FBOSS testing suite** by providing a common, controllable mock for testing state and run state interactions.
This commit **refactors** the **FBOSS agent's warmboot detection logic** by introducing a unified `canWarmBoot()` method. This new method consolidates checks for both file-based and thrift-based warmboot sources, simplifying how clients determine if a warmboot is possible. The `SwSwitch::preInit` function and various **test utilities** are updated to use this consolidated approach. This **refactoring** is a foundational step towards enabling **hitless restarts** in multi-NPU environments by allowing the agent to recover state directly from a running hardware switch.