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
Compatibility with API v3 and v4 #241
Comments
I worry about how ugly this could get as the API versions further diverge. |
True, I'm not sure how this would best be handled to prevent a complete mess of technical debt. Maybe remove the v3 endpoints after official support for 8.x is dropped with the release of 9.3? |
Do you know when that will be? I've been holding off the 4.0.0 release until we figure something out here. Being that my time is pretty limited I'm not sure I could commit to supporting both v3 and v4, so a hard cut doesn't sound like a bad idea. |
9.0 is currently scheduled for February 2017, might end up being later than that but definitely no earlier. |
That's a little far out to hold off version 4 of this gem. Any more thoughts on supporting both versions? Inheritance keeps popping into my head but the idea of duplicating every module under lib/gitlab/client also bothers me. What if instead
Then
I guess the best way not to duplicate the same route in both files would be to load them in alphabetical order until you hit the correct version, so that routes defined in v4.yml could override the same in v3.yml. Thinking down the road a bit we would probably need to trigger a reload of the files if someone changes their api version (via There's probably a better implementation than the one I just outlined, but I think the overall idea might be the cleanest and simplest to implement. Thoughts? @connorshea, @jvanbaarsen, or anyone else with an opinion or better idea? |
May I suggest a different approach? The way versions are handled on the server side (with Grape), is by mounting namespaces. If the idea is to have both V3 and V4 supported, the best would be to namespace everything with V3 and V4 and whenever the change is simpler, just inherit the classes and change whatever is different, and when diversion is big enough, build a brand new class. You can programmatically "refine/extend" the client with one or the other based on the supplied API version number. |
@brodock Could you provide an example? Honestly, I'd rather not support both V3 and V4 going forward. When we first discussed this last year a February release for Gitlab 9 was a ways off. I was trying to figure out how to satisfy the people asking for a new release of this gem - which is a major version bump based on the deprecation of Ruby < 2.0. Dropping support for V3, in my eyes, is also a major version bump. If we could have come up with a solid plan for supporting both versions then it was less of an issue to push |
I have decided that starting with release 4.0.0 of this gem, which will be coming soon, we will only officially support V4 of the Gitlab API. |
Rather than making a new major version of the gitlab gem for GitLab 9.0 (and the GitLab API v4), could we make the gem compatible with both v3 and v4 simultaneously?
Something like the following?:
Then we can remove support for v3 in the future, after a few releases of GitLab 9.x. We'd also have to require users to specify the api version somehow.
Related: #235
The text was updated successfully, but these errors were encountered: