Skip to content

fix: add a default assertion id if one is not specified#341

Merged
mkleene merged 3 commits intomainfrom
add-default-id
Feb 24, 2026
Merged

fix: add a default assertion id if one is not specified#341
mkleene merged 3 commits intomainfrom
add-default-id

Conversation

@mkleene
Copy link
Contributor

@mkleene mkleene commented Feb 23, 2026

Since the IDs of assertions aren't generally consumed by anyone but they are required by clients that perform
schema validation we add a UUID as the assertion ID when no assertion ID is specified.

@mkleene mkleene requested review from a team as code owners February 23, 2026 15:52
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @mkleene, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the robustness of assertion creation within the TDF SDK by ensuring that all assertions are assigned a unique identifier. Previously, assertions could be created without an ID, potentially leading to issues. Now, if an assertion ID is not explicitly provided or is empty, a new UUID will be automatically generated and assigned, preventing null or empty IDs and improving data integrity.

Highlights

  • Assertion ID Generation: Implemented logic to automatically generate a UUID for Manifest.Assertion IDs if the assertionConfig.id is null or empty, ensuring every assertion has a unique identifier.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • sdk/src/main/java/io/opentdf/platform/sdk/TDF.java
    • Ensured that Manifest.Assertion IDs are always populated, generating a UUID if the configured ID is null or empty.
  • sdk/src/test/java/io/opentdf/platform/sdk/TDFTest.java
    • Added a new test case testAssertionWithoutIdGeneratesUUID to verify that assertions created without an explicit ID correctly receive a generated UUID.
    • Verified that assertions with explicitly provided IDs retain their original ID.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

X-Test Failure Report

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 fix to ensure that assertions always have a valid ID. If an assertion is created without a specified ID, or with an empty ID, a new UUID will now be automatically generated and assigned. This change improves the robustness of assertion handling by preventing assertions from having null or empty IDs. A comprehensive new test case has been added to validate this new behavior, covering scenarios for null, empty, and explicitly provided assertion IDs, and verifying the correct generation and format of UUIDs. The changes are well-implemented and directly address the stated objective of the pull request.

@github-actions
Copy link

@sonarqubecloud
Copy link

@github-actions
Copy link

@mkleene mkleene changed the title fix: add a default id if one is not specified fix: add a default assertion id if one is not specified Feb 23, 2026
@mkleene mkleene merged commit 69d6a53 into main Feb 24, 2026
18 checks passed
@mkleene mkleene deleted the add-default-id branch February 24, 2026 14:52
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