0c0c64f5c4
* docs: draft homebrew-core formula and submission spec
Adds a source-build Formula/kandev.rb (parallel to the binary-install
formula in kdlbs/homebrew-kandev), plus spec.md + submission-checklist.md
under docs/specs/homebrew-core/.
* fix(homebrew): add uses_from_macos sqlite, drop head stanza
Address Greptile review on PR #904: declare sqlite as a build-time dep
for the cgo go-sqlite3 link, and drop the head stanza since
homebrew-core typically asks new formulae to omit it.
* chore(homebrew): bump formula pin to v0.49.0 for local preflight
* fix(homebrew): switch livecheck to git strategy with version regex
GithubLatest hits GitHub's API and is reserved for formulae that
consume release assets or where git tag inspection can't identify
the latest version. Ours uses the auto-generated tag archive and
publishes clean vX.Y.Z tags, so the default git strategy is the
right choice per docs.brew.sh/Brew-Livecheck.
* fix(release): replace rsync with cp -RL for cross-environment portability
Linuxbrew CI ships without rsync, which broke the homebrew-core
formula build. cp -RL provides the same dereference-symlinks behavior
on both BSD and GNU coreutils, no extra dependency required.
* Revert "fix(release): replace rsync with cp -RL for cross-environment portability"
This reverts commit 5599817f4f.
* fix(homebrew): add rsync as build dep
Linuxbrew CI ships without rsync, and package-web.sh uses
rsync --copy-links --safe-links to dereference pnpm's symlinks
while tolerating broken absolute symlinks from the content-addressed
store. Adding rsync as a build dep keeps the script unchanged.
* fix(homebrew): address maintainer review feedback
Apply review from SMillerDev on homebrew-core/pull/283241:
- Use std_go_args helper for both go build calls
- Invoke release scripts directly (rely on shebang) instead of bash
- Extract bundle assembly into scripts/release/package-bundle.sh
- Replace --version/--help test block with a functional health check
that boots the Go backend with an isolated data dir, polls
/api/v1/system/health, and shuts down cleanly
* fix(homebrew): address PR #904 review feedback
- spec.md: fix "no tap-tap" typo
- submission-checklist.md: bump stale v0.41.0 references to v0.49.0
- test block: rescue Errno::ESRCH/ECHILD in ensure so original failure
diagnostic isn't masked when the backend crashes early
* chore(homebrew): drop submission-checklist.md from PR
* docs(homebrew): align spec.md with current formula
- Add rsync to build deps list and note uses_from_macos sqlite
- Update livecheck snippet to match the regex form actually shipped
- Replace --help/--version test description with the health-check
block currently in Formula/kandev.rb
* fix(homebrew): move rsync to uses_from_macos
cubic flagged on PR #904: depends_on "rsync" trips
brew audit --new-formula because rsync ships with macOS.
uses_from_macos "rsync" => :build uses system rsync on
macOS and installs Homebrew's on Linux, which matches the
intent.
* fix(release): drop redundant chmod in package-bundle.sh
package-cli.sh:41 already runs chmod +x on cli.js when it creates
the file, so re-running chmod here is pure noise.
88 lines
2.9 KiB
Ruby
88 lines
2.9 KiB
Ruby
class Kandev < Formula
|
|
desc "Manage tasks, orchestrate agents, review changes, and ship value"
|
|
homepage "https://github.com/kdlbs/kandev"
|
|
url "https://github.com/kdlbs/kandev/archive/refs/tags/v0.49.0.tar.gz"
|
|
sha256 "a97f93b7733656d2c128998bce10dd804c7f192bf03112540198aa96e005a449"
|
|
license "AGPL-3.0-only"
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
depends_on "pnpm" => :build
|
|
depends_on "node"
|
|
|
|
uses_from_macos "rsync" => :build
|
|
uses_from_macos "sqlite"
|
|
|
|
def install
|
|
ENV["KANDEV_VERSION"] = version.to_s
|
|
ENV["CGO_ENABLED"] = "1"
|
|
|
|
system "pnpm", "-C", "apps", "install", "--frozen-lockfile"
|
|
system "pnpm", "-C", "apps", "--filter", "@kandev/web", "build"
|
|
system "./scripts/release/package-web.sh"
|
|
system "./scripts/release/package-cli.sh"
|
|
|
|
bundle = buildpath/"dist/kandev"
|
|
(bundle/"bin").mkpath
|
|
|
|
cd "apps/backend" do
|
|
system "go", "build",
|
|
*std_go_args(ldflags: "-s -w -X main.Version=#{version}",
|
|
output: bundle/"bin/kandev"),
|
|
"./cmd/kandev"
|
|
system "go", "build",
|
|
*std_go_args(ldflags: "-s -w", output: bundle/"bin/agentctl"),
|
|
"./cmd/agentctl"
|
|
end
|
|
|
|
system "./scripts/release/package-bundle.sh"
|
|
|
|
libexec.install Dir[bundle/"*"]
|
|
|
|
(bin/"kandev").write_env_script libexec/"cli/bin/cli.js",
|
|
KANDEV_BUNDLE_DIR: libexec.to_s,
|
|
KANDEV_VERSION: version.to_s
|
|
end
|
|
|
|
test do
|
|
# Wrapper sanity: confirms write_env_script wired KANDEV_BUNDLE_DIR
|
|
# and the launcher reads the bundled package.json version.
|
|
assert_match version.to_s, shell_output("#{bin}/kandev --version")
|
|
|
|
# Functional test: boot the Go backend with an isolated data dir,
|
|
# poll /api/v1/system/health until it responds, then shut down.
|
|
# Exercises the cgo+sqlite linkage, migration runner, and HTTP
|
|
# server — the parts most likely to break across platforms.
|
|
port = free_port
|
|
pid = spawn({ "KANDEV_HOME_DIR" => testpath.to_s,
|
|
"KANDEV_SERVER_PORT" => port.to_s,
|
|
"KANDEV_LOG_LEVEL" => "warn" },
|
|
libexec/"bin/kandev")
|
|
begin
|
|
deadline = Time.now + 60
|
|
until system("curl", "-sf", "-o", "/dev/null",
|
|
"http://127.0.0.1:#{port}/api/v1/system/health")
|
|
raise "kandev backend did not start within 60s" if Time.now > deadline
|
|
|
|
sleep 1
|
|
end
|
|
assert_match "healthy",
|
|
shell_output("curl -s http://127.0.0.1:#{port}/api/v1/system/health")
|
|
ensure
|
|
# Guard against ESRCH if the backend already crashed — without
|
|
# this, an exception in `ensure` masks the original failure
|
|
# diagnostic (e.g. the "did not start within 60s" message).
|
|
begin
|
|
Process.kill("TERM", pid)
|
|
Process.wait(pid)
|
|
rescue Errno::ESRCH, Errno::ECHILD
|
|
nil
|
|
end
|
|
end
|
|
end
|
|
end
|