Skip to content

Modernize brave-updater CLI, harden downloads, and add deterministic test coverage - #2

Merged
maotora merged 7 commits into
mainfrom
codex/brave-updater-modernization
Mar 16, 2026
Merged

maotora merged 7 commits into
mainfrom
codex/brave-updater-modernization

Conversation

@maotora

@maotora maotora commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR modernizes the project from a single-file script into a packaged brave-updater CLI, hardens the download/update flow, adds deterministic cross-platform tests and CI, updates repo ownership references to HackEAC/braver-tz, and adds starter assets for a dedicated Homebrew tap.

What changed

  • Packaged the app under src/brave_updater/ with pyproject.toml, setup.py, and a brave-updater console entrypoint
  • Kept python3 braver.py ... working as a compatibility wrapper
  • Added explicit check, download, update, and install commands
  • Added installed-version detection and no-op update behavior when Brave is already current
  • Hardened downloads with:
    • redirect host validation
    • resumable .part files
    • safe restart when Range is ignored
    • checksum verification
    • atomic final replacement
  • Improved installer handling with testable platform adapters
  • Replaced the old live-download-only workflow with deterministic unit CI plus a scheduled smoke workflow
  • Added Homebrew tap starter files for HackEAC/homebrew-brave-updater
  • Updated docs and ownership references to the transferred HackEAC/braver-tz repo
  • Removed Brave-logo-heavy branding from the repository

Testing

  • python3 -m unittest discover -v
  • 51 tests passing
  • Added tests for:
    • CLI routing and legacy compatibility
    • service orchestration and update decisions
    • provider selection and checksum fallback
    • download retry/resume/safety behavior
    • console prompting/logging
    • installer adapter command selection
    • system/version detection helpers

Notes

  • The Homebrew formula in this PR is a starter asset for a separate tap repo, not a replacement for Homebrew’s existing brave-browser cask
  • Remaining higher-risk behavior is in true OS-level installer execution, which is intentionally covered by mocks/unit tests plus smoke checks rather than destructive CI installs

@maotora
maotora merged commit da4c452 into main Mar 16, 2026
3 checks passed
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.

1 participant