Repository navigation
fix: harden SMART scan, site links and CI gates - #48
Conversation
- maintenance: a disk whose smartctl output is not JSON no longer aborts the whole report; the device is named as unreadable and the remaining disks plus their state file keep working (regression test added). - site: repository-relative file links (CHANGELOG.md and friends) point at the GitHub blob, headings get GitHub-style anchors so the upstream #-installation, #health-monitoring--alerts and #relaying-through-an-external-smtp-provider links resolve again. - pages workflow: rebuild on README/README.de.md changes because the guide reads them at build time; pin all actions to commit SHAs. - ci: new documentation-site job builds Astro, verifies the five routes, key commands and anchors, and runs npm audit on pull requests. - readme: keep HEALTH_MAIL_TO commented out in the alert quick start so --test-notify proves ntfy instead of failing on a missing MTA.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e6af6940c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| except (ValueError, CommandError): | ||
| # One unreadable disk must never hide the health of the remaining ones. | ||
| lines.extend(['', '{} ({})'.format(dev, disk.get('model') or 'unbekanntes Modell'), | ||
| 'SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.']) | ||
| continue |
There was a problem hiding this comment.
Propagate cancellation instead of treating it as a disk failure
When a user cancels an in-progress SMART query, Runner.run() raises CommandError with its cancellation event set. This handler now swallows that exception, skips the remaining disks, and reaches write_json() with an incomplete or empty baseline, even though the UI reports the operation as cancelled. Re-raise cancellation errors before handling ordinary disk failures, as sections_report() already does, so cancelling a scan does not overwrite SMART history.
Useful? React with 👍 / 👎.
| continue | ||
| if not isinstance(data, dict): | ||
| lines.extend(['', '{} ({})'.format(dev, disk.get('model') or 'unbekanntes Modell'), | ||
| 'SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.']) | ||
| continue |
There was a problem hiding this comment.
Preserve previous SMART baselines for unreadable disks
If a disk with an existing baseline temporarily returns invalid JSON, this continue leaves its identity out of current, and the final write_json() replaces smart.json without that disk's history. On the next successful scan, previous.get(identity, {}) is empty, so increased error counters are reported without their delta since the last successful measurement. Previously the parse failure aborted before replacing the baseline. Retain existing entries for unreadable disks while updating the successfully queried disks.
Useful? React with 👍 / 👎.
Follow-up to the repository audit.
smartctlanswer for one disk is reported and skipped instead of aborting the report; remaining disks andsmart.jsonstill update. Regression test fails on the old code.CHANGELOG.md/file links now point at the GitHub blob instead of 404ing under/anleitung/; headings carry GitHub-style anchors so#-installation,#health-monitoring--alertsand#relaying-through-an-external-smtp-providerresolve.npm audit.HEALTH_MAIL_TOcommented out so--test-notifyproves ntfy.Local verification:
tests/maintenanceOK,tests/run.sh141/141,npm run build5 pages,npm audit --omit=dev0 vulnerabilities.