Skip to content

Corrected protocol typing for IPHost.value IPAddress -> IPInterface#892

Merged
ogenstad merged 1 commit intostablefrom
pog-iphost-typing-IHS-215
Mar 26, 2026
Merged

Corrected protocol typing for IPHost.value IPAddress -> IPInterface#892
ogenstad merged 1 commit intostablefrom
pog-iphost-typing-IHS-215

Conversation

@ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Mar 26, 2026

Why

The typing for IPHost.value within the protocol class was incorrect

What changed

  • Switch invalid reference to IPAddress for IPInterface

Fixes #891

Summary by CodeRabbit

  • Bug Fixes
    • Corrected IP host value type annotation to properly reflect network interface type instead of address type.

@coderabbitai
Copy link

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d953abd-10f8-4b14-a42f-b0cb6a2cd0b6

📥 Commits

Reviewing files that changed from the base of the PR and between f8a5464 and c4302f5.

📒 Files selected for processing (2)
  • changelog/891.fixed.md
  • infrahub_sdk/protocols_base.py

Walkthrough

The type annotations for the value field in the IPHost and IPHostOptional classes were updated to correctly reflect the actual data format. The type changed from ipaddress.IPv4Address | ipaddress.IPv6Address to ipaddress.IPv4Interface | ipaddress.IPv6Interface (with None included in the optional variant). A corresponding changelog entry was created to document this correction.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: correcting the protocol typing for IPHost.value from IPAddress to IPInterface.
Description check ✅ Passed The description adequately explains the issue and fix, though it uses a minimal format. It identifies the problem (incorrect typing), states the solution (switch to IPInterface), and references the issue.
Linked Issues check ✅ Passed The PR successfully addresses issue #891 by updating the IPHost and IPHostOptional type annotations from IPv4Address/IPv6Address to IPv4Interface/IPv6Interface, matching the actual response format.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the typing bug in issue #891. The changelog entry and protocol type updates are all within scope of the stated objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: c4302f5
Status: ✅  Deploy successful!
Preview URL: https://fc260e0f.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-iphost-typing-ihs-215.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##           stable     #892   +/-   ##
=======================================
  Coverage   80.68%   80.68%           
=======================================
  Files         119      119           
  Lines       10335    10335           
  Branches     1550     1550           
=======================================
  Hits         8339     8339           
  Misses       1473     1473           
  Partials      523      523           
Flag Coverage Δ
integration-tests 41.59% <0.00%> (ø)
python-3.10 51.84% <0.00%> (+0.01%) ⬆️
python-3.11 51.82% <0.00%> (-0.02%) ⬇️
python-3.12 51.84% <0.00%> (+0.01%) ⬆️
python-3.13 51.82% <0.00%> (ø)
python-3.14 53.52% <0.00%> (-0.02%) ⬇️
python-filler-3.12 24.04% <100.00%> (ø)

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

Files with missing lines Coverage Δ
infrahub_sdk/protocols_base.py 73.43% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ogenstad ogenstad marked this pull request as ready for review March 26, 2026 10:59
@ogenstad ogenstad requested a review from a team as a code owner March 26, 2026 10:59
@ogenstad ogenstad merged commit e7dfe12 into stable Mar 26, 2026
21 checks passed
@ogenstad ogenstad deleted the pog-iphost-typing-IHS-215 branch March 26, 2026 14:37
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.

bug: Typing bug for IPHost values within protocols

2 participants