Skip to content

Commit

Permalink
Add production queries tool to product tools
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtsuk committed Jul 4, 2023
1 parent 9d7a21b commit 6e80d2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion snuba/admin/auth_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class InteractToolAction(ToolAction):
"snql-to-sql": ToolResource("snql-to-sql"),
"tracing": ToolResource("tracing"),
"cardinality-analyzer": ToolResource("cardinality-analyzer"),
"production-queries": ToolResource("production-queries"),
"all": ToolResource("all"),
}

Expand Down Expand Up @@ -150,7 +151,11 @@ def generate_tool_test_role(tool: str) -> Role:
name="product-tools",
actions={
InteractToolAction(
[TOOL_RESOURCES["snql-to-sql"], TOOL_RESOURCES["tracing"]]
[
TOOL_RESOURCES["snql-to-sql"],
TOOL_RESOURCES["tracing"],
TOOL_RESOURCES["production-queries"],
]
)
},
),
Expand Down
1 change: 1 addition & 0 deletions tests/admin/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ def test_product_tools_role(
assert len(data["tools"]) > 0
assert "snql-to-sql" in data["tools"]
assert "tracing" in data["tools"]
assert "production-queries" in data["tools"]
assert "all" not in data["tools"]

0 comments on commit 6e80d2a

Please sign in to comment.