Add namespace creation/deletion to graphql#2608
Open
louisch wants to merge 7 commits into
Open
Conversation
1123952 to
accca35
Compare
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: 61acc5b | Previous: 9823ef7 | Ratio |
|---|---|---|---|
lotr_graph/num_edges |
5 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
lotr_graph/num_nodes |
5 ns/iter (± 0) |
1 ns/iter (± 0) |
5 |
lotr_graph/has_node_nonexisting |
5 ns/iter (± 0) |
2 ns/iter (± 0) |
2.50 |
lotr_graph/iterate_exploded_edges |
575941 ns/iter (± 4422) |
285473 ns/iter (± 2920) |
2.02 |
lotr_graph/graph_latest |
3 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
lotr_graph_materialise/materialize |
7709965 ns/iter (± 154090) |
1564816 ns/iter (± 35303) |
4.93 |
lotr_graph_window_100/num_nodes |
13 ns/iter (± 0) |
5 ns/iter (± 0) |
2.60 |
lotr_graph_window_100/iterate_exploded_edges |
796839 ns/iter (± 3964) |
325242 ns/iter (± 847) |
2.45 |
lotr_graph_window_100_materialise/materialize |
8104392 ns/iter (± 224547) |
1669150 ns/iter (± 10700) |
4.86 |
lotr_graph_window_10/has_node_existing |
145 ns/iter (± 7) |
62 ns/iter (± 11) |
2.34 |
lotr_graph_window_10/iterate nodes |
32735 ns/iter (± 434) |
11339 ns/iter (± 40) |
2.89 |
lotr_graph_window_10/iterate edges |
102401 ns/iter (± 267) |
48684 ns/iter (± 211) |
2.10 |
lotr_graph_window_10/iterate_exploded_edges |
399068 ns/iter (± 1598) |
155788 ns/iter (± 1001) |
2.56 |
lotr_graph_window_10_materialise/materialize |
3599684 ns/iter (± 52598) |
971980 ns/iter (± 4278) |
3.70 |
lotr_graph_subgraph_10pc/has_node_nonexisting |
5 ns/iter (± 0) |
2 ns/iter (± 0) |
2.50 |
lotr_graph_subgraph_10pc_materialise/materialize |
1694536 ns/iter (± 28278) |
334634 ns/iter (± 1287) |
5.06 |
lotr_graph_subgraph_10pc_windowed/has_node_existing |
152 ns/iter (± 8) |
62 ns/iter (± 14) |
2.45 |
lotr_graph_subgraph_10pc_windowed/iterate nodes |
5509 ns/iter (± 110) |
1365 ns/iter (± 3) |
4.04 |
lotr_graph_subgraph_10pc_windowed_materialise/materialize |
1048609 ns/iter (± 15942) |
230399 ns/iter (± 2617) |
4.55 |
lotr_graph_window_50_layered/num_edges_temporal |
150359 ns/iter (± 2518) |
70121 ns/iter (± 7586) |
2.14 |
lotr_graph_window_50_layered/has_node_existing |
444 ns/iter (± 18) |
129 ns/iter (± 12) |
3.44 |
lotr_graph_window_50_layered/has_node_nonexisting |
5 ns/iter (± 0) |
2 ns/iter (± 0) |
2.50 |
lotr_graph_window_50_layered/iterate nodes |
75952 ns/iter (± 175) |
19308 ns/iter (± 47) |
3.93 |
lotr_graph_window_50_layered/iterate edges |
196957 ns/iter (± 686) |
83616 ns/iter (± 1318) |
2.36 |
lotr_graph_window_50_layered/graph_latest |
78683 ns/iter (± 2061) |
36649 ns/iter (± 916) |
2.15 |
lotr_graph_window_50_layered_materialise/materialize |
33644703 ns/iter (± 709338) |
3488825 ns/iter (± 24948) |
9.64 |
lotr_graph_persistent_window_50_layered/num_edges_temporal |
614151 ns/iter (± 32176) |
192686 ns/iter (± 1569) |
3.19 |
lotr_graph_persistent_window_50_layered/has_node_existing |
479 ns/iter (± 311) |
174 ns/iter (± 83) |
2.75 |
lotr_graph_persistent_window_50_layered/has_node_nonexisting |
5 ns/iter (± 0) |
2 ns/iter (± 0) |
2.50 |
lotr_graph_persistent_window_50_layered/iterate nodes |
98049 ns/iter (± 218) |
35886 ns/iter (± 191) |
2.73 |
lotr_graph_persistent_window_50_layered/iterate edges |
174096 ns/iter (± 433) |
84161 ns/iter (± 596) |
2.07 |
lotr_graph_persistent_window_50_layered/iterate_exploded_edges |
4275799 ns/iter (± 73670) |
1659940 ns/iter (± 19402) |
2.58 |
lotr_graph_persistent_window_50_layered/graph_latest |
116225 ns/iter (± 5702) |
57549 ns/iter (± 4809) |
2.02 |
lotr_graph_persistent_window_50_layered_materialise/materialize |
58399648 ns/iter (± 2369519) |
5298035 ns/iter (± 147912) |
11.02 |
lotr_graph/proto_decode |
3827493 ns/iter (± 548545) |
1893824 ns/iter (± 69415) |
2.02 |
lotr_graph/proto_encode |
9597066 ns/iter (± 594554) |
1157897 ns/iter (± 73709) |
8.29 |
This comment was automatically generated by workflow using github-action-benchmark.
Add TestSetup struct, setup_with_graphs, run_mutation, and assert_is_namespace_dir helpers to mod graphql_test in raphtory-graphql/src/lib.rs for use by namespace tests in later tasks. Previously called validate_path_for_insert which created a graph-folder skeleton + dirty marker on disk and leaked them, so the new namespace appeared as a MetaGraph. Now uses validate_path_for_namespace_create plus fs::create_dir_all. test: createNamespace creates nested directories test: createNamespace rejects path of existing graph test: createNamespace rejects path of existing namespace test: createNamespace rejects invalid paths test: tighten createNamespace existing-namespace error check test: add FakePolicy and setup_with_policy helpers test: createNamespace denied without parent write test: tighten FakePolicy docs and silence dead-code warning test: deleteNamespace removes empty namespace test: deleteNamespace removes namespace with children test: deleteNamespace rejects empty path test: deleteNamespace rejects non-existent path test: deleteNamespace denied when descendant graph unwritable test: deleteNamespace invalidates cached graphs test: clarify deleteNamespace denied-test comments feat(graphql): deleteNamespace infrastructure - auth.rs: add is_exclusive_write so deleteNamespace acquires the exclusive write lock alongside updateGraph - namespace.rs: expose current_dir() and relative_path() accessors used by Mut::delete_namespace and the data layer
accca35 to
6f8a5bf
Compare
shivamka1
requested changes
May 15, 2026
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Adding (empty) namespace creation and namespace deletion (with all children) as APIs to the GraphQL APIs
Why are the changes needed?
I'd like to have the ability to delete namespaces via the raphtory API rather than using OS-level functions to delete the folders. Especially also because the cache needs to be handled correctly to avoid error messages appearing on the raphtory side.
Namespace deletion particularly feels like something that ought to exist in the API, otherwise it is possible to create namespaces via the current APIs but deleting them isn't possible (deleting the graphs is, but not their namespaces). Empty namespace creation was mostly just because it seems awkward having to use the graph creation APIs to indirectly create namespaces.
Does this PR introduce any user-facing change? If yes is this documented?
Yes, two new API functions. Both are commented.
How was this patch tested?
New tests were added testing the two new endpoints in various scenarios
Are there any further changes required?
This increases the surface of the graphql API so if any changes to RBAC happen then those will need to be applied to these two new functions too