docs: document treehouse environment variables#34
Open
e-jung wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
The developer wanted to document two treehouse environment variables (TREEHOUSE_DIR and TREEHOUSE_NO_UPDATE_CHECK) that are public API surface but missing from the docs. The goal was to add a concise "Environment Variables" section to README.md (and AGENTS.md if it has a config section), with one short paragraph per variable covering what it does and when you would set it. The change had to be docs-only with zero build risk, based on origin/main (never local main), and shipped as a cross-repo PR from the e-jung fork to kunchenguid/treehouse with title "docs: document TREEHOUSE_DIR and TREEHOUSE_NO_UPDATE_CHECK env vars" and AI disclosure marked Human-reviewed. The developer authorized pushing to the fork and opening the PR but explicitly forbade merging, leaving that to the maintainer.
What Changed
README.mddocumentingTREEHOUSE_DIR,TREEHOUSE_LEASE_HOLDER, andTREEHOUSE_NO_UPDATE_CHECK(purpose, when to set them, and the=1sentinel for the update check).AGENTS.mdlisting the same three variables alongside the existing config reference.TREEHOUSE_DIRis only exported into thetreehouse getsubshell and is not visible to lifecycle hooks, which run before the subshell is spawned.Risk Assessment
✅ Low: Pure docs-only change adding an Environment Variables section to README.md and AGENTS.md; all three documented variables (TREEHOUSE_DIR, TREEHOUSE_LEASE_HOLDER, TREEHOUSE_NO_UPDATE_CHECK) and the hook-availability caveat were verified against the source and match implementation behavior exactly, so there is zero build/functional risk.
Testing
Validated the docs/env-vars change as both accurate and safe: confirmed the diff is markdown-only (no Go files), built cleanly (zero build risk), ran the E2E/Lease test suite (passed), cross-checked each documented behavior against the corresponding source line, and exercised all three env vars live against the built binary in a temp repo — TREEHOUSE_LEASE_HOLDER surfaced as "(held by alice-bot)" in
status, TREEHOUSE_DIR was present inside the spawned subshell set to the exact worktree path, and TREEHOUSE_NO_UPDATE_CHECK=1 suppressed the startup check. Markdown formatting and section placement render as intended.Evidence: env-vars E2E verification transcript
[1] TREEHOUSE_DIR live demo: 'TREEHOUSE_DIR in subshell = /home/ubuntu/.treehouse/demo_repo-a638f1/1/demo_repo' + cwd matches. [2] TREEHOUSE_LEASE_HOLDER live demo: 'get --lease' with holder=alice-bot, then 'status' -> '1 leased ~/.treehouse/demo_repo-... (held by alice-bot)'. [3] TREEHOUSE_NO_UPDATE_CHECK=1 -> commands run without release check. Build: BUILD OK. Tests: go test ./cmd/... -run 'E2E|Lease' -> ok (2.969s). All docs claims match source.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
git diff 68fa3d2..36a93cbto confirm the diff is README.md + AGENTS.md only (14 insertions, no Go files)Source cross-check:TREEHOUSE_DIRexported at cmd/get.go:76 into shell.Spawn (line 78), read at cmd/return_cmd.go:72; hooks run via pool.Acquire (line 68) before subshell spawn, confirming the README note that hooks do not see itSource cross-check:TREEHOUSE_LEASE_HOLDERfallback at cmd/get.go:114;TREEHOUSE_NO_UPDATE_CHECK=="1" guard at cmd/root.go:33 and inherited by updater child at internal/updater/updater.go:182go build -o treehouse .-> BUILD OK (zero build risk)go test ./cmd/... -run 'E2E|Lease' -count=1 -timeout 300s-> ok (2.969s)Live demo:TREEHOUSE_LEASE_HOLDER=alice-bot treehouse get --leasethentreehouse statusshowed '(held by alice-bot)'Live demo:SHELL=<printer-script> treehouse getprintedTREEHOUSE_DIR in subshell = <exact worktree path>, matching the documented exportLive demo:TREEHOUSE_NO_UPDATE_CHECK=1 treehouse ...ran without attempting a release checkRendered-markdown check of README.md:301-307 and AGENTS.md:85-89 to confirm section placement and formatting✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.