arch-insight-cli 0.4.1__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arch-insight-cli
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Command-line client for ARCH-Insight tasks, factsheets, secrets, and developer platform.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,3 +1,3 @@
1
1
  """ARCH-Insight command-line client."""
2
2
 
3
- __version__ = "0.4.1"
3
+ __version__ = "0.4.2"
@@ -478,13 +478,23 @@ def document_create(args):
478
478
  def task_update(args):
479
479
  body = {k: v for k, v in (("status", args.status), ("priority", args.priority),
480
480
  ("due_date", args.due_date), ("title", args.title)) if v is not None}
481
+ if args.description_file:
482
+ body["description"] = comms.read_text(args.description_file)
483
+ elif args.description is not None:
484
+ body["description"] = args.description
481
485
  if args.assignee:
482
486
  body["assignees"] = args.assignee
483
487
  if not body:
484
- raise CliError("Nothing to change: pass --status, --assignee, --due-date, --priority or --title.")
488
+ raise CliError("Nothing to change: pass --status, --assignee, --due-date, --priority, "
489
+ "--title or --description.")
485
490
  emit(request(args, "PUT", f"/api/agile/tasks/{args.task_id}", body))
486
491
 
487
492
 
493
+ def task_delete(args):
494
+ request(args, "DELETE", f"/api/agile/tasks/{args.task_id}")
495
+ emit({"deleted": args.task_id})
496
+
497
+
488
498
  def ticket_list(args):
489
499
  page = request(args, "GET", "/api/tickets")
490
500
  emit([{k: r.get(k) for k in ("id", "title", "status", "priority", "due_date")}
@@ -690,7 +700,13 @@ def build_parser():
690
700
  tu.add_argument("--due-date")
691
701
  tu.add_argument("--title")
692
702
  tu.add_argument("--assignee", action="append")
703
+ tu.add_argument("--description")
704
+ tu.add_argument("--description-file")
693
705
  tu.set_defaults(func=task_update)
706
+ td = [a for a in areas.choices["task"]._subparsers._group_actions][0].add_parser(
707
+ "delete", help="Delete a task")
708
+ td.add_argument("task_id", type=int)
709
+ td.set_defaults(func=task_delete)
694
710
  return parser
695
711
 
696
712
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arch-insight-cli
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Command-line client for ARCH-Insight tasks, factsheets, secrets, and developer platform.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arch-insight-cli"
3
- version = "0.4.1"
3
+ version = "0.4.2"
4
4
  description = "Command-line client for ARCH-Insight tasks, factsheets, secrets, and developer platform."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -127,3 +127,16 @@ def test_org_show_leaves_out_billing_identifiers(monkeypatch):
127
127
  text = str(shown[0])
128
128
  assert "cus_1" not in text and "tok" not in text and "'J'" not in text
129
129
  assert shown[0]["members"] == [{"name": "a", "email": "a@x", "roles": ["Admin"]}]
130
+
131
+
132
+ def test_task_description_and_delete(monkeypatch, tmp_path):
133
+ sent = []
134
+ monkeypatch.setattr(main, "request", lambda args, method, path, body=None, **kw: sent.append((method, path, body)) or {})
135
+ monkeypatch.setattr(main, "emit", lambda value: None)
136
+ f = tmp_path / "d.md"
137
+ f.write_text("line one\n- detail", encoding="utf-8")
138
+ for argv in (["task", "update", "5", "--description-file", str(f)], ["task", "delete", "6"]):
139
+ args = main.build_parser().parse_args(argv)
140
+ args.func(args)
141
+ assert sent == [("PUT", "/api/agile/tasks/5", {"description": "line one\n- detail"}),
142
+ ("DELETE", "/api/agile/tasks/6", None)]