Skip to content

IFC-2303: update SDK protocols for CoreKeyValue schema#867

Open
polmichel wants to merge 3 commits intoinfrahub-developfrom
pmi-20260313-schema-updates
Open

IFC-2303: update SDK protocols for CoreKeyValue schema#867
polmichel wants to merge 3 commits intoinfrahub-developfrom
pmi-20260313-schema-updates

Conversation

@polmichel
Copy link
Contributor

@polmichel polmichel commented Mar 13, 2026

Why

Synchronization step with opsmill/infrahub#8590 which introduces CoreKeyValue schema definitions for webhook custom headers.

This PR updates the SDK-side generated protocols to reflect the new schema entities added in the infrahub backend.

What changed

No behavioral changes — this is purely additive generated protocol updates to stay in sync with the backend schema.

How to review

  1. Check infrahub_sdk/protocols.py diff — the new protocol stubs matching the backend schema additions

How to test

uv run invoke format && uv run invoke lint   # Should pass
uv run pytest tests/unit/                     # Should pass

Impact & rollout

Summary by CodeRabbit

  • New Features
    • Key-value storage with named entries including key, optional description, and value.
    • Dedicated key-value types for environment variables and static values (available for both synchronous and asynchronous flows).
    • Webhook configuration now supports managed headers in both synchronous and asynchronous flows.

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f83f654-e222-4958-a6a2-bd759638515d

📥 Commits

Reviewing files that changed from the base of the PR and between 085f438 and fc3dce0.

📒 Files selected for processing (1)
  • infrahub_sdk/protocols.py

Walkthrough

Adds value-bearing key-value node types to infrahub_sdk/protocols.py: a base CoreKeyValue (fields: name, key, description, value) with async subclasses CoreEnvKeyValue and CoreStaticKeyValue, and corresponding sync counterparts CoreKeyValueSync, CoreEnvKeyValueSync, and CoreStaticKeyValueSync. Also adds a headers relationship field to both CoreWebhook and CoreWebhookSync.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the main change: adding SDK protocols for CoreKeyValue schema to synchronize with backend updates.
Description check ✅ Passed The description covers all critical sections: Why (synchronization with backend PR), What changed (generated protocol classes), How to review and test, and deployment notes about coordination with backend merge.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@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: fc3dce0
Status: ✅  Deploy successful!
Preview URL: https://87cab0f7.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pmi-20260313-schema-updates.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                 Coverage Diff                  @@
##           infrahub-develop     #867      +/-   ##
====================================================
+ Coverage             80.64%   80.70%   +0.05%     
====================================================
  Files                   118      118              
  Lines                 10246    10266      +20     
  Branches               1534     1534              
====================================================
+ Hits                   8263     8285      +22     
+ Misses                 1455     1454       -1     
+ Partials                528      527       -1     
Flag Coverage Δ
integration-tests 40.47% <100.00%> (+0.11%) ⬆️
python-3.10 51.91% <100.00%> (+0.09%) ⬆️
python-3.11 51.91% <100.00%> (+0.09%) ⬆️
python-3.12 51.91% <100.00%> (+0.09%) ⬆️
python-3.13 51.91% <100.00%> (+0.09%) ⬆️
python-3.14 53.63% <100.00%> (+0.11%) ⬆️
python-filler-3.12 23.99% <0.00%> (-0.05%) ⬇️

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%> (ø)

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

@polmichel polmichel changed the title feat: update SDK protocols for CoreKeyValue schema IFC-2303: update SDK protocols for CoreKeyValue schema Mar 14, 2026
@polmichel polmichel marked this pull request as ready for review March 14, 2026 11:46
@polmichel polmichel requested a review from a team as a code owner March 14, 2026 11:46
@ogenstad
Copy link
Contributor

Once the Infrahub side of this has been merged this PR might need some updates but should be ready to go. The only comment would be that we need to hold off with the merge until after Infrahub 1.8 and SDK 1.19.0 has been released. Since we don't have a specific infrahub-develop branch for each release within the SDK.

@polmichel polmichel marked this pull request as draft March 16, 2026 12:17
@polmichel polmichel marked this pull request as ready for review March 16, 2026 22:09
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.

3 participants