Repository navigation
docs(agents): add an architecture map of the non-guessable facts - #14134
Conversation
docker-agent
left a comment
There was a problem hiding this comment.
🟢 No issues found — LGTM! View logs.
glours
left a comment
There was a problem hiding this comment.
I missed this one during my first review
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
d2d17f9 to
db3ff2f
Compare
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
db3ff2f to
f6fff7e
Compare
glours
left a comment
There was a problem hiding this comment.
Requesting changes: the "Two lifecycle engines" bullet describes a pre-ScopeStart/ScopeCreateStart main and is wrong on several points; see inline. The identity bullet also has a wrong causal claim (inline, should-fix).
Nits, no suggestion block:
- "Operation convention": it's a rule for mutating/lifecycle methods only.
Ps,Logs,Exec,Wait,Watch,Imageshave noRun, and the unexportedprepareRuncallsRun(run.go:134).Runonly callsStart/Done, notOn. - "Output conventions":
COMPOSE_STATUS_STDOUT(cmd/compose/compose.go:95,stdinfo()) moves the renderer's info writer to stdout. Worth a "(unlessCOMPOSE_STATUS_STDOUTis set)". - "Packages": "exported for historical reasons, not as a stability promise" isn't stated anywhere in the repo, and it's wrong for
pkg/e2e(test suite) andpkg/mocks(generated). Either drop it or saypkg/apiis the contract and the rest carries no documented guarantee. down.go:removePreStartHookContainersis ambiguous (cmd/compose/down.goexists too), use the full path.- PR description says "~35-line", the diff is +45. The "merge after #14129" note is moot, it's merged.
ac4b86a to
715e703
Compare
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
715e703 to
4c5e638
Compare
glours
left a comment
There was a problem hiding this comment.
Sounds good to me, maybe a nit to address before we merge it
| - **Operation convention**: exported `composeService` methods wrap the work | ||
| in `Run(ctx, …, "opname")`, which drives the `EventProcessor` | ||
| (`Start`/`On`/`Done`) used for progress display. Unexported methods |
There was a problem hiding this comment.
"exported composeService methods wrap the work in Run(…)" is wrong for read-only/streaming methods: Exec (containerops.go:35), Logs, Attach, Watch (watch.go:134), Wait, Ps, Images, etc. have no Run. RunOneOffContainer doesn't either, its Run lives in prepareRun (run.go:134). Only the mutating operations follow the convention.
Current lines:
- **Operation convention**: exported `composeService` methods wrap the work
in `Run(ctx, …, "opname")`, which drives the `EventProcessor`
(`Start`/`On`/`Done`) used for progress display. Unexported methods
| - **Operation convention**: exported `composeService` methods wrap the work | |
| in `Run(ctx, …, "opname")`, which drives the `EventProcessor` | |
| (`Start`/`On`/`Done`) used for progress display. Unexported methods | |
| - **Operation convention**: exported `composeService` *operations* (`up`, | |
| `create`, `down`, `build`, …) wrap the work in `Run(ctx, …, "opname")`, | |
| which drives the `EventProcessor` (`Start`/`On`/`Done`) used for progress | |
| display; read-only and streaming methods (`Ps`, `Logs`, `Exec`, …) have no | |
| event cycle. Unexported methods |
AGENTS.md covered build/test/lint mechanics but nothing about how the codebase is organized, so a reader's first mental model comes from file names and local comments — several of which used to be misleading (see the previous commits in this series). The new section states, in ~35 lines, the facts a contributor cannot derive from local reading: the two coexisting lifecycle engines and which commands enter the plan-based reconciler versus the dependency graph walk, the Run()/EventProcessor operation convention, the stdout/stderr split, the two environment-resolution idioms and the setEnvWithDotEnv timing, the config-hash label as the actual project membership invariant, and the Docker Desktop integration points that must fail silently. Part of docker#14074 (A: the code misdescribes its own structure). Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
4c5e638 to
2a6d617
Compare
AGENTS.md gains a ~35-line architecture map of the facts local reading cannot reveal: the two lifecycle engines and who calls which, the
Run()/events convention distinguishing exported operations from internal helpers, the stdout/stderr split, env-resolution idioms, the config-hash membership invariant, and Docker Desktop integration points.Note: references
service_containers.go, so best merged after #14129.Epic #14074, section A — split out of #14075 for focused review.
🤖 Generated with Claude Code