Skip to content

feat(policy): Seed namespaces with standard actions on creation + namespaced actions for obligation triggers#3161

Merged
elizabethhealy merged 8 commits into
mainfrom
dspx-2450-seed-namespaces-with-standard-actions
Mar 24, 2026
Merged

feat(policy): Seed namespaces with standard actions on creation + namespaced actions for obligation triggers#3161
elizabethhealy merged 8 commits into
mainfrom
dspx-2450-seed-namespaces-with-standard-actions

Conversation

@elizabethhealy

@elizabethhealy elizabethhealy commented Mar 16, 2026

Copy link
Copy Markdown
Member

Proposed Changes

  • Automatic Standard Action Seeding: New namespaces are now automatically populated with standard 'create', 'read', 'update', and 'delete' actions upon creation.
  • Database Integration for Seeding: A new SQL query and corresponding Go function were introduced to handle the insertion of these standard actions into the database, including conflict handling to prevent duplicates.
  • Enhanced Obligation Trigger Action Resolution: When creating an obligation trigger by action name, the system now prioritizes namespace-scoped actions over global actions, ensuring more precise policy enforcement.
  • Integration Test Coverage: New integration tests were added to validate both the automatic seeding of standard actions for new namespaces and the correct prioritization of namespace-scoped actions for obligation triggers.

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

Summary by CodeRabbit

  • New Features

    • Namespaces now automatically include standard actions (create, read, update, delete) when created.
    • Action name resolution now prefers namespace-scoped actions over global ones when creating triggers.
    • Listing actions scoped to a namespace no longer returns standard actions from other namespaces.
  • Tests

    • Added integration tests verifying seeding of standard actions, scoped action listing, and trigger resolution by name.

@github-actions github-actions Bot added comp:db DB component comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) size/s labels Mar 16, 2026
@gemini-code-assist

Copy link
Copy Markdown
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 enhances the policy service by automating the provisioning of essential standard actions for any new namespace. This ensures that every new namespace starts with a foundational set of 'create', 'read', 'update', and 'delete' permissions, streamlining initial setup and maintaining consistency across the system.

Highlights

  • Automatic Action Seeding: Implemented automatic seeding of standard actions (create, read, update, delete) into new namespaces upon their creation, ensuring a baseline set of permissions.
  • Database Integration: Introduced a new SQL query and corresponding Go function to handle the insertion of these standard actions into the database, with conflict handling to prevent duplicates.
  • Integration Testing: Added a new integration test to validate that newly created namespaces correctly receive the expected standard actions.

🧠 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
  • service/integration/namespaces_test.go
    • Imported the actions package.
    • Added a new test case Test_CreateNamespace_SeedsStandardActions to verify that standard actions are automatically seeded for new namespaces.
  • service/policy/db/actions.sql.go
    • Introduced a new SQL query constant seedStandardActionsForNamespace.
    • Implemented the seedStandardActionsForNamespace Go function to execute the SQL query for seeding standard actions.
  • service/policy/db/namespaces.go
    • Modified the CreateNamespace function to call seedStandardActionsForNamespace after a new namespace is successfully created.
  • service/policy/db/queries/actions.sql
    • Added the seedStandardActionsForNamespace SQL query definition, which inserts 'create', 'read', 'update', and 'delete' actions into the actions table with is_standard set to true, and includes ON CONFLICT handling.
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.


New namespace, fresh and clean, Actions seeded, a policy scene. Create, read, update, delete, Permissions granted, oh so sweet.

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.

@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

The pull request successfully implements the feature to seed standard actions ('create', 'read', 'update', 'delete') when a new namespace is created. The changes are well-structured, including the SQL query, the generated Go database function, the integration into the CreateNamespace logic, and a comprehensive integration test. The use of ON CONFLICT DO NOTHING in the SQL query is a good practice for idempotency. The new test case effectively verifies the functionality, ensuring that the standard actions are correctly associated with the newly created namespace. Overall, the code is clean, correct, and maintains high quality.

@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 379.424241ms
Throughput 263.56 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 40.951354208s
Average Latency 408.162299ms
Throughput 122.10 requests/second

@github-actions

Copy link
Copy Markdown
Contributor

@elizabethhealy elizabethhealy changed the title feat(policy): Seed namespaces with standard actions on creation feat(policy): Seed namespaces with standard actions on creation + namespaced actions for obligation triggers Mar 16, 2026
@elizabethhealy

