Skip to content

Commit 5b092b2

Browse files
[Crane: crane-migration-python-to-go-full-apm-cli-rewrite] Iteration 71: fix benchmark gate (deps Console width under TERM=dumb) (#112)
* fix(deps): pass height=24 to Console to bypass Rich TERM=dumb width fallback Rich's Console.size property only honours an explicit width when both _width and _height are set. When only width is passed, it falls through to is_dumb_terminal and returns 80 columns, truncating long package names in the `deps list` table (e.g. 'microsoft/apm-package-alpha' -> 'microsof...'). Fix: supply height=24 alongside the explicit width so the fast path is taken regardless of the TERM environment variable. Also add COLUMNS=10000 to the benchmark subprocess env as a belt-and- suspenders guard for future Rich version changes. Verification: all 13 migration gates now pass (migration_score=1.0). Run: https://github.com/githubnext/apm/actions/runs/27041238237 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger checks --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 101f162 commit 5b092b2

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/ci/migration_cli_benchmark.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,9 @@ def main() -> int:
543543
"NO_COLOR": "1",
544544
"TERM": "dumb",
545545
"PYTHONUNBUFFERED": "1",
546+
# Prevent Rich from truncating long package names in table output.
547+
# Matches the COLUMNS=10000 convention used in parity_completion_test.go.
548+
"COLUMNS": "10000",
546549
}
547550
)
548551

src/apm_cli/commands/deps/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def list_packages(global_, show_all, insecure_only):
405405
from rich.console import Console
406406

407407
term_width = shutil.get_terminal_size((120, 24)).columns
408-
console = Console(width=max(120, term_width))
408+
console = Console(width=max(120, term_width), height=24)
409409
has_rich = True
410410
except ImportError:
411411
has_rich = False

0 commit comments

Comments
 (0)