Skip to content

feat(xtest): Adds 4.3.0 explicit version check#507

Open
dmihalcik-virtru wants to merge 3 commits into
mainfrom
didyouwantmetotellyouwhenitwas-four-thirty
Open

feat(xtest): Adds 4.3.0 explicit version check#507
dmihalcik-virtru wants to merge 3 commits into
mainfrom
didyouwantmetotellyouwhenitwas-four-thirty

Conversation

@dmihalcik-virtru

@dmihalcik-virtru dmihalcik-virtru commented Jun 12, 2026

Copy link
Copy Markdown
Member

I think all head libraries should support these features, so I maybe will disable the feature flags.

@dmihalcik-virtru dmihalcik-virtru requested review from a team as code owners June 12, 2026 18:09
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dmihalcik-virtru, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 48 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e551b22e-8e9f-4045-8288-30a32b6af491

📥 Commits

Reviewing files that changed from the base of the PR and between 38fec64 and fd18513.

📒 Files selected for processing (1)
  • xtest/test_tdfs.py
📝 Walkthrough

Walkthrough

A new PyTest function test_tdf_spec_target_430 is added to exercise encryption targeting container format 4.3.0. The test conditionally skips unless both SDKs are focused and support the required features, then encrypts to ztdf, decrypts, and asserts plaintext equality.

Changes

TDF 4.3.0 round-trip encryption test

Layer / File(s) Summary
TDF 4.3.0 round-trip test
xtest/test_tdfs.py
New test function test_tdf_spec_target_430 encrypts with target_mode="4.3.0", conditionally skips based on SDK feature support (hexaflexible and hexless), and validates byte-for-byte equality of decrypted output against the original plaintext.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • opentdf/tests#412: Introduces attribute_default_rsa and deterministic attribute selection patterns reused in the new test.
  • opentdf/tests#442: Refactors xtest/test_tdfs.py tests to use shared encrypted_tdf fixture that the new test depends on.

Suggested reviewers

  • elizabethhealy
  • pflynn-virtru

Poem

🐰 A test for 4.3.0 hops into sight,
Round-trip encrypt and decrypt, shining bright!
With hexaflexible and hexless in place,
The plaintext and cipher dance through space.
One function stands guard, so simple and right,
Code quality blessed with this testful delight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a test function for explicit version check targeting container format 4.3.0.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch didyouwantmetotellyouwhenitwas-four-thirty

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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new test, test_tdf_spec_target_430, to verify targeting container format 4.3.0. Feedback points out a copy-paste error in a skip message referencing the wrong container format version, as well as missing platform capability checks and skew skips that could cause failures on older platform versions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread xtest/test_tdfs.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
xtest/test_tdfs.py (1)

160-168: ⚡ Quick win

Consider adding manifest format validation.

The test could verify that the encrypted TDF actually uses the 4.3.0 format with hexless integrity information. The main test_tdf_roundtrip includes this check (lines 80-85).

✨ Suggested enhancement
     ct_file = encrypted_tdf(
         encrypt_sdk,
         target_mode="4.3.0",
         attr_values=attribute_default_rsa.value_fqns,
     )
+    
+    # Verify the manifest uses 4.3.0 format
+    looks_like_430(tdfs.manifest(ct_file))

     rt_file = encrypted_tdf.rt_file(ct_file, decrypt_sdk)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@xtest/test_tdfs.py` around lines 160 - 168, After creating ct_file with
encrypted_tdf, add assertions to validate the TDF manifest: retrieve the
manifest from ct_file (same object produced by encrypted_tdf) and assert the
manifest's TDF version equals "4.3.0" and that the manifest's integrity
information indicates the hexless format (i.e., check the integrity
field/property on the manifest for the hexless indicator). Place these checks
after ct_file is created and before calling encrypted_tdf.rt_file /
decrypt_sdk.decrypt so the test ensures the encrypted TDF uses the 4.3.0 hexless
manifest format.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@xtest/test_tdfs.py`:
- Around line 151-154: Update the pytest skip message to reference the correct
container format version: change the string passed to pytest.skip in the block
that checks encrypt_sdk.supports("hexaflexible") so it says "4.3.0" instead of
"4.2.2" (the check is in the same scope where
encrypt_sdk.supports("hexaflexible") is used and pytest.skip(...) is called).
- Around line 141-148: The test_tdf_spec_target_430 test is missing the
audit_logs fixture and the associated assertions for the decrypt→rewrap KAS
path; add the audit_logs fixture to the test signature (alongside existing
fixtures), call audit_logs.mark() before invoking decrypt on decrypt_sdk, and
after the decrypt/rewrap flow assert audit_logs.rewrap_success() (following the
pattern used in test_tdf_roundtrip for audit verification) so the rewrap
operation is verified by the audit log.

---

Nitpick comments:
In `@xtest/test_tdfs.py`:
- Around line 160-168: After creating ct_file with encrypted_tdf, add assertions
to validate the TDF manifest: retrieve the manifest from ct_file (same object
produced by encrypted_tdf) and assert the manifest's TDF version equals "4.3.0"
and that the manifest's integrity information indicates the hexless format
(i.e., check the integrity field/property on the manifest for the hexless
indicator). Place these checks after ct_file is created and before calling
encrypted_tdf.rt_file / decrypt_sdk.decrypt so the test ensures the encrypted
TDF uses the 4.3.0 hexless manifest format.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8eca62e7-5856-4e2b-a389-5751dc5d33d5

📥 Commits

Reviewing files that changed from the base of the PR and between b3eb9c2 and 38fec64.

📒 Files selected for processing (1)
  • xtest/test_tdfs.py

Comment thread xtest/test_tdfs.py
Comment thread xtest/test_tdfs.py
@github-actions

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

X-Test Failure Report

@github-actions

Copy link
Copy Markdown

X-Test Failure Report

✅ go@v0.33.0-main

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