BACK-472 - Refactor config to shared descriptor map, fix config list visibility#639
BACK-472 - Refactor config to shared descriptor map, fix config list visibility#639lenucksi wants to merge 1 commit into
Conversation
ebe7108 to
5c8ac7b
Compare
MrLesk
left a comment
There was a problem hiding this comment.
Alex's Agent: Thanks for the PR. I agree there is a real usability issue around config visibility, but I do not think this is ready to merge as-is yet.
A few things need to be addressed:
-
The PR references
BACK-472, but I do not see a matching Backlog task in the branch. The GitHub issue with that number is unrelated, and the PR diff does not include a task file. Please add the task details so the PR matches the project workflow. -
terminalStatusesis exposed through config get/set/list and stored in YAML, but the product behavior still ignores it. Cleanup and terminal-status behavior still use the last configured status fromstatusesthroughgetTerminalStatus(statuses)/isTerminalStatus(status, statuses). If this config key is added, it should be wired into the actual terminal-status behavior everywhere it matters, with tests for cleanup and the web cleanup affordance. If that is not intended for this PR, I would avoid adding this config field. -
blockedStatuseshas the same issue: it can be set and listed, but web/TUI styling still uses the existing hardcoded status-name heuristics. That makes the setting look supported even though it has no effect. -
config liststill hides both new keys when they are unset. Since this PR is specifically about omitted config values, please make the intended discovery behavior explicit and consistent with the existing optional entries, or keep the PR focused on fields that already have real behavior.
I would recommend narrowing this PR to a small, behavior-backed fix: either make the new config keys actually drive the terminal/blocked status behavior end to end, or remove those new keys and only refactor/list config values that already exist and are supported.
…visibility Introduce CONFIG_DESCRIPTORS as a single source of truth for all config keys. config get now dispatches through the map; config list loops over it instead of hardcoded console.log calls. config get now supports taskPrefix (was list-only). config set error message derives available keys from the descriptor map. No terminalStatuses or blockedStatuses entries — designed for trivial extension once BACK-480/BACK-481 land (adding a new key is a one-liner in the map). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5c8ac7b to
3f59ff8
Compare
|
Force-push note: This PR has been narrowed in scope per the review feedback. What changed:
What stayed / was added:
|
Summary
config get/config listused a hardcoded switch statement and hardcodedconsole.logsequence respectively — adding any new config key required editing three separate places in a 3700-line fileconfig get taskPrefixwas unsupported (taskPrefix only appeared inconfig list)CONFIG_DESCRIPTORSmap as single source of truth —config getdispatches through it,config listloops over it; new fields are a one-liner in the mapChanges
src/cli.ts: AddCONFIG_DESCRIPTORSrecord as single source of truth. Replaceconfig getswitch with map lookup. Replaceconfig listhardcoded block with descriptor loop. Deriveconfig seterror message from map automatically.config get taskPrefixnow works.src/test/config-commands.test.ts: 3 new tests —config get taskPrefix, unknown-key error includestaskPrefix,config listshows all descriptor keys including optional unset ones.Designed to be extended with
terminalStatuses/blockedStatusesentries once BACK-466 (PR #635) and BACK-468 (PR #637) are merged — adding them will be a one-liner in the descriptor map.Test plan
bun test src/test/config-commands.test.ts→ 11 passbunx tsc --noEmit→ cleanbun run check .→ clean (pre-existingpackage.jsonformatting issue in upstream excluded)backlog config get taskPrefix→ returnstaskbacklog config get __nonexistent__→ error liststaskPrefixin available keysbacklog config list→ shows all keys including unset optional ones🤖 Generated with Claude Code