decision icon indicating copy to clipboard operation
decision copied to clipboard

Add a Gitlab provider

Open phroggyy opened this issue 3 years ago • 0 comments

I love the idea of this project, but as we use gitlab at work, I figured I'd add support for that.

Also fixed a bug where it wouldn't fetch the previous directories/categories if the branch wasn't named master.

Architectural changes

  • introduced a Provider interface to allow implementing any provider
    • also added a -provider command-line arg, defaulting to github
  • All Github functions are now on a struct, implementing a Provider interface
  • Github PRs are no longer created by first creating a tree and committing that. Instead, it is done in one action in the same way as for the immediate commit
  • Added a Gitlab provider
  • placed common functionality in provider and git as appropriate (and to avoid import loops)

Breaking changes

usage

  • renamed command-line flag github-token to provider-token

code

  • pretty much all github code as it is now on a provider
  • moved all git-related variables to a git package

Tests

What tests? There were no tests to begin with, and I'm no overachiever!

I've manually tested this on both Gitlab and Github, for both PR mode and immediate commit:
https://gitlab.com/phroggyy/decision-log/-/merge_requests/1
https://github.com/phroggyy/decision-log-test/pull/1

phroggyy avatar Oct 26 '22 23:10 phroggyy