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

Function main

ci/github_project_drift_sync.py:298–418  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296
297
298def main() -> int:
299 owner = os.environ.get("PROJECT_OWNER", "").strip()
300 number_raw = os.environ.get("PROJECT_NUMBER", "").strip()
301 feeders_raw = os.environ.get("FEEDER_REPOS", "").strip()
302 include_closed = os.environ.get("INCLUDE_CLOSED", "false").lower() == "true"
303 status_field_name = (
304 os.environ.get("STATUS_FIELD_NAME", "Status").strip() or "Status"
305 )
306 triage_option_name = (
307 os.environ.get("TRIAGE_OPTION_NAME", "Triage").strip() or "Triage"
308 )
309 date_field_name = (
310 os.environ.get("DATE_FIELD_NAME", "Date posted").strip() or "Date posted"
311 )
312
313 if not owner or not number_raw or not feeders_raw:
314 print(
315 "PROJECT_OWNER, PROJECT_NUMBER, FEEDER_REPOS must all be set",
316 file=sys.stderr,
317 )
318 return 2
319 number = int(number_raw)
320 feeders = [r.strip() for r in feeders_raw.split(",") if r.strip()]
321
322 print(f"Project: {owner}/projects/{number}")
323 print(f"Feeders: {feeders}")
324 print(f"Include closed: {include_closed}")
325
326 project_id = resolve_project_node_id(owner, number)
327 print(f"Project node: {project_id}")
328
329 status_field_id, triage_option_id = fetch_status_field(
330 owner, number, status_field_name, triage_option_name
331 )
332 date_field_id = fetch_date_field(owner, number, date_field_name)
333 print(
334 f"Status field: {status_field_id[:20]}... '{triage_option_name}' option: "
335 f"{triage_option_id[:10]}"
336 )
337 print(f"Date field: {date_field_id[:20]}... ('{date_field_name}')")
338
339 existing_keys, items_without_status, items_without_date = fetch_project_items(
340 owner, number, status_field_name, date_field_name
341 )
342 print(f"Project currently has {len(existing_keys)} linked items")
343 print(f" (of which {len(items_without_status)} have no Status set)")
344 print(f" (of which {len(items_without_date)} have no Date posted set)")
345
346 added = 0
347 failed = 0
348 status_set = 0
349 status_failed = 0
350 date_set = 0
351 date_failed = 0
352
353 # ---- Part 1: add missing items ----
354 new_item_ids: list[tuple[str, str]] = [] # (item_id, content_node_id)
355 for repo in feeders:

Callers 1

Calls 13

resolve_project_node_idFunction · 0.85
fetch_status_fieldFunction · 0.85
fetch_date_fieldFunction · 0.85
fetch_project_itemsFunction · 0.85
fetch_repo_itemsFunction · 0.85
add_to_projectFunction · 0.85
set_status_triageFunction · 0.85
listClass · 0.85
fetch_content_created_atFunction · 0.85
set_date_postedFunction · 0.85
printFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected