Skip to content

Commit 86ae78b

Browse files
committed
update title information
Signed-off-by: tjtanaa <[email protected]>
1 parent d4870bd commit 86ae78b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

aiter_api_watcher.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
NOTIFICATION_REPO = "EmbeddedLLM/aiter-api-watcher"
2828
CHECK_INTERVAL = 3600 # Check every hour by default
2929

30+
3031
def load_config():
3132
"""Load configuration from JSON file"""
3233
if not os.path.exists(CONFIG_FILE):
@@ -345,8 +346,10 @@ def compare_two_commits(config, old_commit, new_commit):
345346
old_signature.get("parameters"),
346347
new_signature.get("parameters")
347348
)
348-
349-
title = f"API Change Detected (Compare Mode): {func_config['function_path']}"
349+
commit_info = get_commit_info(temp_dir, new_commit)
350+
commit_date = commit_info.get("date", "Unknown").split()[0] # Only keep YYYY-MM-DD
351+
short_commit = new_commit[:7]
352+
title = f"[{commit_date} {short_commit}] API Change Detected (Compare Mode): {func_config['function_path']}"
350353
body = f"""## API Change Detected (Compare Mode)
351354
352355
Function: `{func_config['function_path']}`
@@ -392,6 +395,10 @@ def process_commit_list(config):
392395
subprocess.run(["git", "submodule", "update", "--init", "--recursive"], cwd=temp_dir, check=True)
393396
subprocess.run([sys.executable, "setup.py", "develop"], cwd=temp_dir, check=True)
394397

398+
commit_info = get_commit_info(temp_dir, commit)
399+
commit_date = commit_info.get("date", "Unknown").split()[0]
400+
short_commit = commit[:7]
401+
395402
for func_config in config["functions_to_monitor"]:
396403
import_statement = func_config["import_statement"]
397404
function_path = func_config["function_path"]
@@ -413,7 +420,7 @@ def process_commit_list(config):
413420
current_signature.get("parameters")
414421
)
415422

416-
title = f"API Change Detected: {function_path}"
423+
title = f"[{commit_date} {short_commit}] API Change Detected: {function_path}"
417424
body = f"""## API Change Detected
418425
419426
Function: `{function_path}`
@@ -554,7 +561,9 @@ def check_api_changes(config):
554561
)
555562

556563
# API has changed, create a GitHub issue
557-
title = f"API Change Detected: {function_path}"
564+
commit_date = commit_info.get("date", "Unknown").split()[0] # Only keep YYYY-MM-DD
565+
short_commit = commit[:7]
566+
title = f"[{commit_date} {short_commit}] API Change Detected: {function_path}"
558567

559568
body = f"""## API Change Detected
560569

0 commit comments

Comments
 (0)