mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-30 11:05:32 +01:00
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , dependency-freshness) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (0) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (1) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (2) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (3) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (4) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (5) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (6) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (7) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (8) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (9) (push) Waiting to run
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Todo: 04ad52f9
1.6 KiB
1.6 KiB
Plan: Fix screen-locker 'git fetch/worktree' red (nolimit-red)
Problem
nolimit.red found 'git fetch/worktree' red (git) because git pull --ff-only
in scripts/deploy.sh fails with exit 1 when github.com cannot be resolved
(DNS/network transient failure):
fatal: unable to access 'https://github.com/kuhyx/screen-locker.git/':
Could not resolve host: github.com
Accepted fix (recommended answer taken)
Wrap the git pull --ff-only in scripts/deploy.sh with a retry loop using
exponential backoff so transient DNS/network failures self-heal within 1 s
instead of failing immediately. Behaviour is unchanged when the network works:
- First-attempt success returns immediately (no delay).
- Only transient failures (non-zero rc) trigger retries.
- Permanent failures (e.g. dirty tree, diverged branch) still die after the final attempt.
- Non-git behaviour (install.sh, systemctl restart, PID rotation checks) is untouched.
Changes
scripts/deploy.sh:
- Added a
retry() { ... }helper (max attempts, base delay, command...). Delay grows as base * 2^(attempt-1) via awk (no external deps). git -C "$LIVE" pull --ff-onlyis now called viaretry 5 1 ...(attempts at ~0, 1, 2, 4, 8 s; well under a 1 s SLA when github.com resolves on the first try, and bounded otherwise).
Done check
- bash -n scripts/deploy.sh passes (syntax valid).
- retry() tested: succeeds on first try with no delay; succeeds after transient failures with backoff; dies after max_attempts on persistent failure.
- All other gates unaffected (no new deps, no changed exit codes for success).