wakechart 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wakechart-0.2.0/src/wakechart.egg-info → wakechart-0.3.0}/PKG-INFO +54 -15
- {wakechart-0.2.0 → wakechart-0.3.0}/README.md +53 -14
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/__init__.py +1 -1
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/cli.py +141 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/prompts/AGENT.md +2 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/schema/roadmap.schema.json +5 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/viewer/template.html +478 -74
- {wakechart-0.2.0 → wakechart-0.3.0/src/wakechart.egg-info}/PKG-INFO +54 -15
- {wakechart-0.2.0 → wakechart-0.3.0}/tests/test_cli.py +108 -1
- {wakechart-0.2.0 → wakechart-0.3.0}/LICENSE +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/pyproject.toml +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/setup.cfg +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/__main__.py +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/prompts/NEW_PROJECT.md +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/templates/project.json +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart/templates/roadmap.json +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart.egg-info/SOURCES.txt +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart.egg-info/dependency_links.txt +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart.egg-info/entry_points.txt +0 -0
- {wakechart-0.2.0 → wakechart-0.3.0}/src/wakechart.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wakechart
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Phase roadmaps reconstructed from git history, with an interactive Gantt viewer that AI agents keep up to date.
|
|
5
5
|
Author: Alex Pérez
|
|
6
6
|
License-Expression: MIT
|
|
@@ -16,28 +16,49 @@ Description-Content-Type: text/markdown
|
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Dynamic: license-file
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/AlexPerez7/wakechart/main/docs/logo.svg" alt="wakechart" width="440">
|
|
21
|
+
</p>
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
<h1 align="center">Roadmaps built from your Git history</h1>
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
<p align="center">Turn commits into a clear, interactive timeline of what shipped and what comes next.</p>
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://pypi.org/project/wakechart/">PyPI</a> ·
|
|
29
|
+
<a href="https://alexperez7.github.io/wakechart/">Live demo</a> ·
|
|
30
|
+
<a href="README.es.md">Español</a> ·
|
|
31
|
+
<a href="#quick-start">Quick start</a>
|
|
32
|
+
</p>
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
- **Deliverables with IDs** (`T001`…) and a detail view: scope, acceptance criteria, verification, dependencies, dates, commits, and lines changed per discipline.
|
|
29
|
-
- **Teams, Versions (git tags) and Notes** views. English and Spanish interface.
|
|
30
|
-
- **Honest dates.** Every date says where it comes from: a *real* commit timestamp, an interval *reconstructed* from commit sessions (not effort), an *AI estimate* for planned work, or *unknown*.
|
|
31
|
-
- **Incremental.** New commits that match no deliverable are listed as *unclassified* for the agent to sort out.
|
|
32
|
-
- **No dependencies.** Python 3.9+ standard library and `git`. The target repository is only read.
|
|
34
|
+
wakechart reads your repository’s commits, tags and branches and combines them with a roadmap you maintain in JSON. It produces an interactive Gantt chart in a single HTML file that you can open locally or publish on GitHub Pages.
|
|
33
35
|
|
|
34
|
-

|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
## What you get
|
|
39
|
+
|
|
40
|
+
- **A roadmap grounded in Git.** Group commits into phases and deliverables, with links to the underlying history.
|
|
41
|
+
- **A timeline for completed and planned work.** Explore reconstructed commit sessions, estimates, dependencies and progress in an interactive Gantt chart.
|
|
42
|
+
- **A clear view of change.** Browse teams, releases and notes, filter deliverables and inspect unclassified commits.
|
|
43
|
+
- **Ready to share.** The viewer follows your system's light or dark setting and can print a concise project summary.
|
|
44
|
+
- **A portable result.** Share a standalone HTML page or publish it automatically with the included GitHub Action.
|
|
45
|
+
- **An agent-friendly workflow.** Use the included prompts with Codex, Claude Code, Gemini CLI or edit the roadmap yourself.
|
|
46
|
+
- **English and Spanish.** Switch languages in the viewer. Python 3.9+ and Git are the only runtime requirements.
|
|
35
47
|
|
|
36
48
|
## Install
|
|
37
49
|
|
|
50
|
+
Requires **Python 3.9 or later** and **Git**. Install with [pipx](https://pipx.pypa.io/) or pip.
|
|
51
|
+
|
|
38
52
|
```sh
|
|
39
|
-
pipx install
|
|
40
|
-
# or
|
|
53
|
+
pipx install wakechart
|
|
54
|
+
# or
|
|
55
|
+
pip install wakechart
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
PyPI provides version 0.3.0. To use the unreleased development version from GitHub `main`:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
pipx install git+https://github.com/AlexPerez7/wakechart.git
|
|
41
62
|
```
|
|
42
63
|
|
|
43
64
|
## Quick start
|
|
@@ -80,7 +101,7 @@ wakechart -w ../spoon-knife-roadmap all --strict
|
|
|
80
101
|
|
|
81
102
|
Open `../spoon-knife-roadmap/dist/spoon-knife.html#T002` in a browser to see the stylesheet deliverable.
|
|
82
103
|
|
|
83
|
-

|
|
104
|
+

|
|
84
105
|
|
|
85
106
|
## Commands
|
|
86
107
|
|
|
@@ -100,6 +121,22 @@ Use `wakechart all --index` to generate an `index.html` that links to each proje
|
|
|
100
121
|
|
|
101
122
|
Use `wakechart build --json` or `wakechart all --json` to get a JSON object on stdout. Each entry under `projects` is keyed by project ID and contains `classified`, `total` and the complete `unclassified` list. Diagnostics go to stderr. With `--strict`, unclassified commits still produce a report and exit code 1.
|
|
102
123
|
|
|
124
|
+
During extraction, wakechart reads unchecked Markdown checklist items from `TODO.md` and `ROADMAP.md` in the repository root. The Notes view lists them with their file and line as suggestions for review. Checklists in fenced code blocks and checked items are ignored. Run `wakechart all` to refresh them after editing the files. Suggestions do not change `roadmap.json` or its progress.
|
|
125
|
+
|
|
126
|
+
## GitHub issues and milestones
|
|
127
|
+
|
|
128
|
+
Optionally import open GitHub work as planned deliverables. Add the repository to `project.json`:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{ "github": { "repo": "owner/name" } }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`wakechart extract` (and `all`) then reads open milestones and open issues (pull requests excluded) from the GitHub REST API using only the standard library. Public repositories need no token; set `GITHUB_TOKEN` for private ones or higher rate limits. The token is only sent to `api.github.com`.
|
|
135
|
+
|
|
136
|
+
At build time each milestone becomes a phase (`gh-m<number>`) and each of its issues a `committed` deliverable `GH<number>`. Issues without a milestone go to a `gh-backlog` phase as `provisional`. Nothing is written to `roadmap.json`, and imports count in the progress total. To track an issue yourself, set `"issue": 12` on a deliverable: it gets a link to the issue and is not imported twice. If GitHub cannot be reached, extraction warns and keeps the previous snapshot.
|
|
137
|
+
|
|
138
|
+
The viewer's progress percentage is the number of deliverables marked `done` divided by all deliverables, including provisional work. Adding planned work therefore updates the percentage. The language switch translates viewer controls; roadmap text and Git subjects appear in their original language.
|
|
139
|
+
|
|
103
140
|
## Files
|
|
104
141
|
|
|
105
142
|
```
|
|
@@ -194,6 +231,8 @@ Each commit becomes a bar from the previous commit, if that one is close enough
|
|
|
194
231
|
|
|
195
232
|
Set `"session_scope": "author"` in `roadmap.json` to reconstruct sessions separately for each Git author. Wakechart uses the commit email to distinguish authors with the same display name and publishes the display name in the bundle. Run `wakechart all` to refresh an older extraction cache. The default scope is `global`.
|
|
196
233
|
|
|
234
|
+
The Gantt draws dependency arrows between visible, expanded deliverables. It highlights the longest chain of planned items by estimated duration, including ties. Completed dependencies are treated as satisfied. Planned items with missing or invalid estimates, missing dependencies, or dependency cycles are excluded, as are items depending on them. The calculation uses estimated durations and dependency links and does not reschedule dates or account for resource constraints.
|
|
235
|
+
|
|
197
236
|
For a completed deliverable, the viewer uses the earliest Git tag whose history contains all assigned commits. `target_version` can set the version explicitly. Run `wakechart all` to add Git ancestry data when regenerating an older bundle.
|
|
198
237
|
|
|
199
238
|
## License
|
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/AlexPerez7/wakechart/main/docs/logo.svg" alt="wakechart" width="440">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">Roadmaps built from your Git history</h1>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<p align="center">Turn commits into a clear, interactive timeline of what shipped and what comes next.</p>
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://pypi.org/project/wakechart/">PyPI</a> ·
|
|
11
|
+
<a href="https://alexperez7.github.io/wakechart/">Live demo</a> ·
|
|
12
|
+
<a href="README.es.md">Español</a> ·
|
|
13
|
+
<a href="#quick-start">Quick start</a>
|
|
14
|
+
</p>
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
- **Deliverables with IDs** (`T001`…) and a detail view: scope, acceptance criteria, verification, dependencies, dates, commits, and lines changed per discipline.
|
|
11
|
-
- **Teams, Versions (git tags) and Notes** views. English and Spanish interface.
|
|
12
|
-
- **Honest dates.** Every date says where it comes from: a *real* commit timestamp, an interval *reconstructed* from commit sessions (not effort), an *AI estimate* for planned work, or *unknown*.
|
|
13
|
-
- **Incremental.** New commits that match no deliverable are listed as *unclassified* for the agent to sort out.
|
|
14
|
-
- **No dependencies.** Python 3.9+ standard library and `git`. The target repository is only read.
|
|
16
|
+
wakechart reads your repository’s commits, tags and branches and combines them with a roadmap you maintain in JSON. It produces an interactive Gantt chart in a single HTML file that you can open locally or publish on GitHub Pages.
|
|
15
17
|
|
|
16
|
-

|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
## What you get
|
|
21
|
+
|
|
22
|
+
- **A roadmap grounded in Git.** Group commits into phases and deliverables, with links to the underlying history.
|
|
23
|
+
- **A timeline for completed and planned work.** Explore reconstructed commit sessions, estimates, dependencies and progress in an interactive Gantt chart.
|
|
24
|
+
- **A clear view of change.** Browse teams, releases and notes, filter deliverables and inspect unclassified commits.
|
|
25
|
+
- **Ready to share.** The viewer follows your system's light or dark setting and can print a concise project summary.
|
|
26
|
+
- **A portable result.** Share a standalone HTML page or publish it automatically with the included GitHub Action.
|
|
27
|
+
- **An agent-friendly workflow.** Use the included prompts with Codex, Claude Code, Gemini CLI or edit the roadmap yourself.
|
|
28
|
+
- **English and Spanish.** Switch languages in the viewer. Python 3.9+ and Git are the only runtime requirements.
|
|
17
29
|
|
|
18
30
|
## Install
|
|
19
31
|
|
|
32
|
+
Requires **Python 3.9 or later** and **Git**. Install with [pipx](https://pipx.pypa.io/) or pip.
|
|
33
|
+
|
|
20
34
|
```sh
|
|
21
|
-
pipx install
|
|
22
|
-
# or
|
|
35
|
+
pipx install wakechart
|
|
36
|
+
# or
|
|
37
|
+
pip install wakechart
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
PyPI provides version 0.3.0. To use the unreleased development version from GitHub `main`:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
pipx install git+https://github.com/AlexPerez7/wakechart.git
|
|
23
44
|
```
|
|
24
45
|
|
|
25
46
|
## Quick start
|
|
@@ -62,7 +83,7 @@ wakechart -w ../spoon-knife-roadmap all --strict
|
|
|
62
83
|
|
|
63
84
|
Open `../spoon-knife-roadmap/dist/spoon-knife.html#T002` in a browser to see the stylesheet deliverable.
|
|
64
85
|
|
|
65
|
-

|
|
86
|
+

|
|
66
87
|
|
|
67
88
|
## Commands
|
|
68
89
|
|
|
@@ -82,6 +103,22 @@ Use `wakechart all --index` to generate an `index.html` that links to each proje
|
|
|
82
103
|
|
|
83
104
|
Use `wakechart build --json` or `wakechart all --json` to get a JSON object on stdout. Each entry under `projects` is keyed by project ID and contains `classified`, `total` and the complete `unclassified` list. Diagnostics go to stderr. With `--strict`, unclassified commits still produce a report and exit code 1.
|
|
84
105
|
|
|
106
|
+
During extraction, wakechart reads unchecked Markdown checklist items from `TODO.md` and `ROADMAP.md` in the repository root. The Notes view lists them with their file and line as suggestions for review. Checklists in fenced code blocks and checked items are ignored. Run `wakechart all` to refresh them after editing the files. Suggestions do not change `roadmap.json` or its progress.
|
|
107
|
+
|
|
108
|
+
## GitHub issues and milestones
|
|
109
|
+
|
|
110
|
+
Optionally import open GitHub work as planned deliverables. Add the repository to `project.json`:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{ "github": { "repo": "owner/name" } }
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`wakechart extract` (and `all`) then reads open milestones and open issues (pull requests excluded) from the GitHub REST API using only the standard library. Public repositories need no token; set `GITHUB_TOKEN` for private ones or higher rate limits. The token is only sent to `api.github.com`.
|
|
117
|
+
|
|
118
|
+
At build time each milestone becomes a phase (`gh-m<number>`) and each of its issues a `committed` deliverable `GH<number>`. Issues without a milestone go to a `gh-backlog` phase as `provisional`. Nothing is written to `roadmap.json`, and imports count in the progress total. To track an issue yourself, set `"issue": 12` on a deliverable: it gets a link to the issue and is not imported twice. If GitHub cannot be reached, extraction warns and keeps the previous snapshot.
|
|
119
|
+
|
|
120
|
+
The viewer's progress percentage is the number of deliverables marked `done` divided by all deliverables, including provisional work. Adding planned work therefore updates the percentage. The language switch translates viewer controls; roadmap text and Git subjects appear in their original language.
|
|
121
|
+
|
|
85
122
|
## Files
|
|
86
123
|
|
|
87
124
|
```
|
|
@@ -176,6 +213,8 @@ Each commit becomes a bar from the previous commit, if that one is close enough
|
|
|
176
213
|
|
|
177
214
|
Set `"session_scope": "author"` in `roadmap.json` to reconstruct sessions separately for each Git author. Wakechart uses the commit email to distinguish authors with the same display name and publishes the display name in the bundle. Run `wakechart all` to refresh an older extraction cache. The default scope is `global`.
|
|
178
215
|
|
|
216
|
+
The Gantt draws dependency arrows between visible, expanded deliverables. It highlights the longest chain of planned items by estimated duration, including ties. Completed dependencies are treated as satisfied. Planned items with missing or invalid estimates, missing dependencies, or dependency cycles are excluded, as are items depending on them. The calculation uses estimated durations and dependency links and does not reschedule dates or account for resource constraints.
|
|
217
|
+
|
|
179
218
|
For a completed deliverable, the viewer uses the earliest Git tag whose history contains all assigned commits. `target_version` can set the version explicitly. Run `wakechart all` to add Git ancestry data when regenerating an older bundle.
|
|
180
219
|
|
|
181
220
|
## License
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""wakechart: phase roadmaps reconstructed from git history."""
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.3.0"
|
|
@@ -11,9 +11,12 @@ import fnmatch
|
|
|
11
11
|
import hashlib
|
|
12
12
|
import html
|
|
13
13
|
import json
|
|
14
|
+
import os
|
|
14
15
|
import re
|
|
15
16
|
import subprocess
|
|
16
17
|
import sys
|
|
18
|
+
import urllib.error
|
|
19
|
+
import urllib.request
|
|
17
20
|
from importlib import resources
|
|
18
21
|
from pathlib import Path
|
|
19
22
|
|
|
@@ -24,6 +27,9 @@ EXTRACT_CACHE_VERSION = 2
|
|
|
24
27
|
SEP = "\x1e" # between commits
|
|
25
28
|
FS = "\x1f" # between header fields
|
|
26
29
|
ID_RE = re.compile(r"^[a-z0-9][a-z0-9-]*$")
|
|
30
|
+
GITHUB_REPO_RE = re.compile(r"^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$")
|
|
31
|
+
GITHUB_API = "https://api.github.com"
|
|
32
|
+
GITHUB_MAX_PAGES = 10 # 100 items per page
|
|
27
33
|
|
|
28
34
|
|
|
29
35
|
class WakeError(Exception):
|
|
@@ -155,6 +161,120 @@ def tag_reachability(repo: Path, tags: list[dict], commit_tips: set[str], select
|
|
|
155
161
|
return contained
|
|
156
162
|
|
|
157
163
|
|
|
164
|
+
def checklist_suggestions(repo: Path) -> list[dict]:
|
|
165
|
+
"""Read unchecked Markdown tasks in the root planning files."""
|
|
166
|
+
suggestions = []
|
|
167
|
+
for name in ("TODO.md", "ROADMAP.md"):
|
|
168
|
+
path = repo / name
|
|
169
|
+
if not path.is_file():
|
|
170
|
+
continue
|
|
171
|
+
try:
|
|
172
|
+
with path.open(encoding="utf-8-sig") as source:
|
|
173
|
+
fence = None
|
|
174
|
+
for line_number, line in enumerate(source, 1):
|
|
175
|
+
marker = re.match(r"^ {0,3}(\x60{3,}|~{3,})", line)
|
|
176
|
+
if marker:
|
|
177
|
+
token = marker.group(1)
|
|
178
|
+
if fence is None:
|
|
179
|
+
fence = token
|
|
180
|
+
elif token[0] == fence[0] and len(token) >= len(fence):
|
|
181
|
+
fence = None
|
|
182
|
+
continue
|
|
183
|
+
if fence is not None:
|
|
184
|
+
continue
|
|
185
|
+
task = re.match(r"^\s*(?:[-+*]|\d+[.)])\s+\[ \]\s+(.+?)\s*$", line)
|
|
186
|
+
if task:
|
|
187
|
+
suggestions.append({"source": name, "line": line_number, "text": task.group(1)})
|
|
188
|
+
except (OSError, UnicodeError) as error:
|
|
189
|
+
raise WakeError(f"cannot read {path}: {error}")
|
|
190
|
+
return suggestions
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def github_get(path: str) -> list:
|
|
194
|
+
"""GET one page of the GitHub REST API (always api.github.com; token only from the environment)."""
|
|
195
|
+
headers = {"Accept": "application/vnd.github+json", "User-Agent": "wakechart"}
|
|
196
|
+
token = os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN")
|
|
197
|
+
if token:
|
|
198
|
+
headers["Authorization"] = f"Bearer {token}"
|
|
199
|
+
request = urllib.request.Request(GITHUB_API + path, headers=headers)
|
|
200
|
+
with urllib.request.urlopen(request, timeout=20) as response:
|
|
201
|
+
return json.loads(response.read().decode("utf-8"))
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def github_items(path: str) -> list[dict]:
|
|
205
|
+
items: list[dict] = []
|
|
206
|
+
for page in range(1, GITHUB_MAX_PAGES + 1):
|
|
207
|
+
chunk = github_get(f"{path}{'&' if '?' in path else '?'}per_page=100&page={page}")
|
|
208
|
+
items.extend(chunk)
|
|
209
|
+
if len(chunk) < 100:
|
|
210
|
+
break
|
|
211
|
+
return items
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def github_snapshot(repo: str) -> dict:
|
|
215
|
+
"""Open milestones and open issues (pull requests excluded) of a GitHub repository."""
|
|
216
|
+
milestones = [{"number": m["number"], "title": m["title"], "description": m.get("description") or "",
|
|
217
|
+
"due_on": m.get("due_on"), "url": m.get("html_url", "")}
|
|
218
|
+
for m in github_items(f"/repos/{repo}/milestones?state=open&sort=due_on")]
|
|
219
|
+
issues = []
|
|
220
|
+
for i in github_items(f"/repos/{repo}/issues?state=open"):
|
|
221
|
+
if "pull_request" in i:
|
|
222
|
+
continue
|
|
223
|
+
milestone = i.get("milestone") or {}
|
|
224
|
+
issues.append({"number": i["number"], "title": i["title"], "url": i.get("html_url", ""),
|
|
225
|
+
"milestone": milestone.get("number"),
|
|
226
|
+
"labels": [l["name"] for l in i.get("labels", []) if isinstance(l, dict)]})
|
|
227
|
+
return {"repo": repo, "fetched_at": dt.datetime.now().astimezone().isoformat(timespec="seconds"),
|
|
228
|
+
"milestones": milestones, "issues": issues}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def import_github(roadmap: dict, snapshot: dict | None) -> int:
|
|
232
|
+
"""Add open milestones as phases and open issues as deliverables, in memory only.
|
|
233
|
+
|
|
234
|
+
Issues already linked by a deliverable's `issue` number are not duplicated; they only
|
|
235
|
+
receive their link. Returns the number of imported deliverables."""
|
|
236
|
+
if not snapshot:
|
|
237
|
+
return 0
|
|
238
|
+
issues = {i["number"]: i for i in snapshot.get("issues", [])}
|
|
239
|
+
linked = set()
|
|
240
|
+
for it in roadmap["deliverables"]:
|
|
241
|
+
number = it.get("issue")
|
|
242
|
+
if number in issues:
|
|
243
|
+
linked.add(number)
|
|
244
|
+
it["_issue"] = {"number": number, "url": issues[number]["url"]}
|
|
245
|
+
es = roadmap["project"].get("lang") == "es"
|
|
246
|
+
milestones = {m["number"]: m for m in snapshot.get("milestones", [])}
|
|
247
|
+
phase_ids = {p["id"] for p in roadmap["phases"]}
|
|
248
|
+
groups: dict = {}
|
|
249
|
+
for number in sorted(issues):
|
|
250
|
+
if number not in linked:
|
|
251
|
+
issue = issues[number]
|
|
252
|
+
groups.setdefault(issue["milestone"] if issue["milestone"] in milestones else None, []).append(issue)
|
|
253
|
+
order = sorted((n for n in groups if n is not None),
|
|
254
|
+
key=lambda n: (milestones[n].get("due_on") or "9999", n))
|
|
255
|
+
added = 0
|
|
256
|
+
for key in order + ([None] if None in groups else []):
|
|
257
|
+
if key is None:
|
|
258
|
+
phase = {"id": "gh-backlog", "name": "Issues sin hito" if es else "Issues without milestone", "goal": ""}
|
|
259
|
+
status = "provisional"
|
|
260
|
+
else:
|
|
261
|
+
m = milestones[key]
|
|
262
|
+
phase = {"id": f"gh-m{key}", "name": m["title"], "goal": m.get("description", "")}
|
|
263
|
+
status = "committed"
|
|
264
|
+
if phase["id"] in phase_ids:
|
|
265
|
+
continue # a hand-written phase with that id wins
|
|
266
|
+
roadmap["phases"].append(phase)
|
|
267
|
+
for issue in groups[key]:
|
|
268
|
+
item = {"id": f"GH{issue['number']}", "phase": phase["id"], "status": status,
|
|
269
|
+
"title": issue["title"], "source": f"GitHub #{issue['number']}",
|
|
270
|
+
"_issue": {"number": issue["number"], "url": issue["url"]}, "_imported": True}
|
|
271
|
+
if issue["labels"]:
|
|
272
|
+
item["scope"] = ", ".join(issue["labels"])
|
|
273
|
+
roadmap["deliverables"].append(item)
|
|
274
|
+
added += 1
|
|
275
|
+
return added
|
|
276
|
+
|
|
277
|
+
|
|
158
278
|
def extract(ws: Workspace, pid: str, out=print) -> dict:
|
|
159
279
|
pj, gj, _ = ws.files(pid)
|
|
160
280
|
if not pj.exists():
|
|
@@ -239,6 +359,19 @@ def extract(ws: Workspace, pid: str, out=print) -> dict:
|
|
|
239
359
|
name, obj, date, cur = line.split(FS)
|
|
240
360
|
branches.append({"name": name, "commit": obj, "date": date, "current": cur == "*"})
|
|
241
361
|
|
|
362
|
+
github = None
|
|
363
|
+
github_cfg = cfg.get("github")
|
|
364
|
+
if github_cfg:
|
|
365
|
+
repo_name = github_cfg.get("repo") if isinstance(github_cfg, dict) else github_cfg
|
|
366
|
+
if not isinstance(repo_name, str) or not GITHUB_REPO_RE.match(repo_name):
|
|
367
|
+
raise WakeError("github.repo in project.json must look like owner/name")
|
|
368
|
+
try:
|
|
369
|
+
github = github_snapshot(repo_name)
|
|
370
|
+
except (urllib.error.URLError, OSError, ValueError, KeyError) as error:
|
|
371
|
+
out(f" warning: GitHub issues not refreshed ({error})")
|
|
372
|
+
previous = old.get("github")
|
|
373
|
+
github = previous if previous and previous.get("repo") == repo_name else None
|
|
374
|
+
|
|
242
375
|
data = {
|
|
243
376
|
"schema": SCHEMA_VERSION,
|
|
244
377
|
"cache_version": EXTRACT_CACHE_VERSION,
|
|
@@ -251,6 +384,8 @@ def extract(ws: Workspace, pid: str, out=print) -> dict:
|
|
|
251
384
|
"dirty_files": len(git(repo, "status", "--porcelain").splitlines()),
|
|
252
385
|
"branches": branches,
|
|
253
386
|
"tags": tags,
|
|
387
|
+
"suggestions": checklist_suggestions(repo),
|
|
388
|
+
"github": github,
|
|
254
389
|
"tag_reachability": tag_reachability(repo, tags, commit_tips, {c["hash"] for c in commits}),
|
|
255
390
|
"commits": commits,
|
|
256
391
|
}
|
|
@@ -328,6 +463,8 @@ def validation_errors(roadmap) -> list[str]:
|
|
|
328
463
|
errs.append(f"{where}: status must be one of {sorted(STATUSES)}")
|
|
329
464
|
if it.get("priority") and it["priority"] not in PRIORITIES:
|
|
330
465
|
errs.append(f"{where}: priority must be one of {list(PRIORITIES)}")
|
|
466
|
+
if "issue" in it and (type(it["issue"]) is not int or it["issue"] < 1):
|
|
467
|
+
errs.append(f"{where}: issue must be a positive GitHub issue number")
|
|
331
468
|
for dep in it.get("depends", []):
|
|
332
469
|
if dep not in ids:
|
|
333
470
|
errs.append(f"{where}: unknown dependency {dep!r}")
|
|
@@ -489,12 +626,16 @@ def build(ws: Workspace, pid: str, out_dir: Path | None = None, index: bool = Fa
|
|
|
489
626
|
roadmap = load_json(rj)
|
|
490
627
|
validate(roadmap)
|
|
491
628
|
gitdata = load_json(gj) if gj.exists() else {}
|
|
629
|
+
imported = import_github(roadmap, gitdata.get("github"))
|
|
492
630
|
stats = resolve(roadmap, gitdata, out)
|
|
631
|
+
if imported:
|
|
632
|
+
out(f" {imported} GitHub issues imported from {gitdata['github']['repo']}")
|
|
493
633
|
bundle = {
|
|
494
634
|
"wakechart": __version__,
|
|
495
635
|
"roadmap": roadmap,
|
|
496
636
|
"git": {k: gitdata.get(k) for k in ("extracted_at", "head", "dirty_files", "branches", "tags", "refs")},
|
|
497
637
|
"stats": stats,
|
|
638
|
+
"suggestions": gitdata.get("suggestions", []),
|
|
498
639
|
"built_at": dt.datetime.now().astimezone().isoformat(timespec="seconds"),
|
|
499
640
|
}
|
|
500
641
|
payload = json.dumps(bundle, ensure_ascii=False).replace("<", "\\u003c")
|
|
@@ -31,6 +31,8 @@ wakechart all <id>
|
|
|
31
31
|
2. Add each one to an existing deliverable (`commits`) or create a new deliverable.
|
|
32
32
|
3. If a `committed` or `provisional` deliverable now has commits, move it to `in_progress` or `done` and remove its `estimate`.
|
|
33
33
|
4. Re-read the repository's planning documents (ROADMAP, TODO, CHANGELOG, open issues if available) and add, close or re-estimate planned deliverables. Put the document in `source`.
|
|
34
|
+
The Notes view also lists unchecked root `TODO.md` and `ROADMAP.md` items as suggestions. Review them before adding deliverables.
|
|
35
|
+
If `project.json` has `github.repo`, open milestones and issues are imported at build time as phases `gh-m<number>` and deliverables `GH<number>`. When you plan one of them by hand, set `issue: <number>` on your deliverable instead of duplicating it.
|
|
34
36
|
5. Set `project.now` to the current date and time (or leave it empty to use the build time). Add a note when a decision was made.
|
|
35
37
|
6. Run `wakechart build <id>` again until there are no unclassified commits and no errors (`--strict` fails on unclassified commits).
|
|
36
38
|
|
|
@@ -165,6 +165,11 @@
|
|
|
165
165
|
"type": "string",
|
|
166
166
|
"description": "Repository document it comes from (for planned work)."
|
|
167
167
|
},
|
|
168
|
+
"issue": {
|
|
169
|
+
"type": "integer",
|
|
170
|
+
"minimum": 1,
|
|
171
|
+
"description": "GitHub issue number. With \"github\" set in project.json, the viewer links it and the issue is not imported twice."
|
|
172
|
+
},
|
|
168
173
|
"depends": {
|
|
169
174
|
"type": "array",
|
|
170
175
|
"items": {
|