octo.nvim icon indicating copy to clipboard operation
octo.nvim copied to clipboard

feature: add glab support

Open brendalf opened this issue 2 years ago • 3 comments

Describe what this PR does / why we need it

This MR adds support to Gitlab CLI.

Does this pull request fix one issue?

Fixes #282

Describe how you did it

This MR implements the support to Gitlab CI by moving the current calls to gh.run to a backend interface.

The idea is that in the future we can add support to which cli we want by just adding a new backend that implements the same functions that gh currently does.

By default, if the backend doesn't implement some action, a notification is triggered to warn the user.

Describe how to verify it

Still WiP

Special notes for reviews

This MR is still WiP.

I'm opening it so we can start discussing the implementation plan.

Do you agree with the decision of adding the backend interface?

Currently action plan:

  • [x] Add backend interface.
  • [ ] Migrate remaining gh and graphql usage to backend functions inside backend.gh.
  • [ ] Write similar backend.gh functions to backend.glab.
  • [ ] Write a function to determine which backend to use.

brendalf avatar Feb 05 '23 05:02 brendalf

Hi @pwntester. WDYT about this plan?

brendalf avatar Feb 06 '23 12:02 brendalf

Hi @brendalf Thanks a lot for the PR. The plan sounds just right, but my guess is that glab GraphQL endpoints are going to return object trees that are completely different from the gh ones. That means that we are going to need a conversion function to make glab responses processable by Octo. Not sure how difficult that is going to be or if its going to be even possible.

pwntester avatar Feb 06 '23 20:02 pwntester

Great. So I will try implementing the glab respective methods before migrating gh calls to the new format. This way I can address your concern first.

brendalf avatar Feb 06 '23 21:02 brendalf

At lot of things changed in my life and I was unable to proceed with the work, like becoming a father and moving to the Netherlands. Now that we have #530, I will close this one, but I happy to contribute to other features after one is merged (if that happens).

brendalf avatar May 14 '24 21:05 brendalf