-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-auto-commit-demo.py
More file actions
59 lines (51 loc) · 1.94 KB
/
test-auto-commit-demo.py
File metadata and controls
59 lines (51 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
"""
Demo script to test auto-commit functionality
"""
import subprocess
import sys
from pathlib import Path
def run_command(cmd, description):
"""Run a command and show results"""
print(f"\n🔧 {description}")
print(f"Command: {' '.join(cmd)}")
try:
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
print("✅ Success:")
print(result.stdout)
return True
except subprocess.CalledProcessError as e:
print("❌ Error:")
print(e.stderr)
return False
def main():
"""Demo the auto-commit workflow"""
print("🚀 Auto-Commit Workflow Demo")
print("=" * 50)
# Test 1: Detect completion
run_command([
"uv", "run", "python", "scripts/git-automation.py",
"detect-completion", "--since", "24h"
], "Detect completed tasks in last 24 hours")
# Test 2: Show git status
run_command([
"uv", "run", "python", "scripts/git-automation.py",
"validate"
], "Validate current changes")
# Test 3: Show available commands
print("\n📚 Available Auto-Commit Commands:")
print("1. detect-completion --since [time] # Find recently completed tasks")
print("2. auto-commit --dry-run --since [time] # Auto-commit completed tasks")
print("3. commit-task --issue-id [ID] --dry-run # Commit specific task")
print("4. commit-task --issue-id [ID] --status closed # Commit and close task")
print("\n💡 Usage Examples:")
print("# Detect tasks completed in last hour:")
print("uv run python scripts/git-automation.py detect-completion --since 1h")
print()
print("# Auto-commit completed tasks (dry run):")
print("uv run python scripts/git-automation.py auto-commit --dry-run")
print()
print("# Commit specific task:")
print("uv run python scripts/git-automation.py commit-task --issue-id opencode-config-13")
if __name__ == "__main__":
main()