-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add ability to delete traces #314
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.
❌ Changes requested. Reviewed everything up to b59910e in 1 minute and 21 seconds
More details
- Looked at
126
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_Wqk9qcu35d8Dhm41
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.
@@ -20,3 +23,28 @@ export async function GET( | |||
} | |||
}); | |||
} | |||
|
|||
export async function DELETE( |
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.
Consider adding authorization checks to ensure that the user has permission to delete the trace. This will prevent unauthorized deletions.
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.
This is handled in the middleware
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.
Okay
<Button | ||
onClick={() => { | ||
onDelete(traceId, projectId); | ||
}} | ||
> | ||
Delete Trace | ||
</Button> |
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.
We probably don't need the separate button in the trace view. I was rather thinking to implement a small overlay in the datatable view, similar to what we have in evaluations
, evaluation
, datasets
, and dataset
.
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.
Speaking of which, it would be great if you could factor out https://github.com/lmnr-ai/lmnr/blob/main/frontend/components/dataset/dataset.tsx#L220-L246 into a separate component, components/ui/DeleteSelectedRows.tsx
e.g., and re-use it across the aforementioned components and both the traces and spans tables
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.
Done
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.
We've upgraded to Next.js 15, which breaks some of the routes (now params must be awaited). Please sync the fork and merge the latest dev to your branch. Also, left a small nit comment. Otherwise, LGTM
<DeleteSelectedRows | ||
selectedRowIds={selectedRowIds} | ||
onDelete={handleDeleteEvaluations} | ||
entityName="Evaluations" |
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.
nit. Names must start with lowercase here and elsewhere
c6a279c
to
93d9ef3
Compare
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.
Great work! Looks good, I'll test this manually tomorrow and, if all works, will merge that to dev
Thank you ! I truly appreciate your time and effort |
This PR add a functionality of deleting an individual trace.
#282
Important
Add functionality to delete traces with a DELETE API endpoint and UI updates for trace deletion.
DELETE
method inroute.ts
to handle trace deletion from the database.TraceView
component intrace-view.tsx
.handleDeleteTrace
function intraces.tsx
to call DELETE API and update UI.This description was created by for b59910e. It will automatically update as commits are pushed.