98d7b0d9b86326dfe3bf64384078b71ccbcb772f
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
cdd605c189 |
GUI round 7: code-review remediation (flash safety, unknown-actual colour, credentials, coverage)
build-test-release / release (push) Successful in 10m0s
Fixes the Critical/High findings from the round-6 review (6 parallel dimension reviewers + adversarial verify), plus the cheap high-value non-blocking ones. Full write-up in code-review-report.md. Firmware-flash safety (the one irreversible, hardware-destroying action): - Critical: re-triggering an action no longer races the previous one. A flash now takes an exclusive lock (new App.flashing): it will not start while any scan / refresh / config action is running, and none of those (nor another flash) start while it runs. begin_scan, start_action, start_refresh and apply_flash_confirm all gate on it, and the context menu offers only the read-only "Open in browser" while flashing. This removes the two overlapping- network-operation paths that could interrupt/corrupt an upload and brick a miner (old.stop() never joined the in-flight upload). - High: the flash confirm dialog now lists every target IP + model and warns loudly when the batch spans more than one model (a single image is rarely valid for all), instead of showing only a bare count. Correctness: - High: combined columns no longer paint the "-" placeholder solid red when the actual is unknown but the expected is known (an idle/paused/booting miner of a recognised model looked like a 0% catastrophic failure). fill_rows now gates the ratio on the actual being known; unknown-actual falls to the plain, uncoloured segment. Was masked by the all-zero-expected fixtures. - compute_kpis buckets by status() instead of re-deriving the precedence from raw flags (KPI header can no longer disagree with a row's status; offline folds into not_hashing). Security: - credentials file is created at 0600 up front (OpenOptions::mode) and re-tightened while still empty, so the plaintext password is never on disk under a looser mode (was create-0644 then chmod-0600). - the "Set scan credentials" dialog no longer pre-fills the saved password in plaintext; a blank Password field keeps the stored one. Robustness / API: - the fake-scan branches of the config-action / refresh / flash background threads now honour the cancel flag (were ignored, so stop() was a no-op). - MinerRow.online -> offline (default false = online), removing the footgun where a struct-update literal that forgot `online: true` read back offline. Tests (the review's primary focus -- these paths had zero coverage): - scan.rs fake_mode_background_actions: start_scan offline-row emission, start_refresh (Row/Failed/Done), start_firmware_flash_action, and that a cancelled run still terminates with Done rather than hanging. - model.rs: flash_confirmed (exact/case/prefix/whitespace), compute_kpis vs status() consistency, Default-is-online. - new ui::tests: ratio_color/fan_color/tint_toward stops+clamping+blends, and the combined-cell unknown-actual and cooling-cell encodings. - credentials.rs: configured_factory smoke (both branches) + pre-existing-0644 re-tighten. - self-test: offline row (.199) spot-check, KPI quick-filter toggle on/off, and a numeric (not lexical) IP-sort assertion via model::ip_to_u32. Deferred (non-blocking, tracked in code-review-report.md): start_* boilerplate extraction; per-model firmware image-compatibility check; scoping saved credentials to a chosen backend; a masked password field (needs a wx-rs TE_PASSWORD binding); flash-specific status text; a segment-encode microbench. Verified: cargo check --release --tests is clean; unit tests + benches + the headless self-test run in CI (local release link is OOM-blocked on this desktop). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh |
||
|
|
47dfa55502 |
CI: make the headless UI self-test a hard gate
build-test-release / release (push) Successful in 5m46s
The self-test was continue-on-error while the container display path was unproven. Run 529 confirmed it launches and passes (SELFTEST PASS) once xauth was installed, so remove continue-on-error: a future regression that breaks GUI init now fails the build instead of releasing silently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh |
||
|
|
44e76f25e4 |
GUI + CI: code-review-harness fixes, expanded tests, version-logic tests
build-test-release / release (push) Successful in 5m47s
Ran the code-review-harness (four parallel reviewers: correctness, reliability, performance, test-coverage) over the GUI crate and fixed every Critical/High finding, plus grew the test + microbenchmark suite that gates the pipeline. Correctness / reliability fixes: - IP column sorted lexically, not numerically. The default view is IP-ascending but Column::Ip fell through to the generic lowercase-string sort key, so 10.255.1.10 sorted before 10.255.1.2 on every launch. Add a numeric IP sort key (u32, exact in f64) and switch view() to decorate-sort-undecorate so a sort key is computed once per row, not twice per comparison. - Scans had no cancellation. Stop/Apply/Play only dropped the receiver, leaving the background thread probing dead hosts (each waits out an asic-rs timeout), and Play could spawn a second concurrent scan + tokio runtime. Add a ScanHandle with an Arc<AtomicBool> cancel flag the loop checks each iteration, a begin_scan() helper that stops the in-flight scan before starting a new one, and Stop now signals cancellation. - Native column drag never rebuilt the control: column_reordered mutated view.order but skipped rebuild_table(), so the store's creation order diverged from display_columns() and cells rendered under the wrong headers on the next scan tick. Rebuild after applying the reorder. - format_si rounding rolled a mantissa up to "1000" without advancing the SI prefix (999.9 W -> "1000 W", a 4-digit result). Round first, then roll over; [99.95,100) drops its decimal. - start_scan used .expect() on thread spawn, which would panic across the wx FFI boundary; it now sends ScanMsg::Failed and returns the handle. Tests / benchmarks (the pipeline's regression gate): - Unit tests 24 -> 41: format_si/format_uptime boundaries, numeric IP sort, upsert-new-IP, Light three-state + pool-slot-out-of-range cells, filter AND/OR, reorder non-permutation guard; scan.rs parse_cidr/prefix_mask, single-host /32, empty/whitespace, short-range single/reversed, parse_targets aggregate cap + error propagation, validate_ranges, targets_to_cidrs non-contiguous, auto-rescan-secs round-trip. - Microbenchmarks 2 -> 9: view default-sort, sort-by-each-column, filtered view, upsert cold-start, parse_line near MAX_ADDRS, parse_targets many ranges, targets_to_cidrs large range. Floors are 5-10x above local numbers. - New ci/test-compute-version.sh: 9 cases for the X.Y.Z logic (first release, pre-bumped X, backend/UI bumps, docs-only no-op, major-wins-over-UI, backend-wins-over-UI, nested ci/ and thirdparty/wx-rs paths). Wired in as a fast-fail CI step. CI: install libssl-dev + pkg-config (openssl-sys); add xauth so the headless self-test actually launches under xvfb (was aborting on "xauth not found"). Deferred (documented in code-review-report.md, guarded by benches): Cow cells, an ip->index map for upsert. Local: 41 tests + 9 benches + 9 shell tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh |