fix(init): make first-run guidance Render-aware; fix mangled signup URL#6
Conversation
The "Next steps" block printed by `hooks init` was written for a local laptop install, but the Docker entrypoint also runs it on a fresh Render volume. On Render most of the steps were wrong: the server is already running, RENDER_WEBHOOK_SECRET goes in the dashboard's Environment tab (not a local shell), and the public URL is known via HOOKS_PUBLIC_URL but the message hardcoded `<your-host>`. Detect Render via the platform's `RENDER=true` env var and branch the guidance accordingly. Use the public URL when known, point at the modern `hooksctl login` device-pairing flow instead of `export HOOKS_TOKEN=…`, and stop telling Render users to start a server that's about to start itself. Also fix the fallback signup line in `init` and `invite`, which concatenated its own explanatory comment into the URL: signup: http://localhost:8080 # set --server-url or HOOKS_PUBLIC_URL/signup?code=… The fallback now prints a real URL with a separate note. Quickstart §3b updated to match the new Render-aware log output.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR refactors ChangesOutput Refactoring with Shared URL Helper
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Summary
hooks initis run from two contexts now: a developer's laptop ANDdocker-entrypoint.shon a fresh Render volume. The "Next steps" block was written for the first and is wrong/confusing on Render — it told the operator to start a server that was already running, didn't know the public URL even thoughHOOKS_PUBLIC_URLwas set, and pointed RENDER_WEBHOOK_SECRET at "your environment" without saying which one. Detect Render viaRENDER=trueand branch the output accordingly; substitute the known public URL into the ingest URL and thehooksctl login --serverline.hooksctl login(modern device-pairing) overexport HOOKS_TOKEN=…(legacy admin-token bearer) on the dev-laptop step.--server-urlnorHOOKS_PUBLIC_URLwas set, the explanatory comment got concatenated into the URL, e.g.signup: http://localhost:8080 # set --server-url or HOOKS_PUBLIC_URL/signup?code=…. The fallback now prints a clean URL with a separate note. Same fix applied inrunInvite.docs/quickstart.md §3bupdated to match the new Render-aware log output and to lead with the bootstrap signup URL (admin token framed as a legacy fallback).Test plan
go vet ./...go tool golangci-lint run ./cmd/hooks/...go test ./...hooks initin a tmpdir with no env, withHOOKS_PUBLIC_URLset, and withRENDER=true HOOKS_PUBLIC_URL=…set — verified each prints the right "Next steps" variant and that the signup URL is no longer mangled in the placeholder case.Summary by CodeRabbit
Release Notes
Documentation
Improvements