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

Fixes: #573. Add Basic Gitea support #1048

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions bugwarrior/services/gitea.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import logging
import pathlib
import re
import six
import sys
from urllib.parse import urlparse
from urllib.parse import quote_plus
Expand All @@ -36,11 +35,10 @@ class GiteaConfig(config.ServiceConfig):
host = "gitea.com"
login: str
token: str
login: str
username: str
password: str
exclude_repos = []
include_repos = []
exclude_repos = config.ConfigList([])
include_repos = config.ConfigList([])

def get(self, key, default=None, to_type=None):
try:
Expand Down Expand Up @@ -370,7 +368,7 @@ def __init__(self, *args, **kw):
'import_labels_as_tags', default=False, to_type=bool
)
self.label_template = self.config.get(
'label_template', default='{{label}}', to_type=six.text_type
'label_template', default='{{label}}', to_type=bool
ryneeverett marked this conversation as resolved.
Show resolved Hide resolved
)
self.project_owner_prefix = self.config.get(
'project_owner_prefix', default=False, to_type=bool
Expand All @@ -380,7 +378,7 @@ def __init__(self, *args, **kw):
'query',
default='involves:{user} state:open'.format(
user=self.username) if self.involved_issues else '',
to_type=six.text_type
to_type=str
)

@staticmethod
Expand Down Expand Up @@ -552,13 +550,3 @@ def issues(self):
issue_obj.update_extra(extra)
yield issue_obj

@classmethod
def validate_config(cls, service_config, target):
if 'login' not in service_config:
log.critical('[%s] has no \'gitea.login\'' % target)
sys.exit(1)

if 'token' not in service_config and 'password' not in service_config:
log.critical('[%s] has no \'gitea.token\' or \'gitea.password\'' % target)
sys.exit(1)