Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion community/github/branch/new/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_DIR)

from common_util import assert_exit, ui_edit # noqa: E402
from git_api import ( # noqa: E402
check_git_installed,
create_and_checkout_branch,
Expand All @@ -16,6 +15,8 @@
save_last_base_branch,
)

from lib.workflow.common_util import assert_exit, ui_edit # noqa: E402

# Function to generate a random branch name
PROMPT = (
"Give me 5 different git branch names, "
Expand Down Expand Up @@ -94,3 +95,4 @@ def main():

if __name__ == "__main__":
main()
main()
File renamed without changes.
4 changes: 3 additions & 1 deletion community/github/commit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from common_util import assert_exit # noqa: E402
from git_api import (
get_github_repo,
get_github_repo_issues,
Expand All @@ -21,6 +20,8 @@
subprocess_run,
)

from lib.workflow.common_util import assert_exit # noqa: E402

diff_too_large_message_en = (
"Commit failed. The modified content is too long "
"and exceeds the model's length limit. "
Expand Down Expand Up @@ -537,3 +538,4 @@ def main():

if __name__ == "__main__":
main()
main()
2 changes: 1 addition & 1 deletion community/github/config/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from common_util import editor # noqa: E402
from lib.workflow.common_util import editor # noqa: E402


def read_issue_url():
Expand Down
4 changes: 3 additions & 1 deletion community/github/issue/list_tasks/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_DIR)

from common_util import assert_exit, editor # noqa: E402
from git_api import create_issue # noqa: E402

from lib.workflow.common_util import assert_exit, editor # noqa: E402

# Function to generate issue title and body using LLM
PROMPT = (
"Based on the following description, "
Expand Down Expand Up @@ -52,3 +53,4 @@ def main():

if __name__ == "__main__":
main()
main()
4 changes: 3 additions & 1 deletion community/github/issue/new/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_DIR)

from common_util import assert_exit, editor # noqa: E402
from devchat.llm import chat_json # noqa: E402
from git_api import create_issue # noqa: E402

from lib.workflow.common_util import assert_exit, editor # noqa: E402

# Function to generate issue title and body using LLM
PROMPT = (
"Based on the following description, "
Expand Down Expand Up @@ -51,3 +52,4 @@ def main():

if __name__ == "__main__":
main()
main()
4 changes: 3 additions & 1 deletion community/github/issue/new/from_task/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
)
sys.path.append(ROOT_DIR)
from common_util import assert_exit, editor, ui_edit # noqa: E402
from devchat.llm import chat_json # noqa: E402
from git_api import ( # noqa: E402
create_issue,
Expand All @@ -15,6 +14,8 @@
update_task_issue_url,
)

from lib.workflow.common_util import assert_exit, editor, ui_edit # noqa: E402

# Function to generate issue title and body using LLM
PROMPT = (
"Following is parent issue content:\n"
Expand Down Expand Up @@ -94,3 +95,4 @@ def main():

if __name__ == "__main__":
main()
main()
4 changes: 3 additions & 1 deletion community/github/issue/update_tasks/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from common_util import assert_exit, editor # noqa: E402
from devchat.llm import chat_json # noqa: E402
from git_api import ( # noqa: E402
get_issue_info_by_url,
Expand All @@ -12,6 +11,8 @@
update_sub_tasks,
)

from lib.workflow.common_util import assert_exit, editor # noqa: E402

TASKS_PROMPT = (
"Following is my git issue content.\n"
"{issue_data}\n\n"
Expand Down Expand Up @@ -99,3 +100,4 @@ def main():

if __name__ == "__main__":
main()
main()
3 changes: 2 additions & 1 deletion community/github/pr/new/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_DIR)

from common_util import assert_exit, ui_edit # noqa: E402
from devchat.llm import chat_json # noqa: E402
from git_api import ( # noqa: E402
auto_push,
Expand All @@ -18,6 +17,8 @@
save_last_base_branch,
)

from lib.workflow.common_util import assert_exit, ui_edit # noqa: E402


# 从分支名称中提取issue id
def extract_issue_id(branch_name):
Expand Down
8 changes: 4 additions & 4 deletions community/github/pr/update/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_DIR)

from common_util import assert_exit, ui_edit # noqa: E402
from devchat.llm import ( # noqa: E402
chat_json,
)
from devchat.llm import chat_json # noqa: E402
from git_api import ( # noqa: E402
auto_push,
get_commit_messages,
Expand All @@ -21,6 +18,8 @@
update_pr,
)

from lib.workflow.common_util import assert_exit, ui_edit # noqa: E402


# 从分支名称中提取issue id
def extract_issue_id(branch_name):
Expand Down Expand Up @@ -120,3 +119,4 @@ def main():

if __name__ == "__main__":
main()
main()
3 changes: 2 additions & 1 deletion community/gitlab/branch/new/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_DIR)

from common_util import assert_exit, ui_edit # noqa: E402
from git_api import ( # noqa: E402
check_git_installed,
create_and_checkout_branch,
Expand All @@ -16,6 +15,8 @@
save_last_base_branch,
)

from lib.workflow.common_util import assert_exit, ui_edit # noqa: E402

# Function to generate a random branch name
PROMPT = (
"Give me 5 different git branch names, "
Expand Down
22 changes: 11 additions & 11 deletions community/gitlab/commit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@

sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from common_util import assert_exit # noqa: E402
from git_api import (
get_gitlab_repo,
get_gitlab_repo_issues,
get_gitlab_username,
get_issue_info,
get_repo,
get_repo_issues,
get_username,
subprocess_check_output,
subprocess_run,
)

from lib.workflow.common_util import assert_exit # noqa: E402

diff_too_large_message_en = (
"Commit failed. The modified content is too long "
"and exceeds the model's length limit. "
Expand Down Expand Up @@ -428,9 +429,9 @@ def get_selected_issue_ids():
Returns:
list: 用户选中的issue id列表
"""
name = get_gitlab_username()
issue_repo = get_gitlab_repo(True)
issues = get_gitlab_repo_issues(issue_repo, name)
name = get_username()
issue_repo = get_repo(True)
issues = get_repo_issues(issue_repo, name)
if issues:
checkbox = Checkbox(
[f"#{issue['iid']}: {issue['title']}" for issue in issues],
Expand Down Expand Up @@ -458,8 +459,7 @@ def main():
sys.exit(-1)

print(
"Step 1/3: Select the changed files to include in this commit, "
"then click 'Continue'.",
"Step 1/3: Select the changed files to include in this commit, then click 'Continue'.",
end="\n\n",
flush=True,
)
Expand Down Expand Up @@ -499,8 +499,8 @@ def main():
# add closes #IssueNumber in commit message from issues from user selected
issue_ids = get_selected_issue_ids()
if issue_ids:
issue_repo = get_gitlab_repo(True)
owner_repo = get_gitlab_repo()
issue_repo = get_repo(True)
owner_repo = get_repo()
closes_issue_contents = []
for issue_id in issue_ids:
closes_issue_contents.append(
Expand Down
78 changes: 0 additions & 78 deletions community/gitlab/common_util.py

This file was deleted.

Loading