MCPcopy Create free account
hub / github.com/FastLED/FastLED / fetch_repo_items

Function fetch_repo_items

ci/github_project_drift_sync.py:256–280  ·  view source on GitHub ↗

Return [(node_id, number, kind), ...] for issues+PRs in the repo.

(
    owner: str, repo: str, include_closed: bool
)

Source from the content-addressed store, hash-verified

254
255
256def fetch_repo_items(
257 owner: str, repo: str, include_closed: bool
258) -> list[tuple[str, int, str]]:
259 """Return [(node_id, number, kind), ...] for issues+PRs in the repo."""
260 out: list[tuple[str, int, str]] = []
261 state_flag = "all" if include_closed else "open"
262 for kind, cmd in [("issue", "issue"), ("pr", "pr")]:
263 raw = run_gh(
264 [
265 cmd,
266 "list",
267 "--repo",
268 f"{owner}/{repo}",
269 "--state",
270 state_flag,
271 "--limit",
272 "1000",
273 "--json",
274 "id,number",
275 ]
276 )
277 items = json.loads(raw) if raw.strip() else []
278 for i in items:
279 out.append((str(i["id"]), int(i["number"]), kind))
280 return out
281
282
283def add_to_project(project_id: str, content_id: str) -> str | None:

Callers 1

mainFunction · 0.85

Calls 2

run_ghFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected