forked from Ikalus1988/MisakaNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabsorb_journey_reports.py
More file actions
46 lines (38 loc) · 1.45 KB
/
Copy pathabsorb_journey_reports.py
File metadata and controls
46 lines (38 loc) · 1.45 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
#!/usr/bin/env python3
"""
⚡ Absorb Merged Journey Reports into Actionable Docs & Issues (#868)
Processes user journey reports and extracts actionable issue tickets and documentation updates.
"""
import os
import json
import re
class JourneyReportAbsorber:
def __init__(self, reports_dir="docs/user-journeys"):
self.reports_dir = reports_dir
def parse_report_content(self, text):
lines = text.strip().split("\n")
title = lines[0].replace("#", "").strip() if lines else "Untitled Journey"
actionables = []
for line in lines:
if line.strip().startswith("- [ ]") or line.strip().startswith("- [x]") or "TODO:" in line:
cleaned = re.sub(r"^-\s*\[[ xX]\]\s*", "", line.strip()).replace("TODO:", "").strip()
actionables.append(cleaned)
return {
"title": title,
"actionables": actionables,
"total_actionables": len(actionables)
}
def generate_github_issue(self, parsed):
issue_title = f"[Actionable] {parsed['title']}"
body_items = "\n".join([f"- [ ] {item}" for item in parsed['actionables']])
issue_body = f"""## User Journey Feedback & Action Items
Extracted from merged user journey report: **{parsed['title']}**
### Action Items:
{body_items}
/claim #868
"""
return {
"title": issue_title,
"body": issue_body,
"count": len(parsed['actionables'])
}