Skip to content

chore(schema): add commit to the CoreGenericRepository protocol [IFC-2954] - #1272

Open
ogenstad wants to merge 1 commit into
infrahub-developfrom
pog-generic-repository-commit-IFC-2954
Open

chore(schema): add commit to the CoreGenericRepository protocol [IFC-2954]#1272
ogenstad wants to merge 1 commit into
infrahub-developfrom
pog-generic-repository-commit-IFC-2954

Conversation

@ogenstad

@ogenstad ogenstad commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What

Regenerated infrahub_sdk/protocols.py so CoreGenericRepository (and its Sync counterpart) declares commit: StringOptional.

This goes hand in hand with opsmill/infrahub#10387, but I'd want to merge this PR first.

Why

The Infrahub core schema now defines commit on the CoreGenericRepository generic, in addition to the two concrete repository kinds that already declared it. protocols.py is generated from those definitions by invoke backend.generate in the Infrahub repository, so this file has to move with them.

Both concrete kinds continue to override the attribute with their own branch scope (local for CoreRepository, aware for CoreReadOnlyRepository), so no runtime behaviour changes for either.

Notes

  • Generated output only, no hand-written changes. Following the precedent of b76594a, there is no changelog fragment for a protocols regeneration.
  • This PR is a prerequisite for the matching Infrahub PR: invoke backend.validate-generated there runs git -C python_sdk diff --exit-code infrahub_sdk/protocols.py, which stays red until the submodule pointer includes this commit.

Summary by cubic

Declare commit on the CoreGenericRepository and CoreGenericRepositorySync protocols to align the SDK with the updated core schema and allow generic-typed repositories to expose commit. Previously the generic lacked this attribute; now it is StringOptional. Concrete kinds still override it, so runtime behavior does not change.

  • Generated change in infrahub_sdk/protocols.py only; no hand-written logic or changelog.
  • Unblocks core validation that diffs the SDK protocols; required for IFC-2954.
  • Enables removing type suppressions where commit was accessed on a generic-typed repository.

Written for commit 2c58b4b. Summary will update on new commits.

Review in cubic

…2954]

Regenerated from the Infrahub core schema definitions, where commit is now declared on the CoreGenericRepository generic in addition to the two concrete repository kinds.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2c58b4b
Status: ✅  Deploy successful!
Preview URL: https://eb2a75f5.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-generic-repository-commi.infrahub-sdk-python.pages.dev

View logs

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                Coverage Diff                @@
##           infrahub-develop    #1272   +/-   ##
=================================================
  Coverage             84.16%   84.16%           
=================================================
  Files                   147      147           
  Lines                 13045    13047    +2     
  Branches               1930     1930           
=================================================
+ Hits                  10979    10981    +2     
  Misses                 1503     1503           
  Partials                563      563           
Flag Coverage Δ
integration-tests 39.02% <100.00%> (+<0.01%) ⬆️
python-3.10 56.98% <100.00%> (+<0.01%) ⬆️
python-3.11 57.00% <100.00%> (+<0.01%) ⬆️
python-3.12 57.00% <100.00%> (+<0.01%) ⬆️
python-3.13 57.00% <100.00%> (+<0.01%) ⬆️
python-3.14 57.00% <100.00%> (+0.02%) ⬆️
python-filler-3.12 23.68% <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/protocols.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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