Skip to content

Conversation

migmartri
Copy link
Member

Soft delete CAS backends with confirmation in the client side if it's the default one.

Refs #223

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri requested a review from danlishka July 14, 2023 09:36
}

// Delete the CAS backend
func (s *CASBackendService) Delete(ctx context.Context, req *pb.CASBackendServiceDeleteRequest) (*pb.CASBackendServiceDeleteResponse, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we then call it soft delete or archive? I am not sure I am following. We give an option to the end user to delete but we soft delete instead. Why don't we call it properly? Am I missing anything?

Copy link
Member Author

@migmartri migmartri Jul 14, 2023

Choose a reason for hiding this comment

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

To me, soft-deletion is an implementation detail of the system. The fact that it does not remove it from the DB is not something that the user should know about, unless we plan to offer a recovery mechanism.

The reason we do not want to hard delete is because in the future we might need that data to get historical information on where an artifact was placed.

WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

ok. It means that once we delete we are not allowing them to download evidences via cli, but attestations visible in workflow runs and maybe you can see references to the deleted backend so you know where to find the a given material?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok. It means that once we delete we are not allowing them to download evidences via cli, but attestations visible in workflow runs and maybe you can see references to the deleted backend so you know where to find the a given material?

for now yes, but the idea would be that once an user knows an artifact digest, these scenarios could happen:

the artifact with that digest...

1 - is in the default CAS backend
2 - is in a non-default CAS backend
3 - is in a (soft) deleted CAS backend
4 - is in one of the above but credentials are wrong
5 - none of the above

Today, we only support the first option. 2 and 3) will be implemented with a combination of a) digest <-> backend mapping + b) soft-deleted cas backend retrieval.

Copy link
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

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

LGTM for now. Thanks for providing more information

@migmartri migmartri merged commit 2cba9e0 into chainloop-dev:main Jul 14, 2023
@migmartri migmartri deleted the soft-deletion branch July 14, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants