Skip to content
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

Soft delete support #471

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Soft delete support #471

merged 1 commit into from
Oct 21, 2024

Conversation

csansoon
Copy link
Contributor

@csansoon csansoon commented Oct 21, 2024

PR is about 300-400 LOC, not over 3k... You know the deal with Drizzle.

Added soft delete on drafts, evaluations and providerApiKeys. Soft-deleted rows, or data related to soft-deleted rows (like document logs from removed commits, or evaluation results from removed evaluations) will not be available from the respective repositories. Deleted logs and results are taken into account when calculating workspace usage though.

Additionally, "deleting" a providerApiKey will censor the token forever. This means that data can still be aggregated with this provider, it cannot be used to generate new logs.

@csansoon csansoon added the 🚧 wip Work in progress label Oct 21, 2024
@csansoon csansoon linked an issue Oct 21, 2024 that may be closed by this pull request
@csansoon csansoon force-pushed the soft-delete branch 4 times, most recently from 94a576f to 803fa61 Compare October 21, 2024 14:20
@csansoon csansoon removed the 🚧 wip Work in progress label Oct 21, 2024
@csansoon csansoon marked this pull request as ready for review October 21, 2024 14:20
Comment on lines -28 to +39
return evaluations.map((p) => ({
label: p.name,
href: segments[1]
? ROUTES.evaluations.detail({ uuid: p.uuid })[
segments[1] as EvaluationRoutes
].root
: ROUTES.evaluations.detail({ uuid: p.uuid }).root,
}))
return evaluations.map((p) => {
const baseRoute = ROUTES.evaluations.detail({ uuid: p.uuid })
const href = evaluationSegment
? (baseRoute[evaluationSegment]?.root ?? baseRoute.root)
: baseRoute.root

return {
label: p.name,
href,
}
})
Copy link
Contributor Author

@csansoon csansoon Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a bug where the Breadcrumb component failed on /evaluations/<uuid>/destroy

Copy link
Contributor

@andresgutgon andresgutgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test for checking in the repository only not soft deleted models are return.

@csansoon
Copy link
Contributor Author

csansoon commented Oct 21, 2024

@andresgutgon That's tested in the destroy/delete service for each model

andresgutgon
andresgutgon previously approved these changes Oct 21, 2024
Copy link
Contributor

@andresgutgon andresgutgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok got it

geclos
geclos previously approved these changes Oct 21, 2024
Copy link
Collaborator

@geclos geclos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful

@csansoon csansoon merged commit da754bc into main Oct 21, 2024
3 checks passed
@csansoon csansoon deleted the soft-delete branch October 21, 2024 15:19
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Implement soft delete across the board
3 participants