Skip to content

Commit 1f8f00d

Browse files
NoamGaashclaude
andcommitted
File 34 hackathon issues into open-bus-map-search (#1770-#1803)
Milestone 'Hackathon 2026 - data quality & new analyses' (#10), all 34 issues labelled ai-generated + needs-validation. Evidence comments added to map-search#24 and stride-api#49. Contributor heads-up at hackathon-26#2. created.json records every issue URL for traceability. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 1c0d957 commit 1f8f00d

2 files changed

Lines changed: 213 additions & 0 deletions

File tree

scripts/file_issues.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
"""File the hackathon issues into hasadna/open-bus-map-search.
2+
3+
Reads the manifest written by gen_issues.py and creates one issue per entry, in
4+
priority order, attached to the milestone. Idempotent: an issue whose exact
5+
title already exists in the repo is skipped, so a partial run can be resumed.
6+
7+
uv run python scripts/file_issues.py to_review <milestone-number> [--dry-run]
8+
"""
9+
10+
from __future__ import annotations
11+
12+
import json
13+
import subprocess
14+
import sys
15+
from pathlib import Path
16+
17+
REPO = "hasadna/open-bus-map-search"
18+
PROVENANCE = ["ai-generated", "needs-validation"]
19+
20+
# 1,2 first (live wrong answers), then the cheap doc/DX wins, then the rest.
21+
PRIORITY = [1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12] + list(range(13, 30)) + list(range(30, 35))
22+
23+
24+
def sh(*args: str) -> str:
25+
r = subprocess.run(args, capture_output=True, text=True)
26+
if r.returncode != 0:
27+
raise RuntimeError(f"{' '.join(args[:3])}… failed: {r.stderr.strip()[:300]}")
28+
return r.stdout.strip()
29+
30+
31+
def existing_titles() -> set[str]:
32+
raw = sh("gh", "issue", "list", "-R", REPO, "--state", "all",
33+
"--limit", "400", "--json", "title")
34+
return {i["title"] for i in json.loads(raw)}
35+
36+
37+
def main() -> int:
38+
out = Path(sys.argv[1])
39+
milestone = sys.argv[2]
40+
dry = "--dry-run" in sys.argv
41+
42+
manifest = {m["n"]: m for m in json.loads((out / "manifest.json").read_text())}
43+
have = existing_titles()
44+
created, skipped = [], []
45+
46+
for n in PRIORITY:
47+
it = manifest[n]
48+
if it["title"] in have:
49+
skipped.append(n)
50+
print(f" skip {n:02d} already exists — {it['title'][:64]}")
51+
continue
52+
53+
labels = ",".join(it["labels"] + PROVENANCE)
54+
cmd = ["gh", "issue", "create", "-R", REPO,
55+
"--title", it["title"],
56+
"--body-file", it["file"],
57+
"--label", labels,
58+
"--milestone", milestone]
59+
if dry:
60+
print(f" DRY {n:02d} [{labels}] {it['title'][:64]}")
61+
continue
62+
63+
url = sh(*cmd)
64+
created.append((n, url))
65+
print(f" ok {n:02d} {url}")
66+
67+
print(f"\ncreated {len(created)}, skipped {len(skipped)}")
68+
if created:
69+
(out / "created.json").write_text(
70+
json.dumps([{"n": n, "url": u} for n, u in created], indent=2))
71+
return 0
72+
73+
74+
if __name__ == "__main__":
75+
raise SystemExit(main())

to_review/created.json

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
[
2+
{
3+
"n": 1,
4+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1770"
5+
},
6+
{
7+
"n": 2,
8+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1771"
9+
},
10+
{
11+
"n": 7,
12+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1772"
13+
},
14+
{
15+
"n": 8,
16+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1773"
17+
},
18+
{
19+
"n": 9,
20+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1774"
21+
},
22+
{
23+
"n": 3,
24+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1775"
25+
},
26+
{
27+
"n": 4,
28+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1776"
29+
},
30+
{
31+
"n": 5,
32+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1777"
33+
},
34+
{
35+
"n": 6,
36+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1778"
37+
},
38+
{
39+
"n": 10,
40+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1779"
41+
},
42+
{
43+
"n": 11,
44+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1780"
45+
},
46+
{
47+
"n": 12,
48+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1781"
49+
},
50+
{
51+
"n": 13,
52+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1782"
53+
},
54+
{
55+
"n": 14,
56+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1783"
57+
},
58+
{
59+
"n": 15,
60+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1784"
61+
},
62+
{
63+
"n": 16,
64+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1785"
65+
},
66+
{
67+
"n": 17,
68+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1786"
69+
},
70+
{
71+
"n": 18,
72+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1787"
73+
},
74+
{
75+
"n": 19,
76+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1788"
77+
},
78+
{
79+
"n": 20,
80+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1789"
81+
},
82+
{
83+
"n": 21,
84+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1790"
85+
},
86+
{
87+
"n": 22,
88+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1791"
89+
},
90+
{
91+
"n": 23,
92+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1792"
93+
},
94+
{
95+
"n": 24,
96+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1793"
97+
},
98+
{
99+
"n": 25,
100+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1794"
101+
},
102+
{
103+
"n": 26,
104+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1795"
105+
},
106+
{
107+
"n": 27,
108+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1796"
109+
},
110+
{
111+
"n": 28,
112+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1797"
113+
},
114+
{
115+
"n": 29,
116+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1798"
117+
},
118+
{
119+
"n": 30,
120+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1799"
121+
},
122+
{
123+
"n": 31,
124+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1800"
125+
},
126+
{
127+
"n": 32,
128+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1801"
129+
},
130+
{
131+
"n": 33,
132+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1802"
133+
},
134+
{
135+
"n": 34,
136+
"url": "https://github.com/hasadna/open-bus-map-search/issues/1803"
137+
}
138+
]

0 commit comments

Comments
 (0)