Skip to content

Fix RBAC query performance in ArangoDB#1268

Open
tomchop wants to merge 9 commits intomainfrom
fix-rbac-performance-7128753377011748572
Open

Fix RBAC query performance in ArangoDB#1268
tomchop wants to merge 9 commits intomainfrom
fix-rbac-performance-7128753377011748572

Conversation

@tomchop
Copy link
Copy Markdown
Collaborator

@tomchop tomchop commented Mar 25, 2026

Fix RBAC related performance issues by modifying the ArangoDB query in core/database_arango.py to filter the data sooner, reducing the number of elements processed by subsequent statements.


PR created automatically by Jules for task 7128753377011748572 started by @tomchop

Reorder statements in ArangoDB AQL query to apply filters before computationally expensive operations like counting and graph queries.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 8 commits March 25, 2026 15:31
Add `neighbor_acl_filter` to `graph_query_string` to ensure that ACL rules are enforced on linked objects fetched during graph traversals. Also added a unit test to verify that linked object ACLs are respected.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
The CI was failing because `entities[0]` might not have a `links` attribute if the query filters out the links completely, so trying to call `len(entities[0].links)` caused an `AttributeError`. The `ruff format` also caused a CI failure which has been corrected.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
Removed `test_extra.py` that was created during manual testing and caused `ruff` linting checks to fail in CI.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
…espects_acls

The test was failing because the link created was `observable1 -> entity1`, but the query was searching for `outbound` links from `entity1` which would naturally be empty. Updated the query to search for `inbound` links instead.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
Removed `test_extra.py` which was accidentally created and caused `ruff` checks to fail on the previous run.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
Use `LET neighbor_acl = FIRST(...) OR false \n FILTER neighbor_acl` in `neighbor_acl_filter` to ensure correct AQL syntax. Change test `graph_queries` field to `"name|value"` so observables (which use `value`) are properly keyed in the result instead of being dropped or yielding a `"null"` key.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
Removed `test_extra.py` and `run_test.py` that were created during manual testing and caused `ruff` linting checks to fail in CI.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
Splits the combined boolean assertion into more specific ones (`hasattr`, `assertIsInstance`, `assertEqual(len, 1)`, and `assertIn` contents) to clarify the exact behavior under test.

Co-authored-by: tomchop <1257972+tomchop@users.noreply.github.com>
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.

1 participant