Skip to content

Conversation

@solababs
Copy link
Contributor

@solababs solababs commented Nov 7, 2025

This PR removes is_visible property from attribute metadata.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Removed support for the is_visible attribute throughout the SDK. The attribute is no longer available on Attribute instances and has been removed from recognized property flags and payload generation.

This PR removes `is_visible` property from attribute metadata.
@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

The pull request removes the is_visible field throughout the Infrahub SDK. Changes include: removing the is_visible public attribute from the Attribute class, updating the PROPERTIES_FLAG constant to contain only ["is_protected"] instead of including is_visible, removing the is_visible field from the Attribute Protocol definition, eliminating the is_visible parameter from the generate_payload_create() method signature, and updating test fixtures and test expectations to no longer include is_visible fields in generated payloads and query structures.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: removing the is_visible property from attribute metadata, which aligns with all the modifications across multiple files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sb-20251107-remove-metadata-param-ihs-176

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b52cd94 and 58e0d3d.

📒 Files selected for processing (6)
  • infrahub_sdk/node/attribute.py (0 hunks)
  • infrahub_sdk/node/constants.py (1 hunks)
  • infrahub_sdk/protocols_base.py (0 hunks)
  • infrahub_sdk/schema/__init__.py (0 hunks)
  • tests/unit/sdk/conftest.py (5 hunks)
  • tests/unit/sdk/test_node.py (3 hunks)
💤 Files with no reviewable changes (3)
  • infrahub_sdk/schema/init.py
  • infrahub_sdk/protocols_base.py
  • infrahub_sdk/node/attribute.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

When implementing Infrahub checks, subclass InfrahubCheck and override validate(data); do not implement or rely on a check() method

Files:

  • infrahub_sdk/node/constants.py
  • tests/unit/sdk/conftest.py
  • tests/unit/sdk/test_node.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Place and write unit tests under tests/unit/ (isolated component tests)

Files:

  • tests/unit/sdk/conftest.py
  • tests/unit/sdk/test_node.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use the custom pytest plugin (infrahub_sdk.pytest_plugin) fixtures for clients, configuration, and Infrahub-specific testing

Files:

  • tests/unit/sdk/conftest.py
  • tests/unit/sdk/test_node.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: unit-tests (3.13)
  • GitHub Check: unit-tests (3.11)
  • GitHub Check: unit-tests (3.10)
  • GitHub Check: unit-tests (3.9)
  • GitHub Check: unit-tests (3.12)
  • GitHub Check: integration-tests-latest-infrahub
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
infrahub_sdk/node/constants.py (1)

5-5: LGTM! Clean removal of is_visible from property flags.

The update to PROPERTIES_FLAG correctly removes "is_visible" while retaining "is_protected", aligning with the PR objective to eliminate visibility metadata from attribute properties.

tests/unit/sdk/conftest.py (1)

1256-1256: LGTM! Test fixtures correctly updated to reflect API changes.

The removal of is_visible from test fixture data structures (attributes, relationship properties, and mock API responses) ensures that test cases validate the correct payload shape after the metadata property removal. These data-only changes maintain test coverage while aligning with the updated SDK API.

Also applies to: 1348-1366, 1920-1928, 2007-2015

tests/unit/sdk/test_node.py (1)

1672-1675: LGTM! Test assertions correctly updated for the new metadata shape.

The updated test expectations properly reflect the removal of is_visible from generated input data and property metadata. The tests now correctly validate that only is_protected (and other non-visibility properties) are included in node data structures, ensuring the SDK behaves as intended after the is_visible removal.

Also applies to: 1826-1829, 2052-2054


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: 58e0d3d
Status: ✅  Deploy successful!
Preview URL: https://12052fea.infrahub-sdk-python.pages.dev
Branch Preview URL: https://sb-20251107-remove-metadata.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@             Coverage Diff             @@
##           develop     #603      +/-   ##
===========================================
- Coverage    76.44%   75.44%   -1.01%     
===========================================
  Files          112      108       -4     
  Lines        10856     9321    -1535     
  Branches      2335     1854     -481     
===========================================
- Hits          8299     7032    -1267     
+ Misses        1982     1800     -182     
+ Partials       575      489      -86     
Flag Coverage Δ
integration-tests 34.82% <0.00%> (-2.20%) ⬇️
python-3.10 48.50% <0.00%> (-2.21%) ⬇️
python-3.11 48.52% <0.00%> (+0.03%) ⬆️
python-3.12 48.50% <0.00%> (-2.17%) ⬇️
python-3.13 48.48% <0.00%> (-2.21%) ⬇️
python-3.9 47.18% <0.00%> (?)
python-filler-3.12 24.45% <100.00%> (+0.76%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/node/attribute.py 94.93% <ø> (-0.07%) ⬇️
infrahub_sdk/node/constants.py 100.00% <100.00%> (ø)
infrahub_sdk/protocols_base.py 74.01% <ø> (-0.21%) ⬇️
infrahub_sdk/schema/__init__.py 67.26% <ø> (-5.45%) ⬇️

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@solababs solababs requested a review from a team November 7, 2025 10:56
@gmazoyer
Copy link
Contributor

gmazoyer commented Nov 7, 2025

This PR should target infrahub-develop instead of develop.

@ogenstad
Copy link
Contributor

ogenstad commented Nov 7, 2025

This PR should target infrahub-develop instead of develop.

I think either or would be fine in this case as IS_VISIBLE was never really used and even if you update the property it doesn't do anything sensible.

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.

5 participants