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

Feature Request: Gitlab Support #138

Closed
freexploit opened this issue Apr 11, 2021 · 4 comments
Closed

Feature Request: Gitlab Support #138

freexploit opened this issue Apr 11, 2021 · 4 comments

Comments

@freexploit
Copy link

Is there any plans to support gitlab on any level?

@weilbith
Copy link
Contributor

I think that's not easily possible. This plugin builds fully around the GitHub CLI tool. I don't think they will aim to support GitLab as well. On the other side the architecture of this plugin is not structured so that it would be easily possible to add an alternative "endpoint". Especially because the data objects of the GitHub API are spread all other the place.

@pwntester your statement? 🤔

@pwntester
Copy link
Owner

The code is tightly coupled to the objects returned by the GitHub GraphQL API. It should be possible to refactor the code so that the gh module invokes different queries for GitLab and then maps the returning objects to the ones expected by Octo, but that's something Im not planning to do in the short term. PRs are welcome though :)

@AckslD
Copy link

AckslD commented Oct 31, 2021

@weilbith @pwntester gitlab support would be great! To my knowledge the glab-cli has a quite similar API to gh. I don't know anything about the internals of octo but maybe a similar approach to how it's done in cmp-git could be taken? Has anyone look into this further since above? :)

@weilbith
Copy link
Contributor

weilbith commented Nov 5, 2021

I just checked out the GraphQL reference documentation of both APIs. On a first gaze they look quite similar. But some details are different. Here and there is a field missing or has slightly different type. So I think the devil is in the details.
Unfortunately there are no tests to just try it and exchange the executed binary. You would need to test everything manually and really have an eye for the details.
Though I agree with @pwntester that this plugin should actually be refactored in such a case and put an abstract interface in place. This is necessary to decouple the core functionality of this plugin from the dependencies that are used to communicate with the repository service provider. This interface would then be implemented for GitHub and GitLab. In theory also others like Mango. An important thing here is that we would need to add custom struct definitions for internal. Atm the foreign objects get used all other the place and create an huge dependency issue. But LuaJIT is also untyped and it is little nightmare to use proper typing here. At least in a developer supportive manner. This would require to use Teal or alternatives.
After all: it might work semi optimal with minimal changes by just using a different binary. The proper solution requires an immense amount of refactoring. I would love to see this. But I think all parties lack in time to do so.

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

No branches or pull requests

4 participants