Migrate remaining in-repo workstream REST callers to /workplans
Point cleanup_stale_tasks, validate_repo_adr, custodian_cli, dashboard data loaders, extensions poll, MCP legacy resource, and consistency_check task queries at preferred /workplans routes. Add caller inventory evidence doc.
This commit is contained in:
parent
050cbbceb9
commit
b05ca2ca8c
10 changed files with 66 additions and 16 deletions
|
|
@ -241,14 +241,14 @@ def cmd_register(args: argparse.Namespace) -> None:
|
|||
print(f"==> Creating onboarding workstream '{ws_slug}' ...")
|
||||
# Check if it already exists
|
||||
existing_ws = next(
|
||||
(w for w in _api_get("/workstreams/") if w.get("slug") == ws_slug and w.get("status") == "active"),
|
||||
(w for w in _api_get("/workplans/") if w.get("slug") == ws_slug and w.get("status") == "active"),
|
||||
None,
|
||||
)
|
||||
if existing_ws:
|
||||
print(" Onboarding workstream already exists — skipping task creation.")
|
||||
if repo_id and not existing_ws.get("repo_id"):
|
||||
existing_owner = existing_ws.get("owner")
|
||||
_api_patch(f"/workstreams/{existing_ws['id']}/", {
|
||||
_api_patch(f"/workplans/{existing_ws['id']}/", {
|
||||
"repo_id": repo_id,
|
||||
"owner": repo_slug if existing_owner in (None, domain) else existing_owner,
|
||||
})
|
||||
|
|
@ -260,7 +260,7 @@ def cmd_register(args: argparse.Namespace) -> None:
|
|||
)
|
||||
else:
|
||||
try:
|
||||
ws = _api_post("/workstreams/", {
|
||||
ws = _api_post("/workplans/", {
|
||||
"topic_id": topic_id,
|
||||
"title": f"Repo Integration: {repo_slug}",
|
||||
"slug": ws_slug,
|
||||
|
|
@ -430,7 +430,7 @@ def cmd_create_workstream(args: argparse.Namespace) -> None:
|
|||
|
||||
slug = args.slug or re.sub(r"[^a-z0-9]+", "-", args.title.lower()).strip("-")
|
||||
|
||||
ws = _api_post("/workstreams/", {
|
||||
ws = _api_post("/workplans/", {
|
||||
"topic_id": topic_id,
|
||||
"title": args.title,
|
||||
"slug": slug,
|
||||
|
|
@ -460,7 +460,7 @@ def cmd_create_task(args: argparse.Namespace) -> None:
|
|||
# Resolve workstream: accept UUID or slug
|
||||
workstream_id = args.workstream
|
||||
if not _is_uuid(workstream_id):
|
||||
wss = _api_get("/workstreams/")
|
||||
wss = _api_get("/workplans/")
|
||||
match = next((w for w in wss if w.get("slug") == workstream_id), None)
|
||||
if not match:
|
||||
print(f"ERROR: No workstream found with slug '{workstream_id}'.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue