Skip to content

v0.7.1 - Review Closure: Two CLI Crashes and SHA-256 Compaction Fixed

Choose a tag to compare

@github-actions github-actions released this 09 Oct 20:10
· 582 commits to main since this release

What's Changed in v0.7.1

Fixed

  • git-remote-seafile test and unlock crashed instead of reporting the failure. Both named their exception in an except clause whose from … import ran inside the try but after the first statement that can raise, so any earlier failure — a bad URL, missing credentials, the network — died with UnboundLocalError. These are exactly the two commands a user runs when the remote is already misbehaving. The names are now imported at module scope.
  • Remote gc was completely broken on SHA-256 repositories. The scratch repository was initialised SHA-1, so index-pack rejected the 64-hex packs and repack exited 128; with seafile.autogc on, it retried forever while the pack directory grew without bound. The fix needs both halves — initialise the scratch repo with the remote's object format, and run verify-pack/index-pack with -C <bare-repo> (they run with GIT_DIR scrubbed). Either alone still fails.
  • Re-installing a pack died on Windows. git writes pack and index files read-only (0444), and os.replace onto a read-only destination fails with WinError 5 (POSIX only needs directory write permission). Both targets are made writable before publishing.
  • seafile://host:80/… lost its port and flipped to HTTPS. seafile://host:80/lib/repo became https://host, redirecting to :443 and disagreeing with the explicit seafile://http://host:80/… form. A port now decides the scheme: :80 is http, :443 is https, and any other port keeps its number over https. A non-numeric port is refused with a clear Invalid Seafile URL format message instead of a raw ValueError.
  • unlock --force <url> read the flag as the URL, producing a confusing "library not found: '--force'". Flags are now skipped before the URL is read.
  • Library-typo suggestions could never fire. The fuzzy match sat behind a call that had already raised, so the documented feature was unreachable and its unit test passed vacuously. It is now built where the miss is detected, from the listing already fetched.
  • A malformed ~/.git-seafile.json and an unreadable seafile-ignore.txt now warn instead of failing silently, and three unguarded list_dir iterations now raise a describable error instead of AttributeError/KeyError.
  • "Lost lock ownership" no longer means two different things — a transient renewal failure no longer aborts a push with the takeover message.

Changed

  • acquire() settles the ticket queue before claiming the lock. A partial directory view could let two clients both read themselves as the winner; a short settlement window (new seafile.locksettle, default 1) re-scans before committing. It costs roughly 0.85 s per push per unit, so the "<1 s push" claims in README and USER_GUIDE were corrected rather than left to mislead.
  • Unreachable branches removed (get_repo_id's cache re-validation and _detect_remote_object_format's pack-inspection fallback). refs.__all__ now exports is_valid_ref_name, install_packfile passes --git-dir, and tools/seafile_doctor.py uses the public open_live_sqlite_ro instead of a private helper.

Documentation

  • USER_GUIDE §7 documents the URL scheme/port rule, and the no-path form (seafile://code → the library root's git-repo subfolder) is documented for the first time. §12 and §14 are corrected against the strings the code actually emits.
  • DESIGN §7.1 now matches the implementation on ticket ordering; PROPOSALS.md no longer describes the lock removed in v0.7.0.
  • CONTRIBUTING.md gains a "Releasing" section describing the tag-push process.

Tests & Tooling

  • gc.py is fully covered (76% → 100%) by 21 in-process tests for the recovery and fail-closed paths. The e2e harness had been hiding them: it runs the helper through subprocess.run, which the parent coverage run never records.
  • The missing v0.6.2 release notes are restored, and a new guard fails the suite when a merged tag has no notes file, so the gap cannot reopen silently.
  • Suite: 383 → 454 tests, all green; docs guards 7 → 9.

Full Changelog: v0.7.0...v0.7.1