sapling icon indicating copy to clipboard operation
sapling copied to clipboard

GitLab support

Open KyleFin opened this issue 3 years ago • 2 comments

It would be awesome if Sapling could be generalized to work with other git hosting providers. According to JetBrains 2020 survey, 77% of respondents regularly use GitHub, 40% GitLab, and 25% BitBucket

I tried to use Sapling with a GitLab repo and it looks like GitHub is a pretty deeply baked in assumption (for URL paths etc).

For example, sl pr failed at url.host == "[github.com](http://github.com/)" check

Aside: Thanks for open-sourcing Sapling and ReviewStack! I'm really excited for the simplified workflow for managing stacks of small commits!

KyleFin avatar Nov 16 '22 19:11 KyleFin

When integrating with things like pull requests, we use the GitHub CLI (gh) under the hood and GitHub's GraphQL API specifically. Unfortunately, it is not trivial to add support for other Git hosting providers when it comes to the "review" functionality in Sapling.

bolinfest avatar Nov 16 '22 20:11 bolinfest

Thanks for the quick response! Maybe https://gitlab.com/gitlab-org/cli could provide similar functionality for GitLab, but I can see that would be a non-trivial integration.

KyleFin avatar Nov 16 '22 20:11 KyleFin

I'm sorry for reopening this as I just want to provide some ideas we might want to do to balance the such support and Sapling's main roadmap as a SCM. Feel free to close this issue again.

Would it be possible for Sapling CLI to customize the path to gh? In this way, people who are using other Git systems can just build scripts / CLI tools that work just like gh but under the hood bridge the calls to the corresponding APIs of their own systems.

Obviously, this would still add some maintenance burden to Sapling, for example, to give a list of queries Sapling CLI uses on GitHub's GraphQL so people don't have to implement the full APIs on their own gh, but we might be able to find a way to minimize this burden.

Coming from a company that uses a similar workflow in a monorepo and trunk-based development model, I really appreciate the interoperability Sapling CLI has with GitHub, and I think it could add more impacts to places where they don't use GitHub Enterprise. I would even love to contribute if there is any need!

That being said, I understand the difficulty of maintaining dev infra tools, so here I'm just sharing my random idea. Feel free to close it again if it's not something the team would possibly want to support.

shk3 avatar Dec 21 '22 07:12 shk3