Skip to content

Add a Gitlab provider#6

Open
phroggyy wants to merge 5 commits intoevnsio:masterfrom
phroggyy:feat/provider-support
Open

Add a Gitlab provider#6
phroggyy wants to merge 5 commits intoevnsio:masterfrom
phroggyy:feat/provider-support

Conversation

@phroggyy
Copy link

@phroggyy phroggyy commented Oct 26, 2022

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
phroggyy/decision-log-test#1

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

Successfully merging this pull request may close these issues.

1 participant