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

Implemented a Delete functionality for KeyValue #2033

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nathannaveen
Copy link
Contributor

Description of the PR

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If GraphQL schema is changed, GraphQL client updates/additions have been made
  • If OpenAPI spec is changed, make generate has been run
  • If ent schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

@nathannaveen nathannaveen force-pushed the nathan/implementDeleteForKeyValue branch from 5beeb63 to c8b6ae5 Compare July 17, 2024 16:13
@pxp928 pxp928 requested a review from jeffmendoza July 19, 2024 16:08
@nathannaveen nathannaveen requested a review from pxp928 July 19, 2024 20:20
pkg/assembler/backends/keyvalue/path.go Show resolved Hide resolved
}

// Update the entity in the KeyValue store
return c.kv.Set(ctx, col, id, newLinks)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't correct. It is replacing the vuln and package structs/nodes with a string array. You need to get / modify / and set those structs. Should probably use the setkv() helper (https:/guacsec/guac/blob/main/pkg/assembler/backends/keyvalue/backend.go#L248)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for this review! This review made me think deeply, and I realized that I was setting the key value wrong, so I have fixed that, as well as modifying the structs and not replacing them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is still not right and doing the same thing.

@nathannaveen nathannaveen force-pushed the nathan/implementDeleteForKeyValue branch 2 times, most recently from c5f0927 to 2980fe7 Compare August 12, 2024 19:58
@nathannaveen
Copy link
Contributor Author

After some thought, I realize that the code is going to require a lot of changes. So I am going to be converting this to a draft PR.

This is mainly because of a deep dive into the comment #2033 (comment) by @jeffmendoza.

@nathannaveen nathannaveen marked this pull request as draft August 12, 2024 20:47
@nathannaveen nathannaveen marked this pull request as ready for review August 13, 2024 18:11
@nathannaveen nathannaveen force-pushed the nathan/implementDeleteForKeyValue branch from 8708cb0 to 6c01d0c Compare August 13, 2024 18:15
@pxp928
Copy link
Collaborator

pxp928 commented Oct 11, 2024

@nathannaveen this needs a rebase

Signed-off-by: nathannaveen <[email protected]>
Signed-off-by: nathannaveen <[email protected]>
Signed-off-by: nathannaveen <[email protected]>
Signed-off-by: nathannaveen <[email protected]>
Signed-off-by: nathannaveen <[email protected]>
@nathannaveen nathannaveen force-pushed the nathan/implementDeleteForKeyValue branch from 6c01d0c to e8c024f Compare October 11, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] KeyValue add delete node functionality
4 participants