Skip to content

fix(policy): deprecate ListAttributeValues in favor of existing GetAttribute#3108

Draft
jakedoublev wants to merge 5 commits intomainfrom
fix/DSPX-2530
Draft

fix(policy): deprecate ListAttributeValues in favor of existing GetAttribute#3108
jakedoublev wants to merge 5 commits intomainfrom
fix/DSPX-2530

Conversation

@jakedoublev
Copy link
Contributor

Proposed Changes

Checklist

  • I have added or updated unit tests
  • I have added or updated integration tests (if appropriate)
  • I have added or updated documentation

Testing Instructions

@github-actions github-actions bot added comp:db DB component comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) docs Documentation size/m labels Mar 2, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 streamlines the policy attribute value retrieval mechanism by deprecating a redundant listing RPC. By removing the ListAttributeValues endpoint and its underlying logic, the system encourages the use of the more comprehensive GetAttribute RPC, which already provides the necessary functionality. This change simplifies the API surface and reduces maintenance overhead, ensuring a more consistent and efficient way to interact with attribute values.

Highlights

  • API Deprecation: The ListAttributeValues RPC has been formally deprecated across the service, protocol definition, and documentation. Clients are now directed to use the existing GetAttribute RPC for retrieving attribute values.
  • Code Removal: All service-side and database-side implementations related to ListAttributeValues have been removed, including the database query, Go client methods, and the service handler.
  • Test Updates: Integration tests that previously relied on ListAttributeValues have been updated to use GetAttribute instead, ensuring test coverage remains consistent with the new API approach.

🧠 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
  • docs/grpc/index.html
    • Marked ListAttributeValues as deprecated in the gRPC documentation.
  • service/integration/attribute_values_test.go
    • Removed time and proto imports no longer needed after test refactoring.
    • Deleted all test cases specifically for ListAttributeValues.
    • Updated the listValues helper function to use GetAttribute for fetching attribute values.
  • service/integration/attributes_test.go
    • Modified the listValues helper function to use GetAttribute instead of ListAttributeValues.
  • service/integration/namespaces_test.go
    • Adjusted the listValues helper function to retrieve attribute values via GetAttribute.
  • service/policy/attributes/attributes.go
    • Added a new error constant ErrDeprecatedListAttributeValues.
    • Updated the ListAttributeValues RPC handler to immediately return an Unimplemented error with the deprecation message.
  • service/policy/attributes/attributes.proto
    • Added // Deprecated comments to the ListAttributeValues RPC definition, advising to use GetAttribute.
  • service/policy/db/attribute_values.go
    • Removed the pgtype import as it was only used by the removed ListAttributeValues function.
    • Deleted the ListAttributeValues and ListAllAttributeValues methods from the PolicyDBClient.
  • service/policy/db/attribute_values.sql.go
    • Removed the generated Go code for the listAttributeValues SQL query, including its parameters and return types.
  • service/policy/db/queries/attribute_values.sql
    • Deleted the SQL query definition for listAttributeValues.
Ignored Files
  • Ignored by pattern: docs/openapi/**/* (1)
    • docs/openapi/policy/attributes/attributes.openapi.yaml
  • Ignored by pattern: protocol/**/* (2)
    • protocol/go/policy/attributes/attributes_grpc.pb.go
    • protocol/go/policy/attributes/attributesconnect/attributes.connect.go
Activity
  • The pull request was opened by jakedoublev with a title indicating a fix and deprecation.
  • The pull request description is minimal, focusing on proposed changes and a checklist, suggesting the changes are primarily code-driven and self-explanatory.
  • No specific human comments or reviews have been recorded yet for this pull request.
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.


An old path now must fade, New ways emerge, a better trade. List no more, but get with grace, Efficiency finds its rightful place.

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
Contributor

github-actions bot commented Mar 2, 2026

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 209.777835ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 108.528449ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 386.551669ms
Throughput 258.70 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.47841477s
Average Latency 412.737559ms
Throughput 120.54 requests/second

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

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 effectively deprecates the ListAttributeValues RPC in favor of GetAttribute. The changes are comprehensive, including updating the service implementation to return an error, removing the corresponding database logic, and updating integration tests and documentation. The approach is sound. I have one minor suggestion in the protobuf definition to make the deprecation more explicit for tooling and generated code.

Note: Security Review is unavailable for this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 159.391562ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 85.15712ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 363.878041ms
Throughput 274.82 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 38.572556311s
Average Latency 384.435845ms
Throughput 129.63 requests/second

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 197.28947ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 96.424197ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 373.611463ms
Throughput 267.66 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.83011019s
Average Latency 396.434415ms
Throughput 125.53 requests/second

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

X-Test Failure Report

opentdfplatformQF8WN4.dockerbuild

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 147.103414ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 75.438385ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 372.519937ms
Throughput 268.44 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 38.228811398s
Average Latency 380.513034ms
Throughput 130.79 requests/second

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:db DB component comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) docs Documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant