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
9 changes: 2 additions & 7 deletions community/gitlab/config/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,21 @@
"Input your gitlab API URL to access gitlab api, if not specified, default is https://gitlab.com/api/v4"
)
@editor("Input your gitlab TOKEN to access gitlab api")
@editor("Input your gitlab work report template path")
def edit_config(issue_url, gitlab_api_url, gitlab_token, template_path):
def edit_config(issue_url, gitlab_api_url, gitlab_token):
pass


def main():
issue_url = read_config("git_issue_repo", is_global=True)
gitlab_token = read_config("gitlab_token", is_global=True)
gitlab_api_url = read_config("gitlab_api_url", is_global=True)
template_path = read_config("gitlab_work_report_template_path", is_global=True)
issue_url, gitlab_api_url, gitlab_token, template_path = edit_config(
issue_url, gitlab_api_url, gitlab_token, template_path
)
issue_url, gitlab_api_url, gitlab_token = edit_config(issue_url, gitlab_api_url, gitlab_token)
if not gitlab_token:
print("Please specify the gitlab token to access gitlab api.")
sys.exit(0)
save_config("git_issue_repo", issue_url, is_global=True)
save_config("gitlab_token", gitlab_token, is_global=True)
save_config("gitlab_api_url", gitlab_api_url, is_global=True)
save_config("gitlab_work_report_template_path", template_path, is_global=True)

print("config gitlab settings successfully.")
sys.exit(0)
Expand Down
2 changes: 1 addition & 1 deletion community/gitlab/work_report/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ The report includes:

## Configuration

The report template can be customized by setting the `gitlab_work_report_template_path` in the global configuration.
The report template can be customized by modifying the `template.md` file in the `~/.chat/scripts/community/gitlab/work_report` directory.
2 changes: 1 addition & 1 deletion community/gitlab/work_report/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@

## 配置说明

可以通过全局配置中的 `gitlab_work_report_template_path` 来自定义报告模板
可以修改 `~/.chat/scripts/community/gitlab/work_report/template.md` 文件来修改报告模板
11 changes: 3 additions & 8 deletions community/gitlab/work_report/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
get_repo_issues,
get_username,
)
from lib.workflow.config import read_config

PROMPT = """
我希望你根据以下信息生成一份从 {start_time} 到 {end_time} 的 Gitlab 工作报告
我希望你根据以下信息生成一份从 {start_time} 到 {end_time} 的工作报告

问题列表:
<issues>
Expand All @@ -26,19 +25,15 @@
{commits}
</commits>

请参考以下模板内容
请参考以下模板内容的格式
<template>
{template}
</template>
"""


def get_template():
template_path = read_config(
"gitlab_work_report_template_path",
is_global=True,
default=os.path.join(os.path.dirname(__file__), "template.md"),
)
template_path = os.path.join(os.path.dirname(__file__), "template.md")
with open(template_path, "r", encoding="utf-8") as f:
return f.read()

Expand Down
18 changes: 18 additions & 0 deletions community/gitlab/work_report/template.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# 工作报告 2025-05-19 至 2025-05-20

## 完成

1. xxx
2. xxx
3. xxx

## 未完成

1. xxx
2. xxx
3. xxx

## 待办

1. xxx
2. xxx
3. xxx