Modernize compare-html CLI#14
Merged
Merged
Conversation
- Rename compare_output.py to compare_output_cli.py - Move shared comparison primitives (compare_files, comparable_file, ...) and logging helpers into common.py so the CLI and server share them instead of the server importing from a CLI module - Rich-based CLI: live progress bar showing in-flight files transiently, keeping only failures visible, with a failure summary at the end - Flat full-path output instead of a tree view, matching the server - Parallel comparison workers (-j/--max-workers) with one browser per worker thread, as in the server - Degrade gracefully in CI / non-TTY: no live region, periodic heartbeat, and GitHub Actions ::error:: annotations for failures - Add -v/--verbose, --log-file, --log-file-verbosity logging options - Add --driver none to compare only JSON / byte-identical files (no browser) - Add rich dependency and repoint the compare-html entry point Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SujCMUVctCunqAft7ttLFd
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.
Reworks the
compare-htmlCLI (formerlycompare_output.py) into a modern, CI-friendly tool.Changes
Rename & structure
compare_output.py→compare_output_cli.py; entry pointcompare-htmlrepointed inpyproject.toml.compare_files,compare_html,compare_json,comparable_file,parse_json) and logging helpers (setup_logging,verbosity_to_level) moved intocommon.py. The server now imports fromcommoninstead of importing from a CLI module.CLI UX (rich)
Parallelism
-j/--max-workersruns comparisons across a thread pool with one browser per worker thread (same model as the server).CI / GitHub
CIand drops the live region, printing failures inline plus a periodic heartbeat.::error file=…::annotations for failures so they surface in the PR UI.Logging & misc
-v/--verbose,--log-file,--log-file-verbosity(shared with the server).--driver nonecompares only JSON / byte-identical files without launching a browser.0all match,1differences/missing,2bad arguments.weird[name].json).Verification
Exercised end-to-end against a fixture (matches, differing JSON, missing files, missing dirs, bracketed names) in plain, GitHub-annotation, and forced-TTY live modes; verified exit codes and that the existing browser-free test still passes. Browser-dependent comparisons were not run here (no Selenium browser in this environment).
🤖 Generated with Claude Code
https://claude.ai/code/session_01SujCMUVctCunqAft7ttLFd