Skip to content

feat: add the encryption attribute to the CoreArtifact protocols - #1526

Open
DharmaBytesX wants to merge 1 commit into
infrahub-developfrom
sas-protocols-encryption
Open

DharmaBytesX wants to merge 1 commit into
infrahub-developfrom
sas-protocols-encryption

Conversation

@DharmaBytesX

@DharmaBytesX DharmaBytesX commented Nov 13, 2026 •

Copy link
Copy Markdown

The generated CoreArtifact protocols lack the encryption attribute that Infrahub PR #11561 adds.
Adds it to the sync and async classes, as the Infrahub generator renders it.
Review: the base branch, and that the Infrahub PR needs this merged before its pointer bump.

Why

opsmill/infrahub#11561 adds a read-only encryption attribute to CoreArtifact: plaintext, encrypted or unreadable. The Infrahub job backend-validate-generated fails while protocols.py differs from the generated output, and typed code cannot read the attribute.

Base branch: infrahub-develop, the branch for changes that need the next Infrahub version. The Infrahub PR can bump its python_sdk pointer only after this is merged.

What changed

  • infrahub_sdk/protocols.py: encryption: String in CoreArtifact and CoreArtifactSync. The kind is String, not optional, because the attribute has a default.
  • changelog/+core-artifact-encryption-protocol.added.md: changelog entry.
  • The file header says not to edit it by hand. The two lines are the output of uv run invoke backend.generate in the Infrahub repository. A regeneration changes nothing.

How to test

# In opsmill/infrahub on the branch of PR #11561:
uv run invoke backend.generate
git -C python_sdk diff infrahub_sdk/protocols.py   # shows the 2 lines of this PR
  • The reviewer rendered the file again with the Infrahub generator and compared it with this file: identical.
  • ruff check and ruff format --check pass on the file.

Impact & rollout

  • Backward compatibility: none broken. Code that reads artifact.encryption raises AttributeError against a server without the attribute, so this belongs on infrahub-develop only.

Not done or not verified

  • Not run: the SDK test suite, towncrier build --draft and the SDK CI.
  • Not known: the Infrahub version that ships the attribute. The changelog entry does not name one.

Code review

The code-review skill ran at level high on the uncommitted change, by an agent other than the author. The agent also compared the file with the generator output.

Critical Important Minor
0 1 3
  • Important: encryption exists only on an Infrahub branch that is not merged, so released SDK code could meet a server without it. Kept: the base is infrahub-develop, which holds changes that need the next Infrahub version.
  • Minor, left as they are: the changelog entry names no Infrahub version; the protocol type does not mark the attribute as read-only, as for the other read-only attributes; the manual edit versus the header, explained above.

Security review

The security-review skill reads only commits, so the agent reviewed the change by hand with the skill's method. Agent other than the author. High 0, Medium 0, Low 0.

Dropped after checks: runtime use of the annotations (none found), the meaning of the value for callers, and the wording "read-only".

Checklist

  • Tests added/updated
  • Changelog entry added (uv run towncrier create ...)
  • External docs updated (if user-facing or ops-facing change)
  • Internal .md docs updated (internal knowledge and AI code tools knowledge)

View guided diff Turn on auto-fix

Infrahub adds a read-only `encryption` attribute to `CoreArtifact`: plaintext,
encrypted or unreadable. The generated protocols did not have it, so typed
code could not read it, and the Infrahub check that the generated files are
up to date fails.

Regenerate `protocols.py` from the Infrahub core models, which adds
`encryption: String` to `CoreArtifact` and `CoreArtifactSync`, and add a
changelog entry.

Signed-off-by: Simon AURA--SCUSSEL <simon@opsmill.com>
@DharmaBytesX
DharmaBytesX marked this pull request as ready for review November 13, 2026 14:22
@DharmaBytesX
DharmaBytesX requested a review from a team as a code owner November 13, 2026 14:22
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4fbf74e
Status: ✅  Deploy successful!
Preview URL: https://195d1135.infrahub-sdk-python.pages.dev
Branch Preview URL: https://sas-protocols-encryption.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 2 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                Coverage Diff                @@
##           infrahub-develop    #1526   +/-   ##
=================================================
  Coverage             87.88%   87.88%           
=================================================
  Files                   157      157           
  Lines                 15658    15660    +2     
  Branches               2114     2114           
=================================================
+ Hits                  13761    13763    +2     
  Misses                 1336     1336           
  Partials                561      561           
Flag Coverage Δ
integration-tests 42.95% <100.00%> (+<0.01%) ⬆️
python-3.10 63.05% <100.00%> (+0.01%) ⬆️
python-3.11 63.05% <100.00%> (+<0.01%) ⬆️
python-3.12 63.05% <100.00%> (+<0.01%) ⬆️
python-3.13 63.05% <100.00%> (+<0.01%) ⬆️
python-3.14 63.05% <100.00%> (+<0.01%) ⬆️
python-3.15 63.05% <100.00%> (+<0.01%) ⬆️
python-filler-3.12 23.03% <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%> (ø)

... and 3 files with indirect coverage changes

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

DharmaBytesX added a commit to opsmill/infrahub that referenced this pull request Nov 17, 2026
…ttribute to the CoreArtifact protocols

The generated SDK protocols lack the `encryption` attribute of `CoreArtifact`,
so `backend-validate-generated` fails and the gate skips the huge-runner jobs.
The SDK commit adds it (opsmill/infrahub-sdk-python#1526) and builds on the
commit this branch pointed at before. Point at the merge commit once that
pull request is merged.

Signed-off-by: Simon AURA--SCUSSEL <simon@opsmill.com>
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.

1 participant