Skip to content

Conversation

@solababs
Copy link
Contributor

@solababs solababs commented Jan 6, 2026

Since Builtin has been added restricted namespaces here opsmill/infrahub#8032, integrations tests from infrahub would need this update to pass

Summary by CodeRabbit

  • Chores
    • Updated Ruff code quality tool to v0.14.10 with automatic fixes enabled.
    • Added automated code formatting as part of the development workflow.
    • Refactored internal testing schema infrastructure for improved maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Walkthrough

The PR updates the pre-commit configuration and refactors the testing schema fixtures. The Ruff linter is upgraded from v0.11.9 to v0.14.10 with automatic fix support enabled, and a ruff-format hook is added. In the car\_person testing schema, the SchemaCarPerson class is restructured by extracting fixtures into SchemaCarPersonFixtures, with a new SchemaCarPerson class inheriting from it. The BUILTIN\_TAG constant is renamed to TESTING\_TAG and redefined. All tag-related references are updated accordingly, and a new testing\_tag\_base fixture is introduced for the Tag schema definition.

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 accurately reflects the main change: updating test schemas to accommodate restricted namespace changes. It clearly summarizes the purpose and scope of the changes.

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.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff            @@
##           develop     #736   +/-   ##
========================================
  Coverage    76.84%   76.84%           
========================================
  Files          113      113           
  Lines         9767     9771    +4     
  Branches      1497     1497           
========================================
+ Hits          7505     7509    +4     
  Misses        1757     1757           
  Partials       505      505           
Flag Coverage Δ
integration-tests 34.62% <100.00%> (+0.02%) ⬆️
python-3.10 50.80% <0.00%> (-0.03%) ⬇️
python-3.11 50.80% <0.00%> (-0.03%) ⬇️
python-3.12 50.78% <0.00%> (-0.01%) ⬇️
python-3.13 50.78% <0.00%> (-0.03%) ⬇️
python-3.14 52.43% <0.00%> (-0.01%) ⬇️
python-filler-3.12 23.87% <0.00%> (-0.01%) ⬇️

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

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
infrahub_sdk/testing/schemas/car_person.py (1)

135-148: Use the NAMESPACE constant for consistency.

The testing_tag_base fixture hardcodes namespace="Testing" on line 139, while other fixtures in the file use the NAMESPACE constant. For consistency and maintainability, use the constant instead.

🔎 Proposed fix
     def testing_tag_base(self) -> NodeSchema:
         return NodeSchema(
             name="Tag",
-            namespace="Testing",
+            namespace=NAMESPACE,
             include_in_menu=True,
             label="Tag",
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2e2a8e and 2eb5006.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • infrahub_sdk/testing/schemas/car_person.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification

Files:

  • infrahub_sdk/testing/schemas/car_person.py
infrahub_sdk/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Follow async/sync dual pattern for new features in the Python SDK

Files:

  • infrahub_sdk/testing/schemas/car_person.py
🧠 Learnings (1)
📚 Learning: 2025-12-10T17:13:08.136Z
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:08.136Z
Learning: Run markdownlint before committing markdown changes

Applied to files:

  • .pre-commit-config.yaml
⏰ 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.12)
  • GitHub Check: unit-tests (3.10)
  • GitHub Check: unit-tests (3.11)
  • GitHub Check: unit-tests (3.14)
  • GitHub Check: integration-tests-latest-infrahub
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (8)
.pre-commit-config.yaml (2)

20-22: LGTM! Good additions for code quality.

Adding --fix to automatically fix issues and including the ruff-format hook are excellent improvements for maintaining consistent code quality and formatting across the repository.


16-16: This is a new configuration file, not an upgrade.

The .pre-commit-config.yaml file is being added for the first time to the repository with Ruff v0.14.10. There is no previous version to upgrade from in this codebase. The original concern about compatibility with a version upgrade does not apply since this is an initial configuration, not a migration.

Likely an incorrect or invalid review comment.

infrahub_sdk/testing/schemas/car_person.py (6)

21-21: LGTM! Namespace change aligns with PR objectives.

The change from BuiltinTag to TestingTag correctly addresses the restricted namespace issue mentioned in the PR objectives.


43-43: Good refactoring to separate fixtures from test utilities.

Extracting fixtures into SchemaCarPersonFixtures and creating a separate SchemaCarPerson subclass improves organization and maintainability.


150-160: LGTM! Properly integrates the new Tag schema.

The testing_tag_base fixture is correctly added as a dependency and included in the SchemaRoot nodes list.


97-97: LGTM! Peer reference correctly updated.

The relationship peer reference has been properly updated to use TESTING_TAG instead of the old BUILTIN_TAG.


219-234: LGTM! Tag fixtures correctly updated.

All tag creation fixtures (tag_blue, tag_red, tag_green) have been properly updated to use TESTING_TAG instead of the old BUILTIN_TAG.


237-273: LGTM! Proper class structure with complete type hints.

The new SchemaCarPerson class properly inherits from SchemaCarPersonFixtures, maintaining backwards compatibility while extending functionality. All methods include proper type hints as required by the coding guidelines.

@solababs solababs requested a review from a team January 6, 2026 16:29
Copy link
Contributor

@ajtmccarty ajtmccarty left a comment

Choose a reason for hiding this comment

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

I don't know exactly how the sdk integration tests run, but it seems like this change shouldn't be necessary. I would expect the BuiltinTag schema to be available on the local infrahub server that these tests are interacting with

@solababs
Copy link
Contributor Author

solababs commented Jan 6, 2026

I don't know exactly how the sdk integration tests run, but it seems like this change shouldn't be necessary. I would expect the BuiltinTag schema to be available on the local infrahub server that these tests are interacting with

This commit opsmill/infrahub@36f088d eliminates the need for this PR

Closing this PR

@solababs solababs closed this Jan 6, 2026
@solababs solababs reopened this Jan 7, 2026
@solababs solababs closed this Jan 7, 2026
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.

3 participants