Skip to content

Conversation

@BaptisteGi
Copy link
Contributor

This pull request refines the load_from_disk method in infrahub_sdk/yaml.py to make sure we can load folders that contain various file types.

Relates to #462

@BaptisteGi BaptisteGi changed the title Fix load_from_disk method Fix load_from_disk method to load folder with multiple file extensions Jul 3, 2025
@BaptisteGi BaptisteGi changed the title Fix load_from_disk method to load folder with multiple file extensions Fix load_from_disk method to support folder with multiple file extensions Jul 3, 2025
@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@@            Coverage Diff             @@
##           stable     #463      +/-   ##
==========================================
+ Coverage   75.62%   75.64%   +0.01%     
==========================================
  Files         100      100              
  Lines        8767     8769       +2     
  Branches     1712     1714       +2     
==========================================
+ Hits         6630     6633       +3     
+ Misses       1663     1660       -3     
- Partials      474      476       +2     
Flag Coverage Δ
integration-tests 34.65% <75.00%> (+<0.01%) ⬆️
python-3.10 47.91% <62.50%> (+0.05%) ⬆️
python-3.11 47.91% <62.50%> (+0.03%) ⬆️
python-3.12 47.89% <62.50%> (+0.03%) ⬆️
python-3.13 47.87% <62.50%> (+0.01%) ⬆️
python-3.9 46.58% <62.50%> (+0.03%) ⬆️
python-filler-3.12 25.25% <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/yaml.py 84.54% <100.00%> (+1.21%) ⬆️

... and 2 files with indirect coverage changes

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

@classmethod
def load_from_disk(cls, paths: list[Path]) -> list[Self]:
yaml_files: list[Self] = []
file_extensions = {".yaml", ".yml", ".json"} # FIXME: .json is not a YAML file, should be removed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LucasG0 do you know why we have .json here? too afraid about side effect of removing it from here

@BaptisteGi BaptisteGi self-assigned this Jul 3, 2025
Copy link
Contributor

@dgarros dgarros left a comment

Choose a reason for hiding this comment

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

Please can you add a changelog for the release note

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 3, 2025

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8031518
Status: ✅  Deploy successful!
Preview URL: https://df436a59.infrahub-sdk-python.pages.dev
Branch Preview URL: https://bgi-fix-yaml-file-462.infrahub-sdk-python.pages.dev

View logs

@BaptisteGi BaptisteGi merged commit f58c459 into stable Jul 4, 2025
19 checks passed
@BaptisteGi BaptisteGi deleted the bgi-fix-yaml-file-462 branch July 4, 2025 12:30
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