Skip to content

Feat: refactor nic attribute workflows#526

Merged
grafuls merged 8 commits intoquadsproject:developmentfrom
sadsfae:inv_sriov
Apr 21, 2026
Merged

Feat: refactor nic attribute workflows#526
grafuls merged 8 commits intoquadsproject:developmentfrom
sadsfae:inv_sriov

Conversation

@sadsfae
Copy link
Copy Markdown
Collaborator

@sadsfae sadsfae commented Apr 20, 2026

  • Add three helper methods:

    1. _extract_job_id_from_response() - gets job ID from response headers
    2. _verify_job_scheduled() - confirms job scheduled before reboot
    3. _monitor_and_verify_attribute_job() - monitors job completion and verifies final value
  • handle exceptions better

  • provide better job and polling monitoring

  • warn on Intel XX710 for firmware or hardware limitations avoid any confusion

  • 1-2% test coverage added

  • Add graceful quit and instructions if VirtualizationMode is set to NONE but user wants to make a nic attribute change for SRIOV that depends on it, otherwise we get nasty 500 errors with no guidance.

closes: #523

sadsfae added 3 commits April 17, 2026 21:26
* Always be DRY'ing

Helper 1: _extract_job_id_from_response()
Helper 2: _verify_job_scheduled()
Helper 3: _monitor_and_verify_attribute_job()
* We think intel XX710 may not be able to do 128 VRF
* Add proper warning but don't fail.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 98.96907% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.92%. Comparing base (26223b9) to head (ddfa57e).
⚠️ Report is 10 commits behind head on development.

Files with missing lines Patch % Lines
src/badfish/main.py 98.96% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #526      +/-   ##
===============================================
+ Coverage        92.53%   92.92%   +0.38%     
===============================================
  Files                8        8              
  Lines             2533     2614      +81     
===============================================
+ Hits              2344     2429      +85     
+ Misses             189      185       -4     
Flag Coverage Δ
unittests 92.92% <98.96%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

sadsfae added 2 commits April 20, 2026 18:54
* Don't obesess over defensive / firmware status handling
Comment thread src/badfish/main.py Outdated
return None
except (AttributeError, ValueError, KeyError) as e: # pragma: no cover
# Defensive: headers.get() raising exceptions is extremely rare in practice
if warn_on_missing: # pragma: no cover
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

all the # pragma comments after the excluded except are not necessary

Comment thread src/badfish/main.py Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we should be using the new _extract_job_id_from_response method here as well

* try not to go too crazy with pragma no cover
@sadsfae sadsfae requested a review from grafuls April 21, 2026 08:56
@grafuls grafuls merged commit 7bbc07a into quadsproject:development Apr 21, 2026
3 checks passed
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.

2 participants