-
Notifications
You must be signed in to change notification settings - Fork 75
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
api for uploading spans #302
Conversation
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! Reviewed everything up to 4db0162 in 54 seconds
More details
- Looked at
195
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. app-server/src/api/v1/queues.rs:72
- Draft comment:
Usingunwrap
onserde_json::to_value
can cause a panic if serialization fails. Consider handling this error gracefully. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
For TraceType::EVENT, this is an enum value which should always be serializable - there's no realistic way this serialization could fail. The unwrap() here is actually fine since we have strong guarantees about the input. While technically the comment is correct that unwrap() can panic, in this specific case the risk is theoretical rather than practical.
I could be wrong about the enum serialization guarantees - there could be custom serialization implementations that could fail. Also, this establishes a pattern that could be problematic if copied elsewhere.
Even with custom serialization, basic enum variants should always be serializable. The pattern concern is valid but should be raised as a broader architectural discussion rather than a PR comment.
This comment should be removed as the unwrap() usage here is actually safe given the input is a simple enum variant that cannot fail to serialize.
2. app-server/src/api/v1/queues.rs:81
- Draft comment:
Usingunwrap
onserde_json::to_value
can cause a panic if serialization fails. Consider handling this error gracefully. - Reason this comment was not posted:
Marked as duplicate.
3. app-server/src/api/v1/queues.rs:104
- Draft comment:
span_id
is of typeUuid
which implementsCopy
, soclone()
is unnecessary. You can use*span_id
instead. - Reason this comment was not posted:
Confidence changes required:50%
The use ofclone
onspan_id
in themap
function is unnecessary sinceUuid
isCopy
.
4. frontend/app/api/projects/[projectId]/queues/[queueId]/remove/route.ts:33
- Draft comment:
Good use ofnonempty()
to ensureaddedLabels
is not empty. - Reason this comment was not posted:
Confidence changes required:0%
Thenonempty()
method ensures that the array is not empty, which is a good validation step.
5. frontend/app/api/projects/[projectId]/queues/[queueId]/remove/route.ts:73
- Draft comment:
Good use of optional chaining withaction?.resultId
to safely accessresultId
. - Reason this comment was not posted:
Confidence changes required:0%
The optional chaining operator is used correctly to safely access properties ofaction
.
6. frontend/app/api/projects/[projectId]/queues/[queueId]/remove/route.ts:122
- Draft comment:
Good use of optional chaining withaction?.datasetId
to safely accessdatasetId
. - Reason this comment was not posted:
Confidence changes required:0%
The optional chaining operator is used correctly to safely access properties ofaction
.
Workflow ID: wflow_y21Plam4uXedb3YU
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
app-server/src/api/v1/queues.rs
Outdated
} | ||
|
||
#[post("/queues/upload")] | ||
async fn upload_to_queue( |
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.
minor nit, but I would say push is more fitting than upload
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 b5d08f7 in 38 seconds
More details
- Looked at
52
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. frontend/app/api/projects/[projectId]/queues/[queueId]/remove/route.ts:68
- Draft comment:
Consider using parameterized queries or a safer method for SQL string interpolation to prevent potential SQL injection vulnerabilities. - Reason this comment was not posted:
Comment was on unchanged code.
2. frontend/app/api/projects/[projectId]/queues/[queueId]/remove/route.ts:75
- Draft comment:
Add null checks foraction
before accessing its properties to prevent potential runtime errors. This applies to other instances whereaction
is accessed without checks. - Reason this comment was not posted:
Comment was on unchanged code.
3. frontend/app/api/projects/[projectId]/queues/route.ts:15
- Draft comment:
Consider adding validation for thename
field to ensure it is present and valid before proceeding with the database operation. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_SomIx4GX9J6Qci4Z
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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 10621ee in 14 seconds
More details
- Looked at
29
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. app-server/src/api/v1/queues.rs:44
- Draft comment:
The endpoint has been changed from/queues/upload
to/queues/push
, but the PR description still mentions/queues/upload
. Please update the description for consistency. - Reason this comment was not posted:
Confidence changes required:50%
The PR changes the endpoint from/queues/upload
to/queues/push
, but the description still mentions/queues/upload
. This inconsistency should be addressed.
2. app-server/src/main.rs:431
- Draft comment:
The function name has been changed fromupload_to_queue
topush_to_queue
, but the PR description still mentionsupload_to_queue
. Please update the description for consistency. - Reason this comment was not posted:
Confidence changes required:50%
The PR changes the function name fromupload_to_queue
topush_to_queue
, but the description still mentionsupload_to_queue
. This inconsistency should be addressed.
Workflow ID: wflow_2JCzAcPFFH7f35BT
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
app-server/src/api/v1/queues.rs
Outdated
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
struct UploadItem { |
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.
should rename here and below too
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 2e20af5 in 18 seconds
More details
- Looked at
32
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. app-server/src/api/v1/queues.rs:24
- Draft comment:
RenamingUploadItem
toPushItem
is consistent with the new endpoint namepush_to_queue
. This aligns with the intent of the PR. - Reason this comment was not posted:
Confidence changes required:0%
The renaming of structs fromUploadItem
toPushItem
andUploadToQueueRequest
toPushToQueueRequest
is consistent with the new endpoint namepush_to_queue
. This change is logical and aligns with the intent of the PR.
2. app-server/src/api/v1/queues.rs:40
- Draft comment:
RenamingUploadToQueueRequest
toPushToQueueRequest
is consistent with the new endpoint namepush_to_queue
. This aligns with the intent of the PR. - Reason this comment was not posted:
Confidence changes required:0%
The renaming of structs fromUploadItem
toPushItem
andUploadToQueueRequest
toPushToQueueRequest
is consistent with the new endpoint namepush_to_queue
. This change is logical and aligns with the intent of the PR.
Workflow ID: wflow_6w20SKJRlCoUnp60
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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 c0984e4 in 1 minute and 17 seconds
More details
- Looked at
41
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_0hngwbrtckcHuPC3
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Adds an API endpoint for uploading spans to a queue, updates server configuration, and modifies TypeScript route handling for optional fields.
push_to_queue
function inqueues.rs
to handle POST requests to/queues/push
.PushItem
andPushToQueueRequest
structs for deserializing request data.push_to_queue
service inmain.rs
under the/v1
scope.remove/route.ts
to handle optionalaction
fields with null checks.This description was created by for c0984e4. It will automatically update as commits are pushed.