From 3ee5bdf8fd63a04c09f4f96eb63c93be1ddea2ea Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Sat, 2 Aug 2025 22:44:04 -0500 Subject: [PATCH] Support for syncing all properties (including context) to Probatem's Virtual Status Board. --- pit.nimble | 4 ++-- src/pit/cliconstants.nim | 2 +- src/pit/sync_pbm_vsb.nim | 12 ++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pit.nimble b/pit.nimble index 536f7db..7060eff 100644 --- a/pit.nimble +++ b/pit.nimble @@ -1,6 +1,6 @@ # Package -version = "4.29.1" +version = "4.29.2" author = "Jonathan Bernard" description = "Personal issue tracker." license = "MIT" @@ -27,4 +27,4 @@ requires @[ ] task updateVersion, "Update the version of this package.": - exec "update_nim_package_version pit 'src/pit/cliconstants.nim'" + exec "update_nim_package_version pit 'src/pit/cliconstants.nim'" \ No newline at end of file diff --git a/src/pit/cliconstants.nim b/src/pit/cliconstants.nim index 9abe7f3..7d49e14 100644 --- a/src/pit/cliconstants.nim +++ b/src/pit/cliconstants.nim @@ -1,4 +1,4 @@ -const PIT_VERSION* = "4.29.1" +const PIT_VERSION* = "4.29.2" const USAGE* = """Usage: pit ( new | add) [] [options] diff --git a/src/pit/sync_pbm_vsb.nim b/src/pit/sync_pbm_vsb.nim index 87d89ad..bafb23e 100644 --- a/src/pit/sync_pbm_vsb.nim +++ b/src/pit/sync_pbm_vsb.nim @@ -19,9 +19,11 @@ type lastUpdatedAt*: DateTime archivedAt*: Option[DateTime] tags*: seq[string] + context*: Option[string] parent*: Option[string] priority*: Option[string] project*: Option[string] + properties*: JsonNode milestone*: Option[string] hideUntil*: Option[DateTime] @@ -33,7 +35,7 @@ proc fromJsonHook(dt: var DateTime, n: JsonNode): void = #func `%`*(p: Project): JsonNode = toJson(p) -func `%`*(t: ServerTask): JsonNode = toJson(t) +proc `%`*(t: ServerTask): JsonNode = toJson(t) proc toServerTask(i: Issue): ServerTask = @@ -43,6 +45,12 @@ proc toServerTask(i: Issue): ServerTask = details: i.details, state: $i.state, tags: i.tags, + properties: %i.properties, + + context: + if i.hasProp("context"): some(i["context"]) + else: none[string](), + lastUpdatedAt: if i.hasProp("last-updated"): parseIso8601(i["last-updated"]) else: now(), @@ -80,7 +88,7 @@ proc initSyncContext*(pit: PitConfig, syncConfig: JsonNode): PbmVsbSyncContext = proc fetchServerTasks*(ctx: PbmVsbSyncContext): seq[ServerTask] = result = newSeq[ServerTask]() - let url = ctx.apiBaseUrl & "/tasks" + let url = ctx.apiBaseUrl & "/tasks?context=" & ctx.issueContext debug "Fetching tasks from server:\n\t" & url let resp = ctx.http.get(url)