Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Add directory soft delete #52

Merged
merged 3 commits into from
Jan 24, 2023
Merged

Conversation

mikemrm
Copy link
Contributor

@mikemrm mikemrm commented Jan 19, 2023

Implements soft deletions for directories.
Deleting a parent directory also deletes all child directories.

Closes #9

DirectoryID's returned from the API were being presented as a byte array
rather than a uuid string.

This corrects marshal and unmarshalling of DirectoryID's.

Signed-off-by: Mike Mason <mimason@equinix.com>
@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Merging #52 (3817fc8) into main (0509c83) will decrease coverage by 0.60%.
The diff coverage is 89.05%.

@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   94.16%   93.56%   -0.60%     
==========================================
  Files           7        7              
  Lines         668      793     +125     
==========================================
+ Hits          629      742     +113     
- Misses         31       40       +9     
- Partials        8       11       +3     
Flag Coverage Δ
unittests 93.56% <89.05%> (-0.60%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/httpsrv/treemanager/treemanager.go 90.56% <79.41%> (-1.65%) ⬇️
storage/crdb/driver/driver.go 92.03% <88.46%> (+0.09%) ⬆️
tests/integration/common.go 99.10% <96.07%> (-0.90%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@JAORMX
Copy link
Contributor

JAORMX commented Jan 19, 2023

Let's keep high test coverage

@mikemrm mikemrm force-pushed the add-soft-delete branch 6 times, most recently from a983768 to d4417f8 Compare January 23, 2023 18:43
Implements soft deletions for directories.
Deleting a parent directory also deletes all child directories.

Signed-off-by: Mike Mason <mimason@equinix.com>
@mikemrm mikemrm marked this pull request as ready for review January 23, 2023 19:10
@mikemrm mikemrm requested a review from a team as a code owner January 23, 2023 19:10
Copy link
Contributor

@JAORMX JAORMX left a comment

Choose a reason for hiding this comment

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

Very nice! Thanks for working on this!

Can you add the openapi specification for the delete call in https://github.com/infratographer/fertilesoil/blob/main/treeman-openapi-v1.yaml ? It's currently marked as a TODO.

Also, now that get/list of directories (and root ones) does not return deleted entries, can you create a GH issue about this? We should allow an admin to list deleted entries with a query parameter or something of the sort (we'd deny this functionality to normal users).

cc @pereztr5 can you review this as well?

Signed-off-by: Mike Mason <mimason@equinix.com>
@mikemrm mikemrm requested a review from JAORMX January 24, 2023 12:57
@mikemrm
Copy link
Contributor Author

mikemrm commented Jan 24, 2023

I've updated the spec, and created #55

@JAORMX JAORMX merged commit 1e95ad3 into infratographer:main Jan 24, 2023
@mikemrm mikemrm deleted the add-soft-delete branch January 24, 2023 14:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement soft deletes
2 participants