Skip to content

Conversation

@minitriga
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the type/documentation Improvements or additions to documentation label Jul 11, 2025
@cloudflare-workers-and-pages
Copy link

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

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 866ab0a
Status: ✅  Deploy successful!
Preview URL: https://b74b4c98.infrahub-sdk-python.pages.dev
Branch Preview URL: https://atg-20250711-cs60.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/ctl/repository.py 66.66% 6 Missing and 1 partial ⚠️
@@             Coverage Diff             @@
##           develop     #467      +/-   ##
===========================================
- Coverage    75.58%   75.56%   -0.03%     
===========================================
  Files          100      100              
  Lines         8769     8790      +21     
  Branches      1712     1716       +4     
===========================================
+ Hits          6628     6642      +14     
- Misses        1663     1669       +6     
- Partials       478      479       +1     
Flag Coverage Δ
integration-tests 34.57% <19.04%> (-0.05%) ⬇️
python-3.10 47.97% <66.66%> (+0.04%) ⬆️
python-3.11 47.95% <66.66%> (+0.02%) ⬆️
python-3.12 47.95% <66.66%> (+0.04%) ⬆️
python-3.13 47.92% <66.66%> (+0.02%) ⬆️
python-3.9 46.62% <66.66%> (+0.02%) ⬆️
python-filler-3.12 25.17% <0.00%> (-0.07%) ⬇️

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

Files with missing lines Coverage Δ
infrahub_sdk/ctl/repository.py 78.57% <66.66%> (-3.25%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@minitriga minitriga requested a review from Copilot July 15, 2025 09:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new repository init command to infrahubctl, including supporting dependencies, tests, documentation, and a changelog entry.

  • Introduce copier as an optional dependency and update poetry extras.
  • Implement infrahubctl repository init using copier.run_copy.
  • Add unit tests and documentation for the new init command, plus a changelog entry.

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/ctl/test_repository_app.py Add tests for repository init and local-template initialization
pyproject.toml Add copier dependency and update ctl/all extras
infrahub_sdk/ctl/repository.py Implement the async init subcommand with copier.run_copy
docs/docs/infrahubctl/infrahubctl-repository.mdx Document the new init command
changelog/466.added.md Changelog entry for adding the init command
Comments suppressed due to low confidence (1)

tests/unit/ctl/test_repository_app.py:353

  • Missing assertion for exit code in test_repo_init; consider adding assert result.exit_code == 0 to verify the command succeeded.
            runner.invoke(app, ["repository", "init", str(dst), "--data", str(yaml_path), "--vcs-ref", commit])

Add init command

Add testing

changelog

Add docs

Add copier to all extras

update lock file

update lock file

update lock file

update lock file
@minitriga minitriga force-pushed the atg-20250711-cs60 branch from 75d41a3 to c07b5d4 Compare July 15, 2025 09:14
@opsmill opsmill deleted a comment from Copilot AI Jul 15, 2025
@opsmill opsmill deleted a comment from Copilot AI Jul 15, 2025
@opsmill opsmill deleted a comment from Copilot AI Jul 15, 2025
@minitriga minitriga requested a review from a team July 15, 2025 11:48
Copy link
Contributor

@BaptisteGi BaptisteGi left a comment

Choose a reason for hiding this comment

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

Just ran the command, everything works perfectly. Nice job! 👍

Few details:

  • Some could argue that if you have generator/transform you'll have by consequence queries. Don't know if we want to override the query flag based on generator/transform one.
  • In my opinion, this should be the default way for a developer to kick the tires. Then it should be included in the infrahub getting started doc https://docs.infrahub.app/getting-started/next-steps.

@minitriga
Copy link
Contributor Author

@BaptisteGi Templates fixed queries will now be included by default if generators or transforms are used.

opsmill/infrahub-template#4

@minitriga minitriga merged commit 4717ffc into develop Jul 16, 2025
19 checks passed
@minitriga minitriga deleted the atg-20250711-cs60 branch July 16, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants