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

[BREAKING] support generic API #321

Merged
merged 29 commits into from
Sep 6, 2023
Merged

Conversation

aryehlev
Copy link
Contributor

@aryehlev aryehlev commented Dec 11, 2022

No description provided.

@CLAassistant
Copy link

CLAassistant commented Dec 11, 2022

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@GRbit
Copy link

GRbit commented Mar 20, 2023

@aryehlev since there is no reaction from the repository maintainer, have you thought about updating your fork with a description with a headline like:

This is a fork of github.com/dgraph-io/ristretto but with **Magick of Generics**

I think it's an incredibly convenient feature to have a ristretto with generics, so it has the potential of getting some stars.

@mangalaman93
Copy link
Member

Thanks for getting this to our attention. I will review the PR now. Please sign the CLA when you can.

Copy link
Member

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

I think we need to figure out if we want to use pointer to K & V everywhere first. I can review the rest of the PR then. Let me know what you think. Thanks for the PR.

cache.go Outdated Show resolved Hide resolved
cache.go Outdated Show resolved Hide resolved
cache.go Outdated Show resolved Hide resolved
cache.go Outdated Show resolved Hide resolved
cache.go Show resolved Hide resolved
cache.go Outdated Show resolved Hide resolved
cache.go Outdated Show resolved Hide resolved
cache.go Outdated Show resolved Hide resolved
@GRbit
Copy link

GRbit commented Mar 20, 2023

@mangalaman93 thank you for your prompt response and the review.

@aryehlev I'm not hasting you at all, but since your PR was created a while ago, there is a chance that your situation and intentions have changed and you no longer want to spend time on this. In this case, please let us know. Maybe someone else will appear who wants to work on the PR.

@mangalaman93
Copy link
Member

@GRbit I think this is a useful PR, worth including. I am gonna slowly look at other PRs too and figure out our release plan. This would a breaking change, so it can only go into next major release etc.

In terms of whether the args should be pointers, I think you are right. They shouldn't be pointers. I got confused seeing all these nil checks in the existing code. Could you just go through the rest of my comments and ensure that we are not doing the nil checks anywhere. I can review your PR then again.

While we can get the PR ready, let me figure out a release plan too. This could take some time though, just FYI.

@aryehlev
Copy link
Contributor Author

@GRbit @mangalaman93

Hey, thank you for the comments.
I can definitely look at this and do the necessary fixes later. I think I did not use pointers for a reason.

It is definitely a major change and will only work with go 1.18 and up so I am not sure how you will want to release this.

@GRbit
Copy link

GRbit commented Mar 20, 2023

This would be a breaking change, so it can only go into the next major release etc.

It is definitely a major change and will only work with go 1.18 and up so I am not sure how you will want to release this.

Luckily it's 1.12 already, so versions could e used to solve this issue. Though, people who update their libraries as a rule of thumb update Go version as well.

This could take some time though, just FYI.

It's great to see activity here, even if it takes time. Thank you for all your time and efforts, it's really appreciated.

@mangalaman93
Copy link
Member

We have upgraded badger and dgraph to Go 1.19, we should be able to do that for ristretto too while we do the next major release. It should be fine to test the PR with the same.

cache.go Outdated Show resolved Hide resolved
cache.go Outdated Show resolved Hide resolved
cache.go Show resolved Hide resolved
@aryehlev aryehlev requested a review from harshil-goel as a code owner August 31, 2023 06:51
@mangalaman93
Copy link
Member

Let me know if you are facing any challenge resolving conflicts.

# Conflicts:
#	cache.go
#	cache_test.go
#	go.mod
#	policy.go
#	ttl.go
#	z/z.go
@aryehlev
Copy link
Contributor Author

i think i now resolved all conflicts, please go over the code if u can

Copy link
Member

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

A few more comments. I will ask more engineers to review this PR.

store.go Outdated Show resolved Hide resolved
z/z.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 changed the title feat(Generics): add generics. [BREAKING] support generic API Aug 31, 2023
z/z.go Outdated Show resolved Hide resolved
Copy link
Member

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

Hi @aryehlev, just a couple of minor comments and we are good to merge. Thanks for all the work.

policy.go Outdated Show resolved Hide resolved
mangalaman93
mangalaman93 previously approved these changes Sep 4, 2023
Copy link
Member

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

Looks good to me now! Thank you so much for all the work. I see one typo/spell error, I thought you had fixed it. Could you check that again please? I also want to get more reviews on this, let me see who is available.

store.go Outdated Show resolved Hide resolved
@GRbit
Copy link

GRbit commented Sep 4, 2023

I would like to congratulate @aryehlev on getting this PR approved and thank you both for your work! This was a long PR and it was nice to see it get this far!

@mangalaman93 mangalaman93 merged commit e2027d3 into hypermodeinc:main Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants