Skip to content

Commit

Permalink
Merge pull request #117 from devchat-ai/optimize_pr
Browse files Browse the repository at this point in the history
chore: Update logging level to DEBUG in command.py
  • Loading branch information
kagami-l authored May 22, 2024
2 parents 813ae0f + 62b450d commit e008f17
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion merico/pr/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def close(self):
logger.remove(None)
logger.add(
CustomOutput(),
level=logging.INFO,
level=logging.DEBUG,
format="{message}",
colorize=False,
filter=inv_analytics_filter,
Expand Down
29 changes: 24 additions & 5 deletions merico/pr/config_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import json
import os

from lib.chatmark import TextEditor
from lib.chatmark import Radio, TextEditor

cache_repo_types = {}


# 根据PR URL获取不同的仓库管理类型
Expand All @@ -22,8 +24,27 @@ def get_repo_type(url):
return "codecommit"
elif "gerrit" in url:
return "gerrit"
elif url in cache_repo_types:
return cache_repo_types[url]
else:
return ""
radio = Radio(
["github", "gitlab", "bitbucket", "bitbucket_server", "azure", "codecommit", "gerrit"],
)
radio.render()
if radio.selection is None:
return ""

rtype = [
"github",
"gitlab",
"bitbucket",
"bitbucket_server",
"azure",
"codecommit",
"gerrit",
][radio.selection]
cache_repo_types[url] = rtype
return rtype


def read_github_token():
Expand Down Expand Up @@ -131,11 +152,9 @@ def read_server_access_token_with_input(pr_url):

def gitlab_host():
host = read_gitlab_host()
if host:
return host

gitlab_host_editor = TextEditor(
"", "Please input your gitlab host(for example: https://www.gitlab.com):"
host, "Please input your gitlab host(for example: https://www.gitlab.com):"
)
gitlab_host_editor.render()
host = gitlab_host_editor.new_text
Expand Down

0 comments on commit e008f17

Please sign in to comment.