Repository navigation
fix(tui): explain a branch that became unusable mid-session (#176) - #214
Merged
Merged
Conversation
NetBox Branching answers requests for a merged, archived or deleted branch with a plain-text 400. A framework-free classifier in nsc.branching.unusable recognizes exactly those middleware bodies (only while a branch is active) and the TUI error paths render them as "branch 'X' is no longer usable (status: ...)" instead of a bare API 400. Global search stops at the first such failure; bulk-edit failures carry the same message. Other 400s render unchanged. Claude-Session: https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb
…#176) The saved-filter store reported a branch-state 400 as a bare 'NetBox API 400 on ...' and silently swallowed it during the object-type lookup, so saves quietly diverted to config.yaml. The store now takes the active branch (wired by the TUI app and the --saved CLI path) and reports 'branch <name> is no longer usable' through the branch-state classifier. Adds pilot tests for every branch-aware TUI call site: detail save and delete, edit-form save, bulk-edit summary, record picker and list load-more. Claude-Session: https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb
Owner
Author
|
Rebased onto main after #213 (CHANGELOG conflict resolved). Tests + lint green locally. |
thomaschristory
force-pushed
the
feat/176-tui-branch-unusable
branch
from
October 25, 2026 10:50
3d6882a to
80dde63
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
If the active branch is merged, archived or deleted while
nsc tuiis open, NetBox Branching rejects later requests with a plain-text 400 (Selected branch is not ready./Invalid branch identifier). The TUI used to show that as a bareAPI 400. Now it saysbranch '<name>' is no longer usable (status: …)and points the user back to main.nsc/branching/unusable.pyclassifier (branch_unusable_error). It matches only the Branching middleware's exact plain-text bodies, and only while a branch is active, so validation 400s look the same as before.BranchUnusableErrorinnsc/branching/errors.py.apply_bulk(describe=...)), and global search. Global search stops at the first such failure.NativeSavedFilterStorenow takes the active branch. The TUI app and the--savedCLI path pass it in. When a save, load or delete falls back toconfig.yaml, the warning names the branch as the cause. This includes the object-type lookup, which used to fail silently.docs/guides/interactive-tui.mdanddocs/guides/branching.md. CHANGELOG entry under Unreleased.Closes #176
Test plan
just test: 1692 passed, 1 skippedjust lint: ruff, ruff format, mypy --strict all cleantests/branching/test_unusable.py)https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb