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

Add proper implementation of CLEARFLAP API command #318

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

lunkwill42
Copy link
Member

@lunkwill42 lunkwill42 commented Jul 17, 2024

Scope and purpose

Fixes #113. #311 added a dummy implementation, this completes it.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Zino can be found in the
README.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with black, ruff and isort, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done

@lunkwill42 lunkwill42 changed the title Feature/clearflap api Add proper implementation of CLEARFLAP API command Jul 17, 2024
Copy link

github-actions bot commented Jul 17, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 4 0 0.93s
✅ PYTHON isort 4 0 0.25s
✅ PYTHON ruff 4 0 0.01s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@lunkwill42 lunkwill42 self-assigned this Jul 17, 2024
Copy link

github-actions bot commented Jul 17, 2024

Test results

    3 files      3 suites   1m 18s ⏱️
  565 tests   565 ✅ 0 💤 0 ❌
1 647 runs  1 645 ✅ 2 💤 0 ❌

Results for commit caffac2.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@57a1985). Learn more about missing BASE report.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #318   +/-   ##
=========================================
  Coverage          ?   98.17%           
=========================================
  Files             ?       64           
  Lines             ?     7972           
  Branches          ?        0           
=========================================
  Hits              ?     7826           
  Misses            ?      146           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lunkwill42 lunkwill42 marked this pull request as ready for review July 17, 2024 13:46
@lunkwill42 lunkwill42 requested a review from a team July 17, 2024 13:54
Copy link

sonarcloud bot commented Jul 17, 2024

@lunkwill42
Copy link
Member Author

Once merged, #113 and #63 can be finally be closed.

Copy link
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

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

Just the one little comment

tests/api/legacy_test.py Outdated Show resolved Hide resolved
This was ported directly from Zino 1, and is intended to clear internal
flap states on-demand from an API user: It finds the matching
PortStateEvent for an interface, sets its flapping state to stable and
logs the clearflap event, while also taking care to remove all the
tracked flapping stats from the FlapStates registry.
This is ported directly from Zino 1, and is intended for consumation by
an interactive API user: It runs the routines to clear internal flap
states for an interface, and schedules an SNMP re-verification of the
the port's current state.
@lunkwill42
Copy link
Member Author

Fixed the unnecessary duplicate and rebased on latest master to resolve new merge conflict, @johannaengland

This replaces the dummy implementation of the CLEARFLAP API command with
an implementation that actually clears the flapping state of a port.
Copy link

sonarcloud bot commented Aug 19, 2024

@lunkwill42 lunkwill42 merged commit b09cf29 into master Aug 19, 2024
8 checks passed
@lunkwill42 lunkwill42 deleted the feature/clearflap-api branch August 19, 2024 12:48
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.

Implement the CLEARFLAP API command
2 participants