Skip to content

Commit a03e9c8

Browse files
authored
Merge pull request #156 from devchat-ai/report
refactor: remove template path from configuration and update documentation
2 parents 2acedfa + a74ec6d commit a03e9c8

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

community/gitlab/config/command.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,21 @@
1717
"Input your gitlab API URL to access gitlab api, if not specified, default is https://gitlab.com/api/v4"
1818
)
1919
@editor("Input your gitlab TOKEN to access gitlab api")
20-
@editor("Input your gitlab work report template path")
21-
def edit_config(issue_url, gitlab_api_url, gitlab_token, template_path):
20+
def edit_config(issue_url, gitlab_api_url, gitlab_token):
2221
pass
2322

2423

2524
def main():
2625
issue_url = read_config("git_issue_repo", is_global=True)
2726
gitlab_token = read_config("gitlab_token", is_global=True)
2827
gitlab_api_url = read_config("gitlab_api_url", is_global=True)
29-
template_path = read_config("gitlab_work_report_template_path", is_global=True)
30-
issue_url, gitlab_api_url, gitlab_token, template_path = edit_config(
31-
issue_url, gitlab_api_url, gitlab_token, template_path
32-
)
28+
issue_url, gitlab_api_url, gitlab_token = edit_config(issue_url, gitlab_api_url, gitlab_token)
3329
if not gitlab_token:
3430
print("Please specify the gitlab token to access gitlab api.")
3531
sys.exit(0)
3632
save_config("git_issue_repo", issue_url, is_global=True)
3733
save_config("gitlab_token", gitlab_token, is_global=True)
3834
save_config("gitlab_api_url", gitlab_api_url, is_global=True)
39-
save_config("gitlab_work_report_template_path", template_path, is_global=True)
4035

4136
print("config gitlab settings successfully.")
4237
sys.exit(0)

community/gitlab/work_report/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ The report includes:
4444

4545
## Configuration
4646

47-
The report template can be customized by setting the `gitlab_work_report_template_path` in the global configuration.
47+
The report template can be customized by modifying the `template.md` file in the `~/.chat/scripts/community/gitlab/work_report` directory.

community/gitlab/work_report/README.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@
4444

4545
## 配置说明
4646

47-
可以通过全局配置中的 `gitlab_work_report_template_path` 来自定义报告模板
47+
可以修改 `~/.chat/scripts/community/gitlab/work_report/template.md` 文件来修改报告模板

community/gitlab/work_report/command.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
get_repo_issues,
1212
get_username,
1313
)
14-
from lib.workflow.config import read_config
1514

1615
PROMPT = """
17-
我希望你根据以下信息生成一份从 {start_time} 到 {end_time} 的 Gitlab 工作报告
16+
我希望你根据以下信息生成一份从 {start_time} 到 {end_time} 的工作报告
1817
1918
问题列表:
2019
<issues>
@@ -26,19 +25,15 @@
2625
{commits}
2726
</commits>
2827
29-
请参考以下模板内容
28+
请参考以下模板内容的格式
3029
<template>
3130
{template}
3231
</template>
3332
"""
3433

3534

3635
def get_template():
37-
template_path = read_config(
38-
"gitlab_work_report_template_path",
39-
is_global=True,
40-
default=os.path.join(os.path.dirname(__file__), "template.md"),
41-
)
36+
template_path = os.path.join(os.path.dirname(__file__), "template.md")
4237
with open(template_path, "r", encoding="utf-8") as f:
4338
return f.read()
4439

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
# 工作报告 2025-05-19 至 2025-05-20
12

3+
## 完成
4+
5+
1. xxx
6+
2. xxx
7+
3. xxx
8+
9+
## 未完成
10+
11+
1. xxx
12+
2. xxx
13+
3. xxx
14+
15+
## 待办
16+
17+
1. xxx
18+
2. xxx
19+
3. xxx

0 commit comments

Comments
 (0)