From 684068a81103e9a9dace2f5cc6fd49edc1f01ab1 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 20:26:50 -0500 Subject: feat(save): add the priority, state, and labels savers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are three more savers on the atomic engine, each the same spec shape the assignee saver proved, with its own field handling. Priority reads the cookie's number, diffs it against LINEAR-PRIORITY, and pushes priority. State is the picker arm — the explicit LINEAR-STATE-ID against LINEAR-STATE-ID-SYNCED, pushing stateId, with use-remote rewriting the keyword and name from the fetched node (the keyword-cycle arm stays gated on the derivation task). Labels canonicalize the id set to a sorted space-joined string so the diff is order-insensitive, and push labelIds. Canonicalizing labels to a string also keeps the missing-baseline check honest: an issue with no labels has a present-but-empty baseline, which a nil-vs-empty-list comparison would misread as a legacy file. A shared set of pearl--node-* helpers pulls each field out of the raw issue node. I also fixed pearl--get-linear-priority-name, which mapped None to "Medium" — it now reads "None", so the conflict prompt names the priority honestly. It's still not wired into save-issue — the next commit does that. --- tests/test-pearl-mapping.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test-pearl-mapping.el') diff --git a/tests/test-pearl-mapping.el b/tests/test-pearl-mapping.el index d9854cb..17eff82 100644 --- a/tests/test-pearl-mapping.el +++ b/tests/test-pearl-mapping.el @@ -124,11 +124,11 @@ outlive a change to `pearl-state-to-todo-mapping'." (should (string-equal "Medium" (pearl--get-linear-priority-name 3))) (should (string-equal "Low" (pearl--get-linear-priority-name 4)))) -(ert-deftest test-pearl-get-linear-priority-name-nil-and-unknown-default-medium () - "A nil, zero, or out-of-range priority falls back to Medium." - (should (string-equal "Medium" (pearl--get-linear-priority-name 0))) - (should (string-equal "Medium" (pearl--get-linear-priority-name nil))) - (should (string-equal "Medium" (pearl--get-linear-priority-name 99)))) +(ert-deftest test-pearl-get-linear-priority-name-none-and-unknown () + "Zero (None), nil, and out-of-range priorities read as None." + (should (string-equal "None" (pearl--get-linear-priority-name 0))) + (should (string-equal "None" (pearl--get-linear-priority-name nil))) + (should (string-equal "None" (pearl--get-linear-priority-name 99)))) ;;; pearl-get-priorities -- cgit v1.2.3