Copy link
Copy Markdown
Member Author

/gemini summary

@elizabethhealy

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request streamlines policy management by automating the initial setup of new namespaces and refining how actions are resolved for obligation triggers. It ensures that every new namespace begins with a foundational set of standard actions, reducing manual configuration. Furthermore, it enhances the precision of policy enforcement by prioritizing namespace-scoped actions when defining obligation triggers, making the system more robust and context-aware.

Highlights

  • Automatic Standard Action Seeding: New namespaces are now automatically populated with standard 'create', 'read', 'update', and 'delete' actions upon creation.
  • Database Integration for Seeding: A new SQL query and corresponding Go function were introduced to handle the insertion of these standard actions into the database, including conflict handling to prevent duplicates.
  • Enhanced Obligation Trigger Action Resolution: When creating an obligation trigger by action name, the system now prioritizes namespace-scoped actions over global actions, ensuring more precise policy enforcement.
  • Integration Test Coverage: New integration tests were added to validate both the automatic seeding of standard actions for new namespaces and the correct prioritization of namespace-scoped actions for obligation triggers.

🧠 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
  • service/integration/namespaces_test.go
    • Imported the actions package.
    • Added a new test case Test_CreateNamespace_SeedsStandardActions to verify that standard actions are automatically seeded for new namespaces.
  • service/integration/obligation_triggers_test.go
    • Added a new test case Test_CreateObligationTrigger_WithStandardActionName_PrefersNamespaceScopedAction to ensure that namespace-scoped actions are preferred when creating obligation triggers by action name.
  • service/policy/db/actions.sql.go
    • Introduced a new SQL query constant seedStandardActionsForNamespace.
    • Implemented the seedStandardActionsForNamespace Go function to execute the SQL query for seeding standard actions.
  • service/policy/db/namespaces.go
    • Modified the CreateNamespace function to call seedStandardActionsForNamespace after a new namespace is successfully created.
  • service/policy/db/obligations.sql.go
    • Updated the createObligationTrigger SQL query to prioritize namespace-scoped actions when an action name is provided, falling back to global actions.
  • service/policy/db/queries/actions.sql
    • Added the seedStandardActionsForNamespace SQL query definition, which inserts 'create', 'read', 'update', and 'delete' actions into the actions table with is_standard set to true, and includes ON CONFLICT handling.
  • service/policy/db/queries/obligations.sql
    • Updated the createObligationTrigger SQL query to reflect the new action resolution logic, prioritizing namespace-scoped actions.
Activity
  • gemini-code-assist[bot] provided an initial summary and changelog.
  • github-actions[bot] posted benchmark results.
  • github-actions[bot] posted an X-Test Failure Report, indicating failures in go-pull-3161, java-pull-3161, and js-pull-3161.
  • elizabethhealy requested a /gemini summary.
  • elizabethhealy requested a /gemini review.

@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 379.068333ms
Throughput 263.80 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 40.024112014s
Average Latency 398.371218ms
Throughput 124.92 requests/second

Comment thread service/policy/db/queries/obligations.sql

@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 correctly implements the seeding of standard actions upon namespace creation and adjusts obligation triggers to prioritize namespace-scoped actions. However, there is a significant atomicity issue in the CreateNamespace function, where the namespace creation and action seeding are not wrapped in a transaction, potentially leading to data inconsistency. I have also provided a suggestion to simplify a new integration test for improved readability.

Comment thread service/policy/db/namespaces.go
Comment thread service/integration/namespaces_test.go
@github-actions

Copy link
Copy Markdown
Contributor

@elizabethhealy
elizabethhealy marked this pull request as ready for review March 16, 2026 15:31
@elizabethhealy
elizabethhealy requested review from a team as code owners March 16, 2026 15:31
@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 365.460088ms
Throughput 273.63 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.207374625s
Average Latency 390.50539ms
Throughput 127.53 requests/second

@github-actions

Copy link
Copy Markdown
Contributor

@alkalescent alkalescent 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.

lgtm

@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 364.901525ms
Throughput 274.05 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.130437516s
Average Latency 389.043508ms
Throughput 127.78 requests/second

@github-actions

Copy link
Copy Markdown
Contributor

@jakedoublev

Copy link
Copy Markdown
Contributor

What is the main reason we need the standard actions that cannot be deleted (CRUD) added to a namespace instead of as universal rows? Does it make the queries significantly more compelx?

@elizabethhealy

elizabethhealy commented Mar 18, 2026

Copy link
Copy Markdown
Member Author

What is the main reason we need the standard actions that cannot be deleted (CRUD) added to a namespace instead of as universal rows? Does it make the queries significantly more compelx?

@jakedoublev if i understand correctly youre asking why are we putting a copy under eaching namespace instead of just having one copy live without a namespace and adjust the queries to handle that?

if so - i just wanted to keep the underlying logic as simple as possible, avoid branching in the code to include un-namespaced standard actions and same for the sql queries. i figured since there are a limited number of standard actions duplicating them across namespaces wouldn't be too much of a burden. so tldr trade some storage overhead for simpler and hopefully safer logic.

i think i made this decision when we were assuming policy did not cross namespaces. i think if policy were to be allowed to cross namespaces then the universal rows may make more sense? unless we still want read for one namespace to be distinct from read in another namespace, which i could possibly see being useful

lmk your thoughts

@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 384.552338ms
Throughput 260.04 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 40.852909799s
Average Latency 407.011661ms
Throughput 122.39 requests/second

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot commented Mar 23, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Namespace creation now seeds four standard actions into that namespace. Action lookup for obligation triggers was changed to prefer namespace-scoped actions when resolving by name. Integration tests were added to verify seeding and correct namespace preference when listing actions and creating triggers.

Changes

Cohort / File(s) Summary
Integration tests
service/integration/namespaces_test.go, service/integration/actions_test.go, service/integration/obligation_triggers_test.go
Added tests to verify that creating a namespace seeds standard actions, that ListActions scoped to a namespace only returns that namespace's standard actions, and that obligation trigger creation prefers namespace-scoped actions when resolving by name.
Action queries & seeding
service/policy/db/queries/actions.sql, service/policy/db/actions.sql.go
Rewrote listActions filtering to avoid leaking standard actions from other namespaces; added seedStandardActionsForNamespace :execrows and generated seedStandardActionsForNamespace Go method to insert create/read/update/delete for a namespace with conflict handling.
Namespace creation flow
service/policy/db/namespaces.go
Updated CreateNamespace to call seedStandardActionsForNamespace after namespace creation and FQN update, propagating errors if seeding fails.
Obligation trigger action resolution
service/policy/db/queries/obligations.sql, service/policy/db/obligations.sql.go
Replaced OR-based action lookup with CASE/COALESCE-based resolution: when resolving by name, prefer actions in the obligation's namespace, falling back to global (namespace_id IS NULL) actions; adjusted corresponding SQL used by createObligationTrigger.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant API as Namespace Service
    participant DB as Database

    User->>API: CreateNamespace(name)
    API->>DB: INSERT namespace record
    DB-->>API: namespace_id
    API->>DB: UPDATE namespace FQN
    DB-->>API: OK
    API->>DB: seedStandardActionsForNamespace(namespace_id)
    DB-->>API: rows affected
    API->>DB: GetNamespace(namespace_id)
    DB-->>API: Namespace + actions
    API-->>User: Namespace with seeded actions
Loading
sequenceDiagram
    actor User
    participant API as Obligation Trigger Service
    participant DB as Database

    User->>API: CreateObligationTrigger(action_name="read", obligation_id)
    API->>DB: SELECT obligation namespace (ov_id)
    DB-->>API: namespace_id
    API->>DB: Resolve action_id USING CASE:
    Note over DB: If action_id provided -> select by id\nIf action_name provided -> prefer a.namespace_id = ov.namespace_id\nElse fallback to a.namespace_id IS NULL
    DB-->>API: action_id (namespace-scoped preferred)
    API->>DB: INSERT obligation_trigger with action_id
    DB-->>API: trigger_id
    API-->>User: ObligationTrigger(created)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I planted four seeds in a namespace bed,
create, read, update, delete — each snugly spread.
When triggers call "read", they find kin first,
no lost globals, no accidental thirst.
Hop, hop — actions find their home instead.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main changes: seeding namespaces with standard actions on creation and improving action resolution for obligation triggers with namespace preference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dspx-2450-seed-namespaces-with-standard-actions

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 395.781471ms
Throughput 252.66 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.987766492s
Average Latency 398.319295ms
Throughput 125.04 requests/second

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@service/integration/namespaces_test.go`:
- Around line 95-114: The test currently checks for CRUD action names across all
returned actions; change the assertion to scope to the newly created namespace
by filtering listed.GetActionsStandard() to only include actions where
action.GetNamespace().GetId() == createdNamespace.GetId(), then assert that the
resulting set of names equals exactly {"create","read","update","delete"} (e.g.,
build a local seen map from the filtered slice and assert all four present and
no extras) so the seeded rows are verified for createdNamespace only; update the
loop that iterates over listed.GetActionsStandard() and the final assertions
accordingly.

In `@service/integration/obligation_triggers_test.go`:
- Around line 258-268: The loop that selects namespaceReadID currently picks the
first non-global "read" action but doesn't ensure it belongs to the test
namespace; update the loop that iterates over listed.GetActionsStandard() to
also require act.GetNamespace().GetId() == s.namespace.GetId() (in addition to
act.GetName() == "read" and act.GetId() != globalRead.GetId()), so
namespaceReadID is pinned to the obligation's namespace for the subsequent
assertion in the test.

In `@service/policy/db/queries/actions.sql`:
- Around line 169-176: The listActions predicate is too broad and will return
standard CRUD rows from other namespaces once seedStandardActionsForNamespace
inserts is_standard = TRUE per-namespace; update the listActions WHERE clause to
prefer actions scoped to the requested namespace (e.g., a.namespace_id = rn.id)
and only include global/legacy standard actions when that namespace does not
have an action with the same name—implement this by replacing the current "OR
a.is_standard = TRUE OR a.namespace_id = rn.id" logic with a conditional that
includes a.is_standard = TRUE only when NOT EXISTS (SELECT 1 FROM actions ax
WHERE ax.name = a.name AND ax.namespace_id = rn.id), so namespace-specific
actions win and global fallbacks are used only when missing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1828c2bd-86fa-49a9-a657-e67642579970

📥 Commits

Reviewing files that changed from the base of the PR and between a9d66ae and d649405.

📒 Files selected for processing (7)
  • service/integration/namespaces_test.go
  • service/integration/obligation_triggers_test.go
  • service/policy/db/actions.sql.go
  • service/policy/db/namespaces.go
  • service/policy/db/obligations.sql.go
  • service/policy/db/queries/actions.sql
  • service/policy/db/queries/obligations.sql

Comment thread service/integration/namespaces_test.go Outdated
Comment thread service/integration/obligation_triggers_test.go
Comment thread service/policy/db/queries/actions.sql
@github-actions

Copy link
Copy Markdown
Contributor

@elizabethhealy

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@service/integration/actions_test.go`:
- Around line 203-232: The test
Test_ListActions_WithNamespace_DoesNotLeakStandardActionsFromOtherNamespaces
uses a static namespace name in the CreateNamespace call which can cause
unique-constraint flakiness; change the Name passed to
s.db.PolicyClient.CreateNamespace (the CreateNamespace call that sets
createdNamespace) to include a unique suffix (for example append
time.Now().UnixNano() or use the existing test helper that generates unique
names) so the namespace name is unique across test runs while keeping the rest
of the test logic (list := s.db.PolicyClient.ListActions, iterating
list.GetActionsStandard(), and the expected map checks) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2d1e1146-fdbc-42a6-bb44-a99eba9e998c

📥 Commits

Reviewing files that changed from the base of the PR and between d649405 and 77ec53c.

📒 Files selected for processing (5)
  • service/integration/actions_test.go
  • service/integration/namespaces_test.go
  • service/integration/obligation_triggers_test.go
  • service/policy/db/actions.sql.go
  • service/policy/db/queries/actions.sql

Comment thread service/integration/actions_test.go
@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 388.962718ms
Throughput 257.09 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 40.521101415s
Average Latency 403.185146ms
Throughput 123.39 requests/second

@github-actions

Copy link
Copy Markdown
Contributor

Comment thread service/integration/actions_test.go
@elizabethhealy
elizabethhealy added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit 984d76b Mar 24, 2026
38 checks passed
@elizabethhealy
elizabethhealy deleted the dspx-2450-seed-namespaces-with-standard-actions branch March 24, 2026 19:22
JBCongdon pushed a commit to JBCongdon/platform that referenced this pull request May 24, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.14.0](opentdf/platform@service/v0.13.0...service/v0.14.0)
(2026-04-21)


### ⚠ BREAKING CHANGES

* **sdk:** reclassify KAS 400 errors — distinguish tamper from
misconfiguration
([opentdf#3166](opentdf#3166))
* **policy:** optional namespace for RRs
([opentdf#3165](opentdf#3165))
* **policy:** Namespace subject mappings and subject condition sets.
([opentdf#3143](opentdf#3143))
* **policy:** Optional namespace on actions protos, NamespacedPolicy
feature flag ([opentdf#3155](opentdf#3155))
* **policy:** add namespaced actions schema and namespace-aware action
queries ([opentdf#3154](opentdf#3154))
* **policy:** only require namespace on GetAction if no id provided
([opentdf#3144](opentdf#3144))
* **policy:** add namespace field to Actions proto
([opentdf#3130](opentdf#3130))
* **policy:** namespace Registered Resources
([opentdf#3111](opentdf#3111))
* **policy:** add namespace field to RegisteredResource proto
([opentdf#3110](opentdf#3110))

### Features

* **authz:** Namespaced policy in decisioning
([opentdf#3226](opentdf#3226))
([0355934](opentdf@0355934))
* **cli:** migrate otdfctl into platform monorepo
([opentdf#3205](opentdf#3205))
([5177bec](opentdf@5177bec))
* fix tracing ([opentdf#3242](opentdf#3242))
([57e5680](opentdf@57e5680))
* **policy:** add GetObligationTrigger RPC
([opentdf#3318](opentdf#3318))
([d68e39d](opentdf@d68e39d))
* **policy:** add namespace field to Actions proto
([opentdf#3130](opentdf#3130))
([bedc9b3](opentdf@bedc9b3))
* **policy:** add namespace field to RegisteredResource proto
([opentdf#3110](opentdf#3110))
([04fd85d](opentdf@04fd85d))
* **policy:** add namespaced actions schema and namespace-aware action
queries ([opentdf#3154](opentdf#3154))
([c0443f1](opentdf@c0443f1))
* **policy:** add sort ListSubjectMappings API
([opentdf#3255](opentdf#3255))
([9d5d757](opentdf@9d5d757))
* **policy:** Add sort support listregisteredresources api
([opentdf#3312](opentdf#3312))
([91a3ff3](opentdf@91a3ff3))
* **policy:** add sort support to ListAttributes API
([opentdf#3223](opentdf#3223))
([ec3312f](opentdf@ec3312f))
* **policy:** add sort support to ListKeyAccessServer
([opentdf#3287](opentdf#3287))
([7fae2d7](opentdf@7fae2d7))
* **policy:** Add sort support to ListNamespaces API
([opentdf#3192](opentdf#3192))
([aac86cd](opentdf@aac86cd))
* **policy:** add sort support to listobligations api
([opentdf#3300](opentdf#3300))
([9221cac](opentdf@9221cac))
* **policy:** add sort support to ListSubjectConditionSets API
([opentdf#3272](opentdf#3272))
([9010f12](opentdf@9010f12))
* **policy:** add SortField proto and update PageRequest for sort
support ([opentdf#3187](opentdf#3187))
([6cf1862](opentdf@6cf1862))
* **policy:** Enforce same namespace when actions referenced downstream
([opentdf#3206](opentdf#3206))
([4b5463a](opentdf@4b5463a))
* **policy:** namespace Registered Resources
([opentdf#3111](opentdf#3111))
([6db1883](opentdf@6db1883))
* **policy:** Namespace subject mappings and condition sets
([opentdf#3172](opentdf#3172))
([6deed50](opentdf@6deed50))
* **policy:** Namespace subject mappings and subject condition sets.
([opentdf#3143](opentdf#3143))
([3006780](opentdf@3006780))
* **policy:** optional namespace for RRs
([opentdf#3165](opentdf#3165))
([8948018](opentdf@8948018))
* **policy:** rollback migration strategy for namespaced actions
([opentdf#3235](opentdf#3235))
([f7e5e01](opentdf@f7e5e01))
* **policy:** Seed existing namespaces with standard actions
([opentdf#3228](opentdf#3228))
([12136b0](opentdf@12136b0))
* **policy:** Seed namespaces with standard actions on creation +
namespaced actions for obligation triggers
([opentdf#3161](opentdf#3161))
([984d76b](opentdf@984d76b))


### Bug Fixes

* **ci:** Upgrade toolchain version to 1.25.8
([opentdf#3116](opentdf#3116))
([e1b7882](opentdf@e1b7882))
* **core:** do not concat slashes directly in url/file paths
([opentdf#3290](opentdf#3290))
([114c2a7](opentdf@114c2a7))
* **deps:** bump github.com/jackc/pgx/v5 from 5.7.5 to 5.9.0 in /service
([opentdf#3316](opentdf#3316))
([017362e](opentdf@017362e))
* **deps:** bump github.com/opentdf/platform/lib/identifier from 0.2.0
to 0.3.0 in /service
([opentdf#3162](opentdf#3162))
([8bc5dcd](opentdf@8bc5dcd))
* **deps:** bump github.com/opentdf/platform/protocol/go from 0.16.0 to
0.17.0 in /service
([opentdf#3125](opentdf#3125))
([29fec61](opentdf@29fec61))
* **deps:** bump github.com/opentdf/platform/protocol/go from 0.17.0 to
0.21.0 in /service
([opentdf#3220](opentdf#3220))
([e63add2](opentdf@e63add2))
* **deps:** bump github.com/opentdf/platform/protocol/go from 0.21.0 to
0.22.0 in /service
([opentdf#3248](opentdf#3248))
([1ebce73](opentdf@1ebce73))
* **deps:** bump github.com/opentdf/platform/protocol/go from 0.22.0 to
0.23.0 in /service
([opentdf#3271](opentdf#3271))
([3338b8e](opentdf@3338b8e))
* **deps:** bump github.com/opentdf/platform/protocol/go from 0.23.0 to
0.24.0 in /service
([opentdf#3321](opentdf#3321))
([78e6022](opentdf@78e6022))
* **deps:** bump github.com/opentdf/platform/protocol/go from 0.24.0 to
0.25.0 in /service
([opentdf#3333](opentdf#3333))
([3940bf8](opentdf@3940bf8))
* **deps:** bump github.com/opentdf/platform/sdk from 0.13.0 to 0.16.0
in /service ([opentdf#3356](opentdf#3356))
([5617077](opentdf@5617077))
* **deps:** bump
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from
1.42.0 to 1.43.0 in /service
([opentdf#3282](opentdf#3282))
([046374a](opentdf@046374a))
* **deps:** bump go.opentelemetry.io/otel/sdk from 1.42.0 to 1.43.0 in
/service ([opentdf#3281](opentdf#3281))
([56b33f2](opentdf@56b33f2))
* **deps:** bump google.golang.org/grpc from 1.77.0 to 1.79.3 in
/service ([opentdf#3176](opentdf#3176))
([3289502](opentdf@3289502))
* **deps:** remove direct github.com/docker/docker dependency
([opentdf#3229](opentdf#3229))
([2becb27](opentdf@2becb27))
* **deps:** upgrade testcontainers-go to resolve vulns
([opentdf#3299](opentdf#3299))
([72c6f9b](opentdf@72c6f9b))
* **ers:** include standard JWT claims in claims mode entity resolution
([opentdf#3196](opentdf#3196))
([6d50da1](opentdf@6d50da1))
* **ers:** ldap multi-strategy ers
([opentdf#3117](opentdf#3117))
([d3aaf1a](opentdf@d3aaf1a))
* **policy:** deprecate ListAttributeValues in favor of existing
GetAttribute ([opentdf#3108](opentdf#3108))
([7e17c2d](opentdf@7e17c2d))
* **policy:** make obligation trigger uniqueness client-aware
([opentdf#3114](opentdf#3114))
([9265bc3](opentdf@9265bc3))
* **policy:** omit empty attribute values from create responses
([opentdf#3193](opentdf#3193))
([d298378](opentdf@d298378))
* **policy:** only require namespace on GetAction if no id provided
([opentdf#3144](opentdf#3144))
([10d0c0f](opentdf@10d0c0f))
* **policy:** Optional namespace on actions protos, NamespacedPolicy
feature flag ([opentdf#3155](opentdf#3155))
([c20f039](opentdf@c20f039))
* **policy:** order List* results by created_at
([opentdf#3088](opentdf#3088))
([ea90ac2](opentdf@ea90ac2))
* **sdk:** normalize issuer URL before OIDC discovery
([opentdf#3261](opentdf#3261))
([61f98c9](opentdf@61f98c9))
* **sdk:** reclassify KAS 400 errors — distinguish tamper from
misconfiguration
([opentdf#3166](opentdf#3166))
([f04a385](opentdf@f04a385))
* **sdk:** remove testcontainers from consumer dependency graph
([opentdf#3129](opentdf#3129))
([f17dcdd](opentdf@f17dcdd))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
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) size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants