Skip to content

BenchBar 0.3.0

Choose a tag to compare

@github-actions github-actions released this 24 Sep 10:57
· 106 commits to main since this release
e3d8281

The project is now BenchBar: the benchbar command line tool, plus a
native menu bar app. Built for Frappe and ERPNext on macOS; not
affiliated with Frappe Technologies.

Added

  • One line installer, install.sh: checks macOS, the Command Line
    Tools and Homebrew (offering their installers), clones the CLI into
    ~/.local/share/benchbar with links in ~/.local/bin and a PATH block
    in ~/.zshrc, installs the BenchBar app from the latest GitHub release
    (zip checked against the release's SHA256SUMS, unpacked with ditto,
    so no Gatekeeper prompt), then offers benchbar adopt for a bench it
    finds or benchbar install. Flags --yes, --dry-run, --no-app,
    --app-only, --version vX.Y.Z, --uninstall. Re-runs say
    unchanged.
  • The manual install steps are gone. Phase 00 sets the MariaDB root
    password itself (generated, or MARIADB_ROOT_PASSWORD), applies the
    secure installation steps in SQL, and keeps the password in the macOS
    Keychain (benchbar-mariadb); every later step reads it from there and
    passes it through MYSQL_PWD. The utf8mb4 drop-in is a doctor check and
    repair action. The patched Qt wkhtmltopdf is downloaded from the pinned
    official package (config/wkhtmltopdf.tsv, sha256 checked) and
    installed with installer; on Apple Silicon Rosetta 2 is offered first
    because the package is an Intel binary, and skipping it only costs
    PDFs. The /etc/hosts line sits inside # >>> benchbar >>> markers,
    with a backup first. One sudo prompt covers a whole run.
  • benchbar adopt PATH: registers an existing bench (Procfile.lean,
    runner, launchd agent, helpers, hosts line) after showing the plan and
    asking. Never runs migrate, build or update.
  • benchbar report [--print]: a redacted diagnostics zip on the Desktop
    with doctor and status JSON, versions, the agent, Procfile.lean,
    state.json, log tails and the key names of the site configs. Secrets
    are masked by key name, paths and names are replaced by placeholders,
    and REDACTIONS.txt lists what was replaced.
  • benchbar mariadb-password: prints the Keychain password after a
    confirmation.
  • Doctor checks MariaDB utf8mb4 and wkhtmltopdf, with repair actions.
  • CI (.github/workflows/ci.yml) on pull requests and pushes to main:
    shellcheck and the CLI tests on macOS (/bin/bash 3.2) and Linux, an
    unsigned app build and the Swift tests, and scripts/release-local.sh
    whose zip, dmg and SHA256SUMS are uploaded as a workflow artifact.
  • Releases (.github/workflows/release.yml): a v* tag drafts a GitHub
    release with the CHANGELOG section as notes. Without Developer ID
    secrets the app is ad hoc signed (scripts/release-local.sh); with
    them it is signed, notarized and stapled, with the Sparkle appcast and
    the Homebrew cask (docs/releasing.md).
  • docs/testing.md, a three step guide for testers, and
    docs/DECISIONS.md.
  • BenchBar.app (macos/, macOS 14+, Apple Silicon), built from the
    command line with scripts/macos-build.sh and installed with
    scripts/macos-install-local.sh:
    • an animated menu bar runner per state (sleeping, walking, running,
      stumbling, alert, question), one Core Animation keyframe animation,
      tinted for light, dark and the transparent menu bar;
    • running speed from the CPU use of the bench's process tree (libproc,
      every 2 seconds, smoothed), behind a SpeedSource protocol;
    • Reduce Motion support, and pausing on sleep, screen sleep, lock and
      user switching;
    • a popover with state, uptime, Start, Stop, Restart, open site, logs
      (Terminal) and folder, a read only doctor, a bench picker, repair
      hints and keyboard shortcuts;
    • a Settings window: runner picker with live preview, speed toggle,
      launch at login (SMAppService), notifications, CLI path;
    • notifications on crash, crash guard pause and recovery;
    • two original built in runners (a bench and a coffee cup) and custom
      runners: a folder with manifest.json and PNG frames, imported from
      a folder or zip with strict validation (docs/runners.md,
      examples/runners/blob).
  • Versioned JSON API (schema_version: 1): benchbar list --json,
    status --json, doctor --json, and <bench>/logs/.benchbar/state.json
    written atomically by the runner on every transition
    (docs/json-schema.md).
  • stop_reason: "broken" for a bench that cannot start until repair.
  • Release plumbing, documented and not yet live (no Apple Developer
    account): Developer ID signing, notarization, DMG, Sparkle 2 behind a
    build flag, a Homebrew cask template and a guarded GitHub Actions
    workflow (docs/releasing.md).

Changed

  • 00-mac-system-deps.sh exits 2 only when MariaDB already has a root
    password that neither the environment nor the Keychain knows; it takes
    --yes. 01-install-bench-and-site.sh reads the root password from
    the Keychain and no longer passes it on the mariadb command line.
  • The test suite runs on Linux as well as macOS (GNU stat and sed, a
    uname mock), so a Linux machine gives quick feedback.
  • The CLI is benchbar; frappe-mac stays as a link to it.
  • Agents are com.benchbar.<bench> and carry
    AssociatedBundleIdentifiers so Login Items shows them under BenchBar.
    benchbar repair migrates com.frappe-mac.<bench> agents (only for
    this bench), restarting the bench if it was running. Old plists move to
    ~/Library/LaunchAgents-disabled/<timestamp>/.
  • up, down and restart on a bench that still has its old agent now
    say so and point at benchbar repair, instead of "not installed".
  • The runner runs honcho as a child, forwards SIGTERM and records the
    final state; a SIGTERM without a stop flag is a clean stop. Its
    osascript crash notification stays as a fallback and is skipped while
    BenchBar runs.
  • status --json: state is now the contract value (stopped, starting,
    running, crashed, paused); launchd's word moved to agent_state.
  • The repository is now github.com/askysh/benchbar (the old URLs
    redirect). README, AGENTS.md, the docs, the cask and the Sparkle feed use
    it.
  • Names from before 0.3.0 move over once, on the next run or repair:
    the checkout's .frappe-local/ becomes .benchbar/,
    frappe-mac-run.sh in the bench becomes benchbar-run.sh (the old file
    goes to the backups once no agent uses it), the # >>> frappe-mac >>>
    block in the shell rc is replaced in place by # >>> benchbar >>>, and
    new files carry a benchbar-template: header. Files are not rewritten
    for the header word alone, so MariaDB is not restarted.

Fixed

  • Reading a missing stop flag no longer prints "No such file or
    directory".
  • Reloading the agent of a running bench (a repair after a template or
    setting change, autostart on|off) could leave it stopped and unloaded:
    launchctl bootout returns while the job is still shutting down, the
    immediate bootstrap failed, and the load -w fallback exits 0 without
    loading anything. The CLI now waits until launchd has let go of the job
    (up to 30 seconds), confirms the load with launchctl print, and fails
    the step clearly instead of reporting success.

This build is not signed with an Apple Developer ID (ad hoc signature). macOS shows "Apple could not verify" on first open of the DMG: use System Settings > Privacy & Security > Open Anyway, or install with the one liner, which downloads with curl and opens without that prompt:

curl -fsSL https://raw.githubusercontent.com/askysh/benchbar/main/install.sh | bash

Checksums are in SHA256SUMS.