V0.38.5 git board rewrite (#238)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-25 22:24:59 +00:00
committed by xcaliber
parent 495bcc94f4
commit c03ece4230
24 changed files with 1354 additions and 413 deletions

View File

@@ -3,7 +3,7 @@
"title": "Gitea API Client",
"type": "library",
"tier": "starlark",
"version": "1.0.0",
"version": "1.0.1",
"description": "Shared Gitea client — connections, API helpers, optional data caching.",
"author": "switchboard",

View File

@@ -15,9 +15,19 @@
# json — encode/decode (universal)
load("star/http_helpers.star", "gitea_get", "gitea_post", "gitea_patch", "auth_headers", "resp")
load("star/repos.star", "get_repos")
load("star/issues.star", "get_issues", "get_issue", "create_issue", "update_issue", "add_comment")
load("star/ci.star", "get_ci_status")
load("star/repos.star", _repos_get = "get_repos")
load("star/issues.star", _issues_get = "get_issues", _issue_get = "get_issue", _issue_create = "create_issue", _issue_update = "update_issue", _comment_add = "add_comment")
load("star/ci.star", _ci_get = "get_ci_status")
# Re-export loaded functions so lib.require() can find them in globals.
# Starlark load() names are file-local; explicit assignment makes them global.
get_repos = _repos_get
get_issues = _issues_get
get_issue = _issue_get
create_issue = _issue_create
update_issue = _issue_update
add_comment = _comment_add
get_ci_status = _ci_get
# ═══════════════════════════════════════════════
@@ -111,12 +121,15 @@ def get_prs(conn, owner, repo, state):
items = []
for p in data:
items.append({
"number": p.get("number", 0),
"title": p.get("title", ""),
"state": p.get("state", ""),
"head": p.get("head", {}).get("ref", ""),
"base": p.get("base", {}).get("ref", ""),
"user": (p.get("user") or {}).get("login", ""),
"number": p.get("number", 0),
"title": p.get("title", ""),
"state": p.get("state", ""),
"head": p.get("head", {}).get("ref", ""),
"base": p.get("base", {}).get("ref", ""),
"user": (p.get("user") or {}).get("login", ""),
"created_at": p.get("created_at", ""),
"html_url": p.get("html_url", ""),
"mergeable": p.get("mergeable", None),
})
return items

View File

@@ -13,11 +13,14 @@ def get_issues(conn, owner, repo, state):
for i in data:
labels = [l.get("name", "") for l in (i.get("labels") or [])]
items.append({
"number": i.get("number", 0),
"title": i.get("title", ""),
"state": i.get("state", ""),
"labels": labels,
"assignee": (i.get("assignee") or {}).get("login", ""),
"number": i.get("number", 0),
"title": i.get("title", ""),
"state": i.get("state", ""),
"labels": labels,
"assignee": (i.get("assignee") or {}).get("login", ""),
"created_at": i.get("created_at", ""),
"updated_at": i.get("updated_at", ""),
"html_url": i.get("html_url", ""),
})
return items