Skip to content

Refactor multi-bridge-mib machinery to async#3664

Merged
lunkwill42 merged 3 commits intomasterfrom
refactor/multibridgemib-inlinecallbacks
Dec 5, 2025
Merged

Refactor multi-bridge-mib machinery to async#3664
lunkwill42 merged 3 commits intomasterfrom
refactor/multibridgemib-inlinecallbacks

Conversation

@lunkwill42
Copy link
Copy Markdown
Member

Scope and purpose

This refactors the existing parts of ipdevpoll's multi-bridge-mib machinery from using Twisted @inlineCallbacks or explicit Deferred callback handling to using pure coroutines, in preparation for upcoming SNMPv3 context changes that are needed (#2811). This is also in line with #3424.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with ruff, easiest by using pre-commit
  • Wrote the commit message so that the first line 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/
  • Based this pull request on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If it's not obvious from a linked issue, described how to interact with NAV in order for a reviewer to observe the effects of this change first-hand (commands, URLs, UI interactions)
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this adds a new Python source code file: Added the boilerplate header to that file

This refactors the existing parts of ipdevpoll's multi-bridge-mib
machinery from using Twisted `@inlineCallbacks` or explicit Deferred
callback handling to using pure coroutines, in preparation for upcoming
SNMPv3 context changes that are needed.  This is also in line with #3424
@lunkwill42 lunkwill42 requested a review from a team December 3, 2025 15:07
@lunkwill42 lunkwill42 self-assigned this Dec 3, 2025
@lunkwill42 lunkwill42 added refactor nonews No news fragment is necessary for this PR (e.g. refactoring, cleanups, workflow/development changes) and removed refactor labels Dec 3, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 3, 2025

Test results

    27 files      27 suites   46m 25s ⏱️
 2 702 tests  2 702 ✅ 0 💤 0 ❌
20 006 runs  20 006 ✅ 0 💤 0 ❌

Results for commit 3811d68.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.94%. Comparing base (ce9853f) to head (3811d68).
⚠️ Report is 404 commits behind head on master.

Files with missing lines Patch % Lines
python/nav/ipdevpoll/utils.py 50.00% 3 Missing ⚠️
python/nav/mibs/cisco_vtp_mib.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3664      +/-   ##
==========================================
- Coverage   62.95%   62.94%   -0.01%     
==========================================
  Files         611      611              
  Lines       45150    45145       -5     
  Branches       43       43              
==========================================
- Hits        28424    28417       -7     
- Misses      16716    16718       +2     
  Partials       10       10              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

`retrieve_alternate_bridge_mibs` is now an async function, and does
not return a Deferred - so the test needed updating
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Dec 4, 2025

@lunkwill42 lunkwill42 marked this pull request as ready for review December 4, 2025 10:57
@lunkwill42 lunkwill42 merged commit 1a9ba8e into master Dec 5, 2025
19 checks passed
@lunkwill42 lunkwill42 deleted the refactor/multibridgemib-inlinecallbacks branch December 5, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nonews No news fragment is necessary for this PR (e.g. refactoring, cleanups, workflow/development changes) refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants