Skip to content

mirror-check: one rclone copy --checksum per branch, drop unused options - #1654

Merged
AskAlexSharov merged 1 commit into
mainfrom
feature/lystopad/mirror-check-simplify
Nov 23, 2026
Merged

AskAlexSharov merged 1 commit into
mainfrom
feature/lystopad/mirror-check-simplify

Conversation

@lystopad

Copy link
Copy Markdown
Member

Follow-up to #1647, from the review in #1647 (comment).

Change

  • One rclone copy --checksum per branch replaces the compare / copy / verify rounds (compare, count_extra, toml_count). Report-only runs add --dry-run.
    • --checksum compares size and MD5. The tomls are single-part uploads, so R2's ETag is their MD5 and comes with the listing: only the differing files are sent, and rclone checks each upload.
    • --combined gives the per-file result also with --dry-run: +/* are the files copied (or out of sync), - the files only in the bucket (the note column).
    • Any error (listing, upload) ends with a non-zero exit, so the branch fails. The old special cases for errors that rclone reported only through its exit status are gone.
    • A merge during the run is not re-checked; it gets its own Mirror run, and the next daily check covers a failed one.
  • Removed options that nothing sets: REMOTE_TYPE (the check now requires s3), EXCLUDE_PATTERNS, and the MIRROR_CHECK_* repository variables. main release/* and 90 days are now constants in the script. The branches input still covers one-off runs.
  • Removed the test_notification input and its 7 conditions. To test the webhook after a rotation, send one request to it by hand.

The script is 64 lines shorter (247 → 183), the workflow 16 (129 → 113). The report, the alerts and the exit status keep their meaning.

Tested

Locally, with a stubbed rclone (copy with --checksum, --combined, --dry-run) and a local git repo: in sync; a differing, a missing and a bucket-only file (repaired / reported, note 1 toml files only in the bucket); report-only (no alert, bucket unchanged); a new branch (published); an old branch (skipped); a published branch without tomls; a failed copy (FAILED, exit 1, account id redacted); a remote of the wrong type (exit 1); the branches filter. bash -n and the workflow YAML parse. ShellCheck was not run locally.

The report-only run on this PR exercises the new rclone command against the bucket.

@AskAlexSharov
AskAlexSharov merged commit 4171570 into main Nov 23, 2026
2 checks passed
@AskAlexSharov
AskAlexSharov deleted the feature/lystopad/mirror-check-simplify branch November 23, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants