Repository navigation
Unify cc2flash CLI and build Windows executable for releases - #12
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Recovery bundles need atomic publication, and dry-run hardware-option rejection currently permits abbreviated options.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Consolidates camera recovery and maintenance into one installable cc2flash CLI, adds offline restore planning, and introduces Windows release executables.
Changes:
- Unifies CLI commands, packaging, safety checks, and terminology.
- Adds installation/CLI documentation and Windows executable workflows.
- Expands offline tests and executable smoke testing.
File summaries
| File | Description |
|---|---|
cc2flash/* |
Consolidates CLI, image, transport, display, and restore logic. |
tests/* |
Updates and expands unified CLI regression coverage. |
docs/* |
Adds installation and complete CLI references. |
README.md |
Updates user workflows for the unified CLI. |
hardware-recovery/* |
Updates recovery commands and terminology. |
usb-maintenance/* |
Updates references, checksums, and removes nested packaging. |
packaging/* |
Adds executable entry point and smoke test. |
.github/workflows/* |
Adds cross-platform tests and release executable publishing. |
pyproject.toml |
Defines root-level package metadata and dependencies. |
.gitignore |
Ignores generated PyInstaller specifications. |
Review details
Suppressed comments (2)
cc2flash/cli.py:513
argparseaccepts unique long-option prefixes by default, but this guard compares only exact spellings. For example,restore ... --dry-run --bootloader-t 5is parsed as--bootloader-timeoutand then silently accepted even though the documented contract says hardware options are rejected for an offline plan. Disable option abbreviation on therestoreparser (and add the abbreviated form to this regression test) so an explicitly supplied hardware setting cannot be ignored.
cc2flash/image.py:1585- The output directory is made visible before any bundle member is written. An I/O failure during the sequence below can therefore leave a partial bundle (potentially including a truncated recovery image), and because existing directories are now always refused, a retry cannot repair it. Build in a sibling temporary directory and atomically rename it into place only after all members and checksums have been written; clean up the temporary directory on failure.
- Files reviewed: 37/38 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
… audit pinned workflows
|
Addressed all review feedback in 3308e12 and replied to the inline threads.
Validation: 135 offline tests pass on Linux, Windows and macOS with Python 3.10/3.12; the Windows executable build and frozen smoke tests pass; zizmor passes. Locally, a supplied dump also passed a simulated final-file write failure followed by a clean, complete rebuild. No camera was accessed or firmware uploaded. CI: https://github.com/phryneas/cc2_camera_fix/actions/runs/34061804250 |
There was a problem hiding this comment.
🔵 Needs a closer look
The broad migration affects destructive hardware-recovery workflows and release distribution, warranting final human validation despite strong offline coverage.
Review details
- Files reviewed: 38/39 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Summary
Release behavior
Publishing a release manually in GitHub (including a prerelease) triggers a build from that release's commit. After tests and executable smoke checks pass, the workflow attaches cc2flash.exe and its SHA-256 checksum to the existing release.
The workflow does not create releases or tags. Saving a draft does not trigger it. Existing release assets are not overwritten. ADB remains a separate prerequisite.
Verification
Successful branch CI run