CLD-2059: Add catalog delete#964
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…dated within the same changeset
🦋 Changeset detectedLatest commit: cae8ad9 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The Rather than fixing the raw strings, what do you think about adding two small internal types like: type catalogOp string
const (
opAdd catalogOp = "add"
opUpsert catalogOp = "upsert"
opUpdate catalogOp = "update"
opDelete catalogOp = "delete"
)
type catalogEntity string
const (
entityAddressRef catalogEntity = "address ref"
entityChainMetadata catalogEntity = "chain metadata"
entityContractMetadata catalogEntity = "contract metadata"
entityEnvMetadata catalogEntity = "env metadata"
)
executeEdit would take op catalogOp, entity catalogEntity and compose the label internally. Calls become opAdd, entityAddressRef, typo-safe and consistently formatted across all stores. |
@giogam updated the PR but I figure that we already known all this info from the proto, therefore, I added a couple of helper function so that we automatically discover what operation and for which entity we want to execute during edits a4131c3 |
| {name: "add env metadata", req: envMetadataOp(pb.EditSemantics_SEMANTICS_INSERT), expected: "add env metadata"}, | ||
| {name: "upsert env metadata", req: envMetadataOp(pb.EditSemantics_SEMANTICS_UPSERT), expected: "upsert env metadata"}, | ||
| {name: "update env metadata", req: envMetadataOp(pb.EditSemantics_SEMANTICS_UPDATE), expected: "update env metadata"}, | ||
| {name: "delete env metadata", req: envMetadataOp(pb.EditSemantics_SEMANTICS_DELETE), expected: "delete env metadata"}, |
There was a problem hiding this comment.
this is not supported by the catalog api
|




CLD-2059: Add catalog delete
Implements catalog delete for removing data from the catalog version of the datastore.
Tested E2E locally
Adding data
Removing the same data
Restore by creating the same data will add different labels, metadata to tell the difference