Repository navigation
feat(output): render branch merge/sync conflicts as a table on a terminal (#169) - #205
Merged
Merged
Conversation
…inal (#169) A `conflict` envelope printed details.conflicts as a raw, truncated Python dict. On rich stderr, render one row per conflicting field with the object and its original/branch/main values (shape from netbox-branching 1.2.2). Unexpected payloads keep the raw details line; JSON output is unchanged. Also drop soft_wrap from the error panel console: inside a Panel it cropped long lines, hiding e.g. "re-run with --acknowledge-conflicts". Claude-Session: https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb
Rich's markup escape() and Text() don't strip ESC, so server-sourced text in the TTY error panel (message, endpoint, op id, and the new conflict table cells) could carry terminal escape sequences, e.g. an object name that retitles or clears the terminal. Show control and format characters as visible \x.. escapes. Flagged by the automated security review on #205. Claude-Session: https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb
Owner
Author
|
Pushed 654e777: security review flagged raw ESC sequences in the error panel (conflict cells, and pre-existing for error/endpoint/op lines). Control/format chars now render as visible \x.. escapes; test added. |
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.
Fixes #169.
On a terminal, a
conflictenvelope (exit 10) printeddetails.conflictsas a raw Python dict. The panel cropped it, along with the end of the message.Change (
nsc/output/errors.py, rich stderr only):details.conflictsrenders as a table with one row per conflicting field: object, field, original, branch, main. The object name appears on its first row.object_type,object_repr,conflicts, andconflicting_data.{original,branch,main}.conflicting_datastill lists the fields.details:line, so nothing is dropped.branch, stay on thedetails:line.render_to_jsonis untouched.The error panel's console no longer uses
soft_wrap=True. Inside aPanel, that cropped long lines instead of wrapping them, which cut offre-run with --acknowledge-conflicts.Live, NetBox 4.7.3 + Branching 1.2.2, TTY:
-o jsonstill returns the raw list. The branching e2e suite passed locally (4 passed).Tests:
tests/output/test_errors_conflicts.pyuses the real payload shape. It covers:conflicting_data;main.Docs:
docs/guides/branching.md(conflicts section), CHANGELOG.https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb