Skip to content

Conversation

@paramasivamn1
Copy link
Contributor

Added additional( route update check) atomic changes

@paramasivamn1 paramasivamn1 requested review from a team as code owners January 2, 2026 04:53
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @paramasivamn1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the testing framework for AFT atomic flag checks and streamlines BGP configuration logic. It modifies the testCase structure to support more precise post-churn verification in tests and updates a BGP helper function to operate directly on the OpenConfig root model, improving modularity and reducing boilerplate.

Highlights

  • Test Case Structure Refinement: The testCase struct in afts_atomic_test.go was updated to replace a slice of stoppingConditions with a single stoppingCondition and introduce an additionalVerification function, allowing for more targeted post-churn validation.
  • BGP Configuration Refactoring: The handleMultipathDeviation function in internal/cfgplugins/bgp.go was refactored to directly modify an oc.Root object, removing the dependency on a gnmi.SetBatch and simplifying its integration into BGP configuration.
  • Enhanced Test Verification Logic: The TestAtomic function now utilizes the new additionalVerification field for specific test scenarios, enabling more flexible and detailed checks after network churn events.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@OpenConfigBot
Copy link

OpenConfigBot commented Jan 2, 2026

Pull Request Functional Test Report for #4968 / d1fe492

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
AFT-3.1: AFTs Atomic Flag Check
780e07e4 Log
Cisco 8000E status
AFT-3.1: AFTs Atomic Flag Check
14aa87e5 Log
Cisco XRd status
AFT-3.1: AFTs Atomic Flag Check
216d5ddb Log
Juniper ncPTX status
AFT-3.1: AFTs Atomic Flag Check
458365d6 Log
Nokia SR Linux status
AFT-3.1: AFTs Atomic Flag Check
45401d39 Log
Openconfig Lemming status
AFT-3.1: AFTs Atomic Flag Check
c9aeb336 Log

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
AFT-3.1: AFTs Atomic Flag Check
Cisco 8808 status
AFT-3.1: AFTs Atomic Flag Check
Juniper PTX10008 status
AFT-3.1: AFTs Atomic Flag Check
Nokia 7250 IXR-10e status
AFT-3.1: AFTs Atomic Flag Check

Help

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the atomic AFT test by changing how test cases are structured and verified. It also includes some refactoring in the BGP configuration plugin. My review has identified a critical issue in internal/cfgplugins/bgp.go where a function signature change leads to a compilation error in a case that was not updated. I've also pointed out some minor issues like commented-out code that should be removed and a typo in a comment. Please address the critical issue to ensure the code compiles and functions as expected.

// at the afisafi level is supported or not. It updates the sb with the necessary
// configuration.
func handleMultipathDeviation(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg BGPNeighborsConfig) error {
func handleMultipathDeviation(t *testing.T, dut *ondatra.DUTDevice, root *oc.Root, cfg BGPNeighborsConfig) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Changing the function signature to remove sb *gnmi.SetBatch introduces a compilation error. The case ondatra.JUNIPER: block within this function (on line 706) still attempts to use sb in a gnmi.BatchUpdate call, but sb is now undefined in this scope. To fix this, you should remove the gnmi.BatchUpdate call from the JUNIPER case, similar to how it was removed from the general case. The caller, CreateBGPNeighbors, is already responsible for batching the updates to the root object.

Comment on lines 320 to 324
// oneLinkDownBGP := aftcache.InitialSyncStoppingCondition(t, dut, bgpPrefixes, ipv4OneNH, ipv6OneNH)
// if dut.Vendor() == ondatra.CISCO {
// ipv6OneNH = map[string]bool{"fe80::200:2ff:fe02:202": true}
// oneLinkDownBGP = aftcache.InitialSyncStoppingCondition(t, dut, bgpPrefixes, ipv4OneNH, ipv6OneNH)
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This commented-out code should be removed before merging. If it's for future work or debugging, it should not be part of the final commit. Please remove these lines.

}

// handleMultipathDeviation implements the deviation logic whether multipath config
f// handleMultipathDeviation implements the deviation logic whether multipath config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a typo in this comment. It should start with //.

Suggested change
f// handleMultipathDeviation implements the deviation logic whether multipath config
// handleMultipathDeviation implements the deviation logic whether multipath config

@coveralls
Copy link

coveralls commented Jan 3, 2026

Pull Request Test Coverage Report for Build 20772734558

Details

  • 0 of 8 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 10.017%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/cfgplugins/bgp.go 0 8 0.0%
Totals Coverage Status
Change from base Build 20770081068: -0.002%
Covered Lines: 2227
Relevant Lines: 22232

💛 - Coveralls

Comment on lines 125 to 224
dutPort1 := dut.Port(t, port1Name).Name()
dutIntf1 := dutP1.NewOCInterface(dutPort1, dut)
gnmi.Replace(t, dut, gnmi.OC().Interface(dutPort1).Config(), dutIntf1)
p1 := dut.Port(t, port1Name).Name()
i1 := dutP1.NewOCInterface(p1, dut)
gnmi.Update(t, dut, gnmi.OC().Interface(p1).Config(), i1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these changes don't seem totally necessary? Seems like it was just copied from another test? Can we not make these naming changes? (The new names are less descriptive, anyway.)

@paramasivamn1 paramasivamn1 requested a review from ram-mac January 7, 2026 06:11
Comment on lines -790 to 797

if err := handleMultipathDeviation(t, dut, sb, cfg); err != nil {
return err
// Configure MaximumPaths
if deviations.EnableMultipathUnderAfiSafi(dut) {
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp().MaximumPaths = ygot.Uint32(2)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp().MaximumPaths = ygot.Uint32(2)
} else {
if err := handleMultipathDeviation(t, dut, sb, cfg); err != nil {
return err
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you not do this inline? Break it out into a function similar to how it was before and condition on the vendor(s) you expect to be present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants