-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(agents-api): Add route tests #451
Conversation
Signed-off-by: Diwank Tomer <diwank@julep.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to afe3be8 in 30 seconds
More details
- Looked at
1519
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_UFngILdBdb2AIblW
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -32,7 +32,12 @@ | |||
temporal_task_queue = env.str("TEMPORAL_TASK_QUEUE", default="memory-task-queue") | |||
|
|||
# auth | |||
api_key: str = env.str("AGENTS_API_KEY") | |||
_random_generated_key = "".join(str(random.randint(0, 9)) for _ in range(32)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a randomly generated API key as a fallback is potentially insecure and could lead to unpredictable behavior. Consider requiring the API key to be set explicitly and fail initialization if it's not provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on dd52045 in 27 seconds
More details
- Looked at
173
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. agents-api/tests/test_user_routes.py:1
- Draft comment:
This file seems unrelated to the agents API as described in the PR title and description. Please confirm if this file was intended to be part of this PR. - Reason this comment was not posted:
Confidence of 0% on close inspection, compared to threshold of 50%.
Workflow ID: wflow_af6B2ueAAUsVvuKI
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Signed-off-by: Diwank Tomer <diwank@julep.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on d0b3e6b in 45 seconds
More details
- Looked at
235
lines of code in11
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_NiCph8MFML8BsyWa
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -27,4 +27,4 @@ async def create_or_update_agent( | |||
data=data, | |||
) | |||
|
|||
return ResourceCreatedResponse(id=agent.id, created_at=agent.created_at) | |||
return ResourceCreatedResponse(id=agent.id, created_at=agent.created_at, jobs=[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jobs
field in the ResourceCreatedResponse
is always set to an empty list, which might not reflect the actual state of jobs associated with the agent. Consider modifying the response to include actual job data if applicable.
return ResourceCreatedResponse(id=agent.id, created_at=agent.created_at, jobs=[]) | |
return ResourceCreatedResponse(id=agent.id, created_at=agent.created_at, jobs=agent.jobs) |
@@ -20,4 +20,4 @@ async def create_user( | |||
data=data, | |||
) | |||
|
|||
return ResourceCreatedResponse(id=user.id, created_at=user.created_at) | |||
return ResourceCreatedResponse(id=user.id, created_at=user.created_at, jobs=[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jobs
field in the ResourceCreatedResponse
is always set to an empty list, which might not reflect the actual state of jobs associated with the user. Consider modifying the response to include actual job data if applicable.
return ResourceCreatedResponse(id=user.id, created_at=user.created_at, jobs=[]) | |
return ResourceCreatedResponse(id=user.id, created_at=user.created_at, jobs=user.jobs) |
@@ -14,4 +14,5 @@ | |||
async def delete_user( | |||
user_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)] | |||
) -> ResourceDeletedResponse: | |||
print(user_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of print
for logging in production code is not recommended as it can lead to unintentional logging of sensitive information. Consider using a logging framework with appropriate log levels.
0ee50d4
into
dev-tasks-disable-routes
Signed-off-by: Diwank Tomer diwank@julep.ai
Summary:
This PR adds comprehensive route tests for agents and users, updates client management, and modifies API key handling for improved test coverage and client management.
Key points:
agents-api/tests
.get_cozo_client
inagents_api/clients/cozo.py
.agents_api/env.py
to generate a random key if not set.create_agent
function to includejobs
in response.julep
clients withfastapi.testclient.TestClient
in tests.ward
for test definitions andmake_request
for HTTP requests.Generated with ❤️ by ellipsis.dev