Skip to content

feat(xtest): Add missing attribute value test.#380

Merged
c-r33d merged 11 commits intomainfrom
feat/get-attr-values-def
Mar 9, 2026
Merged

feat(xtest): Add missing attribute value test.#380
c-r33d merged 11 commits intomainfrom
feat/get-attr-values-def

Conversation

@c-r33d
Copy link
Copy Markdown
Contributor

@c-r33d c-r33d commented Jan 15, 2026

  1. Add E2E encryption/decryption test to ensure that when a user passes in an attribute value with autoconfigure that we give back the attribute definition and it's key to perform the encryption.

Links to:

@c-r33d c-r33d requested review from a team as code owners January 15, 2026 16:36
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @c-r33d, 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 introduces a new end-to-end test case to validate the behavior of the key management system when handling attribute values during encryption and decryption. The core objective is to confirm that if an attribute value is provided via autoconfigure but its fully qualified name is not explicitly present, the system correctly falls back to using the key defined at the attribute level. This ensures robust key resolution and enhances the reliability of the encryption process under various attribute configuration scenarios.

Highlights

  • New Pytest Fixture: A new pytest fixture, attribute_missing_value_key_mapping, has been added. This fixture sets up an attribute with an attribute-level managed key mapping, specifically designed to simulate a scenario where an attribute value FQN is 'missing' but the attribute definition itself has a key.
  • End-to-End Test for Attribute Value Handling: A new end-to-end test, test_encrypt_with_missing_value_uses_definition_key, has been introduced. This test verifies that when an attribute value is passed with autoconfigure and the specific value FQN is not explicitly defined (i.e., 'missing'), the system correctly uses the key associated with the attribute definition for encryption and decryption.

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

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.

@c-r33d c-r33d changed the title feat(core): Add missing attribute value test. feat(xtest): Add missing attribute value test. Jan 15, 2026
Copy link
Copy Markdown
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 adds a new end-to-end test to verify that when encrypting with an attribute value that doesn't exist, the key mapping from the attribute definition is correctly used. The changes are logical and the test case is a valuable addition. I've provided a couple of suggestions to refactor the new fixture and test function for improved clarity and robustness.

Comment thread xtest/fixtures/attributes.py Outdated
Comment thread xtest/test_abac.py Outdated
@c-r33d
Copy link
Copy Markdown
Contributor Author

c-r33d commented Jan 15, 2026

/gemini review

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
34.3% Duplication on New Code (required ≤ 8%)

See analysis details on SonarQube Cloud

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
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 adds two new end-to-end tests to verify that when encrypting with a non-existent attribute value, the key mapping from the parent attribute definition is correctly used. This is tested for scenarios with and without key management enabled. The changes are well-implemented and the tests cover the intended functionality. I have a couple of suggestions to improve the test code by reducing duplication, which would enhance maintainability.

Comment thread xtest/test_abac.py Outdated
Comment thread xtest/test_abac.py Outdated
@github-actions
Copy link
Copy Markdown

@c-r33d
Copy link
Copy Markdown
Contributor Author

c-r33d commented Mar 5, 2026

/gemini review

Copy link
Copy Markdown
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 new end-to-end test to validate the behavior of attribute value traversal during encryption with autoconfigure. The changes include updating the Attribute model, adding a new attribute_create parameter, and creating new test fixtures to support this scenario. Support checks for the attribute_traversal feature have also been added to the Go and JavaScript SDK test scripts. The implementation is sound, but I've provided a couple of suggestions to simplify the version-checking logic in the shell scripts for improved readability and maintainability.

Comment thread xtest/sdk/go/cli.sh Outdated
Comment thread xtest/sdk/js/cli.sh Outdated
c-r33d and others added 3 commits March 5, 2026 10:26
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

X-Test Failure Report

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

X-Test Failure Report

❌ go-v0.13.0
❌ go-main
❌ js-main
❌ js-v0.13.0

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

pflynn-virtru
pflynn-virtru previously approved these changes Mar 5, 2026
Comment thread xtest/test_abac.py Outdated
elizabethhealy
elizabethhealy previously approved these changes Mar 5, 2026
@c-r33d c-r33d dismissed stale reviews from elizabethhealy and pflynn-virtru via a7131af March 9, 2026 14:08
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 9, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

X-Test Failure Report

✅ java-main
✅ go-v0.13.0
✅ js-v0.13.0
✅ js-main

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

@c-r33d c-r33d merged commit 8be9670 into main Mar 9, 2026
20 of 23 checks passed
@c-r33d c-r33d deleted the feat/get-attr-values-def branch March 9, 2026 15:30
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.

4 participants