test(docs): compile the sdk.md examples - #14136
Merged
Merged
Conversation
sdk.md advertised a 'progress' package (progress.NewTTYWriter, NewPlainWriter, NewJSONWriter, NewQuietWriter) that does not exist in the repository, and typed WithEventProcessor against it. Anyone following the doc writes code that cannot compile — or recreates the phantom package. The section now points at the real surface: api.EventProcessor, the silent-by-default behavior when no processor is configured, and the CLI's actual renderers in cmd/display (Full, Plain, JSON, Quiet) with their real signatures. Part of docker#14074 (A: the code misdescribes its own structure). Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
The fenced Go blocks in docs/sdk.md become real code under docs/examples/sdk, built by the ordinary module build: API drift now breaks compilation. A unit test pins the markdown to the compiled files byte-for-byte (first block = main.go from its package clause down, second block = customService's body), so wording drift breaks the test instead of silently rotting the docs. Epic docker#14074, section G. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
39 tasks
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
🟢 No issues found — LGTM! View logs.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Epic #14074, section G: the fenced Go blocks of
docs/sdk.mdbecome real code underdocs/examples/sdk, compiled by the ordinary module build — API drift breaks the build. A unit test pins the markdown blocks to the compiled files byte-for-byte, so wording drift fails the test.Depends on #14131 (includes its commit): the current sdk.md documents a
progresspackage that does not exist, so there is nothing truthful to compile before it.🤖 Generated with Claude Code