Skip to content

Clean up logic to load repository config items#866

Draft
ogenstad wants to merge 2 commits intoinfrahub-developfrom
pog-repository-loading
Draft

Clean up logic to load repository config items#866
ogenstad wants to merge 2 commits intoinfrahub-developfrom
pog-repository-loading

Conversation

@ogenstad
Copy link
Contributor

Why

  • Clean up code to load different sections from a .infrahub.yml file
  • The reason is that the extra layer we have now doesn't provide much value and only makes these simple calls more complex.

What changed

  • Removed TypeVar from the imports
  • Removed ResourceClass = TypeVar("ResourceClass")
  • Removed RESOURCE_MAP dict
  • Removed _has_resource and _get_resource generic helper methods
  • Replaced all 12 public methods (has_* / get_*) with direct implementations that iterate typed fields (e.g. self.jinja2_transforms) and compare item.name directly, instead of routing through getattr and the map

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa1626d2-37e0-4343-92ba-5916763b3d20

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Coding Plan
  • Generate coding plan for human review comments

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 Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                 Coverage Diff                  @@
##           infrahub-develop     #866      +/-   ##
====================================================
+ Coverage             80.64%   80.70%   +0.05%     
====================================================
  Files                   118      118              
  Lines                 10246    10255       +9     
  Branches               1534     1544      +10     
====================================================
+ Hits                   8263     8276      +13     
+ Misses                 1455     1452       -3     
+ Partials                528      527       -1     
Flag Coverage Δ
integration-tests 40.32% <16.12%> (-0.04%) ⬇️
python-3.10 51.93% <96.77%> (+0.11%) ⬆️
python-3.11 51.95% <96.77%> (+0.13%) ⬆️
python-3.12 51.93% <96.77%> (+0.11%) ⬆️
python-3.13 51.95% <96.77%> (+0.13%) ⬆️
python-3.14 53.64% <96.77%> (+0.12%) ⬆️
python-filler-3.12 23.96% <9.67%> (-0.07%) ⬇️

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

Files with missing lines Coverage Δ
infrahub_sdk/schema/repository.py 89.10% <100.00%> (+2.02%) ⬆️

... and 1 file with indirect coverage changes

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

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2026

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1ccef9b
Status: ✅  Deploy successful!
Preview URL: https://a4983db7.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-repository-loading.infrahub-sdk-python.pages.dev

View logs

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.

1 participant