Skip to content
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

Fix functionality to allow a value of 0 to be configured for the appropriate integer attributes and refactor STP module code #477

Merged
merged 7 commits into from
Nov 12, 2024

Conversation

stalabi1
Copy link
Collaborator

@stalabi1 stalabi1 commented Oct 29, 2024

SUMMARY
  • I fixed the functionality of the code to allow a value of 0 to be configured for the appropriate integer attributes.
  • I removed all of the default definitions from the argspec because the definitions were making some configuration cases impossible to implement, e.g. the deletion of an STP interface by interface name that has all defaults configured.
  • I refactored the code to reduce the number of nested loops in the case of searching for instance matches. I condensed a few of the get delete request methods.
  • I added more UT test cases to increase code coverage.
  • I updated the facts code to properly handle empties allowing me to remove a few 'remove_empties' calls from config.
GitHub Issues
GitHub Issue #472
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

sonic_stp

OUTPUT

regression-2024-11-11-14-59-56.html.pdf
merge_mst_id_0_output.log

ADDITIONAL INFORMATION

Current SONiC behavior doesn't allow me to to configure any other mst-id when mst-id 0 is configured.

Checklist:
  • I have performed a self-review of my own code to ensure there are no formatting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility or have provided any relevant "breaking_changes" descriptions in a "fragment" file in the "changelogs/fragments" directory of this repository.
  • I have provided a summary for this PR in valid "fragment" file format in the "changelogs/fragments" directory of this repository branch. Reference : Ansible Change Log Document

@stalabi1 stalabi1 added the bug Something isn't working label Oct 29, 2024
@stalabi1 stalabi1 marked this pull request as draft October 30, 2024 23:17
@TafkaMax
Copy link
Contributor

TafkaMax commented Nov 1, 2024

Tested this branch and it fixes the issue I had.

@stalabi1 stalabi1 marked this pull request as ready for review November 1, 2024 20:43
@stalabi1 stalabi1 changed the title Allow configuration of 'mst_id' 0 and refactor code for STP module Fix fuctionality to allow a value of 0 to be configured for the appropriate integer attributes and refactor module code Nov 1, 2024
@stalabi1 stalabi1 changed the title Fix fuctionality to allow a value of 0 to be configured for the appropriate integer attributes and refactor module code Fix functionality to allow a value of 0 to be configured for the appropriate integer attributes and refactor STP module code Nov 1, 2024
@stalabi1 stalabi1 added this to the v3.0.0 milestone Nov 1, 2024
Copy link
Collaborator

@kerry-meyer kerry-meyer left a comment

Choose a reason for hiding this comment

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

This change set, the additional test cases, and the corresponding test results looks good.

Thanks for adding efficiency improvements and reductions in the existing code along with the basic fix.

I am posting several minor comments/questions and change requests, but am not requesting any significant algorithmic changes.

Copy link
Collaborator

@kerry-meyer kerry-meyer left a comment

Choose a reason for hiding this comment

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

All current proposed changes and corresponding test results look good.

Thank you for not only fixing the problem described by the customer, but for taking the initiative to fix all related exposures in the STP resource module.

Approved.

@kerry-meyer kerry-meyer merged commit c8a6e72 into ansible-collections:main Nov 12, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants