You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 78446f6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: pipeline/README.md
+50-1Lines changed: 50 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,46 @@ pip install anthropic pyyaml
30
30
export ANTHROPIC_API_KEY=...
31
31
```
32
32
33
+
## Duplicate PRs
34
+
35
+
A gap stays open until its PR **merges**, so every run re-detects the gaps that are
36
+
already waiting for review. Left alone, the pipeline opens one PR per run for the
37
+
same missing pages.
38
+
39
+
`pipeline/open_prs.py` is the check that prevents that. It runs twice:
40
+
41
+
-**`generate.py`** drops gaps an open PR already covers, before any model call, so a
42
+
duplicate run costs nothing.
43
+
-**`ship.py`** refuses to open a PR when an open one already covers the whole run.
44
+
45
+
Both exit with code **3** ("nothing to do") instead of 0 or 1, and `run.py` stops the
46
+
chain cleanly when it sees it.
47
+
48
+
A gap is "already in flight" if any open PR matches it on:
49
+
50
+
| Signal | Source | Catches |
51
+
| --- | --- | --- |
52
+
| Gap key |`<!-- docs-pipeline-gaps: [...] -->` marker in the PR body, written by `ship.py`| Any gap, including ones whose filename the model invents (two runs of the same gap produce different slugs) |
53
+
| File path | The PR's changed files | Gaps with a predictable target path, including PRs the pipeline didn't open |
54
+
|`covers:` frontmatter | The PR's diff |`missing_group_coverage` gaps, whose filename is unpredictable but whose group name is in the diff |
55
+
56
+
Overrides, for when you want the PR anyway:
57
+
58
+
```bash
59
+
python pipeline/generate.py --ignore-open-prs # draft claimed gaps too
60
+
python pipeline/ship.py --latest --force-new-pr # open a second PR
61
+
```
62
+
63
+
If `gh` can't be reached the check is skipped with a warning rather than blocking the
64
+
run, so a missing CLI never stops the pipeline (it just allows a duplicate).
65
+
66
+
The logic has tests (stdlib only, no gh, no network), run in CI on any `pipeline/**`
67
+
change:
68
+
69
+
```bash
70
+
python pipeline/test_open_prs.py
71
+
```
72
+
33
73
## Pipeline Steps
34
74
35
75
The pipeline runs as a sequence of independent scripts. Each step reads the output of the previous one. You can run any step standalone, or use `run.py` to chain them all.
@@ -64,8 +104,12 @@ python pipeline/generate.py --section admin # generate for one fami
64
104
python pipeline/generate.py --type missing_orientation # generate one gap type
65
105
python pipeline/generate.py --force # regenerate even if files exist
66
106
python pipeline/generate.py --section admin --force # regenerate one section
107
+
python pipeline/generate.py --ignore-open-prs # include gaps an open PR covers
67
108
```
68
109
110
+
Gaps that an open PR already covers are skipped before any model call. See
111
+
[Duplicate PRs](#duplicate-prs).
112
+
69
113
Each run creates a timestamped folder under `pipeline/drafts/` with the generated `.mdx` files and a `report.json` with metadata.
70
114
71
115
### 2b. Rework Existing Pages (Phase 2 alternative to Generate)
python pipeline/ship.py --latest --branch docs/my-branch # custom branch name
184
+
python pipeline/ship.py --latest --force-new-pr # ship even if an open PR covers it
140
185
```
141
186
142
187
Requires `gh` CLI authenticated. Stages only `docs/**/*.mdx` and `docs.json`. Never force-pushes.
143
188
189
+
Exits 3 without creating a branch when an open PR already covers the whole run, and
190
+
stamps every PR body with the gap keys it covers so later runs recognize it. See
191
+
[Duplicate PRs](#duplicate-prs).
192
+
144
193
### 7. Post Review (PR Suggestions)
145
194
146
195
Posts "consider" findings from the review report as GitHub PR review comments with `suggestion` blocks. The reviewer can click "Apply suggestion" to accept changes directly in the PR.
@@ -306,5 +355,5 @@ The live site structure (which page sits in which tab) is read from `docs.json`
0 commit comments