Skip to content

Add watch statement to artifact definitions#1058

Merged
ogenstad merged 2 commits into
infrahub-developfrom
pog-artifact-regeneration-watch-ihs-238
Jun 4, 2026
Merged

Add watch statement to artifact definitions#1058
ogenstad merged 2 commits into
infrahub-developfrom
pog-artifact-regeneration-watch-ihs-238

Conversation

@ogenstad
Copy link
Copy Markdown
Contributor

@ogenstad ogenstad commented Jun 4, 2026

Why

Add watch section under artifact definitions, part of the larger effort in opsmill/infrahub#9414

Closes IHS-238

What changed

  • New "watch" section in artifact definition config
  • Tests

Summary by cubic

Add an optional watch section to artifact transforms in infrahub_sdk to list extra files and directories that trigger regeneration. Supports IHS-238 by rebuilding artifacts on Git changes that aren’t auto-detected.

  • New Features
    • Added InfrahubWatchConfig with files: list[str]; directories are recursive; unknown keys are rejected.
    • watch supported on InfrahubJinja2TransformConfig and InfrahubPythonTransformConfig; included in payload only when set.
    • Tests for validation, parsing, and payload inclusion/exclusion.

Written for commit 7959635. Summary will update on new commits.

Review in cubic

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                 Coverage Diff                  @@
##           infrahub-develop    #1058      +/-   ##
====================================================
+ Coverage             81.71%   81.73%   +0.02%     
====================================================
  Files                   135      135              
  Lines                 11637    11642       +5     
  Branches               1759     1759              
====================================================
+ Hits                   9509     9516       +7     
+ Misses                 1576     1573       -3     
- Partials                552      553       +1     
Flag Coverage Δ
integration-tests 41.61% <0.00%> (-0.02%) ⬇️
python-3.10 55.12% <0.00%> (+0.01%) ⬆️
python-3.11 55.12% <0.00%> (+0.01%) ⬆️
python-3.12 55.12% <0.00%> (+0.01%) ⬆️
python-3.13 55.12% <0.00%> (-0.01%) ⬇️
python-3.14 55.12% <0.00%> (-0.01%) ⬇️
python-filler-3.12 22.39% <100.00%> (+0.03%) ⬆️

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 92.39% <100.00%> (+2.44%) ⬆️

... 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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread infrahub_sdk/schema/repository.py
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7959635
Status: ✅  Deploy successful!
Preview URL: https://dfd21069.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-artifact-regeneration-wa.infrahub-sdk-python.pages.dev

View logs

@ogenstad ogenstad marked this pull request as ready for review June 4, 2026 12:39
@ogenstad ogenstad requested a review from a team as a code owner June 4, 2026 12:39
@ogenstad ogenstad merged commit f1c2f57 into infrahub-develop Jun 4, 2026
21 checks passed
@ogenstad ogenstad deleted the pog-artifact-regeneration-watch-ihs-238 branch June 4, 2026 13:11
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