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

Generics migration #231

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Generics migration #231

merged 2 commits into from
Jan 4, 2024

Conversation

PapaCharlie
Copy link
Collaborator

This attempts to migrate this library in the least invasive way by preserving as much of the original API as possible. It does not change the tests in a meaningful way nor does it attempt to upgrade any logic that can be simplified or improved with generics. This is purely an API migration, and still requires a lot of additional work to be fully ready.

This attempts to migrate this library in the least invasive way by preserving as
much of the original API as possible. It does not change the tests in a
meaningful way nor does it attempt to upgrade any logic that can be simplified
or improved with generics. This is purely an API migration, and still requires a
lot of additional work to be fully ready.
@emirpasic
Copy link
Owner

Impressive effort!

@PapaCharlie
Copy link
Collaborator Author

Thanks! I'm still working on it, and I can happily break it up into multiple PRs to make this easier to review but the bulk of it is there :)

Any initial thoughts?

@emirpasic
Copy link
Owner

The changes are a bit tricky to isolate to separate PRs, so I believe it's easier for both of us doing it in bulk - we can count on the tests in the end that things work as expected.

@emirpasic
Copy link
Owner

On another note, do you have suggestions on how to solve for versioning, so we don't break it for people using the old non-generic version? This is something that concerned me in the past and I have not found an elegant solution for it.

@PapaCharlie
Copy link
Collaborator Author

I do yeah. There was a conversation about this in #179 and I think the move is simply to mint a V2 version of this codebase, instead of trying to maintain multiple versions of these data structures in different directories. If some sort of critical fix is needed for the non-generic versions of these, a v1 version can always be minted again

@sonarcloud
Copy link

sonarcloud bot commented Oct 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@emirpasic
Copy link
Owner

@PapaCharlie much appreciation for your effort. So regarding the versioning to do something like this: #179 (comment)

I've added you as a collaborator here so you should have access to work directly on the repo.

@PapaCharlie
Copy link
Collaborator Author

Yeah basically we can kick the non-generic implementation to a v1 branch and keep it around if we need to fix it, but the default branch should be the v2/generics branch

@PapaCharlie
Copy link
Collaborator Author

Btw, like I mentioned in the PR description, this change doesn't actually change the API. As a follow up for I guess a v3 we should align with this proposal: golang/go#61405 and consolidate all the implementations of Any, All, Find etc

@PapaCharlie
Copy link
Collaborator Author

Btw, thanks for making a collaborator! Was your intent to let me check this in as-is and let me work on it further? Or did you still intend to review it?

@emirpasic
Copy link
Owner

Let me also take a look over the weekend at this one more time to create the branches v1 and v2, and v2 would be pushed to master, right?
I'll probably need to write some documentation on the readme, and a "preemptive apology" for those whose projects we break :D

Great job indeed, but just give me until Sunday to review and then merge if that is ok.

@emirpasic emirpasic mentioned this pull request Oct 25, 2023
@PapaCharlie
Copy link
Collaborator Author

PapaCharlie commented Oct 26, 2023

Please, take your time! I just wasn't sure what your plan was.

As for the strategy for v1/v2, we can actually just check this in as-is after I update the go.mod file to have the /v2 suffix. We can cut a v1 branch for the current HEAD, for convenience down the line, but it's not actually necessary here, everything can stay on master.

I'll probably need to write some documentation on the readme, and a "preemptive apology" for those whose projects we break :D

Let me know if I can help with that at all! I think having a migration guide is also in order? I can write up that part

@vkstack
Copy link

vkstack commented Nov 20, 2023

waiting for this merge.

@PapaCharlie
Copy link
Collaborator Author

Hey @emirpasic, have you had a chance to take a look at this?

@PapaCharlie PapaCharlie merged commit 6708ddd into emirpasic:master Jan 4, 2024
4 checks passed
@PapaCharlie
Copy link
Collaborator Author

Oops!! My mistake, accidentally merged this...

@PapaCharlie
Copy link
Collaborator Author

I reverted the merge, reopening the PR

@emirpasic
Copy link
Owner

No I think it is fine to merge @PapaCharlie . I have been away for a few month due to personal things... I believe this is good enough, so feel free to merge.

@PapaCharlie
Copy link
Collaborator Author

Alright! Sounds good. No worries, hope everything's alright. I will be working on further changes (especially to testing, which is very repeated) to this in the near future. In the meantime, I'll release this as v2.0.0-alpha

@djohnson-engineer
Copy link

@PapaCharlie Thank you for your work on this. Are there any plans to create a new release that includes generics?

The latest release at this time does not include these generic changes.

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.

4 participants