feat(generate): add Services section to generated project README - #2934
Conversation
`devbox generate readme` documented scripts, packages, environment variables, and the shell init hook, but never mentioned services. This made services less discoverable in a project's generated README even though they are a first-class part of a Devbox environment. Add a Services section to the generated README that lists each service (from the project's plugins and its process-compose.yaml) and documents how to start, stop, and list them. The section is omitted when the project defines no services. Fixes #2626 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qgu2wVkmAdXLRKcpgevoBW
|
Hi @mikeland73 , I see you picked up some of the issues I find important as well. So, thank you 👍
Do you know what is supposed to happen now, to make it into a newer version of Devbox? |
|
@claude please review this PR for correctness, and flag anything that would block merging. |
|
Claude finished @mikeland73's task in 1m 36s —— View job Review of PR #2934 — Add Services section to generated README
Verdict: No correctness issues found. Nothing here blocks merging. This is a small, well-scoped change that mirrors the existing Walkthrough
Minor, non-blocking observations
Note on verificationI wasn't able to execute Re: making it into a release — that's a maintainer/release-process question outside what I can determine from the code; a maintainer will need to weigh in on timing. |
|
@mikeland73 I reviewed the diff for correctness. Verdict: the change is correct and I don't see anything in the code that blocks merging. Locally Correctness notes
What actually gates merge (process, not code)
Minor, non-blocking nit (optional)
Generated by Claude Code |
Summary
Fixes #2626.
devbox generate readmeproduces a project README that documents theproject's scripts, packages, environment variables, and shell init
hook — but it never mentioned services. As the issue reporter points out,
services are as central to a Devbox environment as scripts and packages, so
their absence from the generated README both hid a useful feature and left
readers unaware that services exist at all.
This PR adds a Services section to the generated README, mirroring how
Scripts are documented:
way the rest of the CLI gathers them — via
Devbox.Services(), which combinesplugin-provided services with any defined in the project's
process-compose.yaml.devbox services up), stop (devbox services stop),and list (
devbox services ls) services, including targeting an individualservice by name.
template guards it with
{{- if .Services }}), so existing service-lessprojects generate an unchanged README.
Changes
internal/devbox/docgen/docgen.go— pass the project's services into thetemplate data (propagating any error from
Devbox.Services()).internal/devbox/docgen/readme.tmpl— render the new Services section.testscripts/generate/readme.test.txt— new testscript that defines twoservices via a project
process-compose.yaml, runsdevbox generate readme,and asserts the generated README lists both services and documents how to
start/stop them.
How was it tested?
testscripts/generate/readme.test.txtcovering the new behavior end toend (
devbox init→devbox generate readme→ assert the Services section andservice names are present).
readme.tmpldirectly against a sample data map (with and withoutservices) to confirm the Services section appears when services are present,
is omitted when they are absent, and that all other sections are unchanged.
go build ./...,go vet ./internal/devbox/docgen/, andgofmtare clean onthe changed files.
cc @ametad (issue reporter) — thanks for the suggestion!
Community Contribution License
All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.
By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Qgu2wVkmAdXLRKcpgevoBW
Generated by Claude Code