feat(example): Notebook composite demonstrating advanced composite-child#118
Merged
Conversation
…e-child The pluginproto ownerKind/advancedNote handshake field (from #117) had no plugin exercising it. Make plugins/example a reference for it. - New Notebook kind: a Planner composite that expands (via Plan) into one Note child per spec.page, stamping owner labels on each child. Notebook itself is file-backed (a .notebook marker lists its children) so its Apply/Get/List/Delete are complete CRUD; the plugin creates its child Notes directly (there's no controller-side auto-expansion for external composites — Plan feeds the UI children graph). - Note is declared a composite-child of Notebook in the handshake (OwnerKind + AdvancedNote), so the UI flags it "advanced" and nudges toward creating a Notebook — driven entirely by the backend signal, no client-side list. Note stays directly authorable. - The external e2e test now asserts the advanced declaration survives the real subprocess wire round-trip into AdvancedKindDescriber. - docs/plugin-protocol.md documents OwnerKind/AdvancedNote and points at the Notebook->Note composite.
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.
Why
Follow-on to #117. That PR added the
ownerKind/advancedNotehandshake field so external plugins can flag composite-children — but no plugin actually exercised it, so there was no copy-paste reference for plugin authors.What
Make
plugins/examplea reference for a plugin composite:Notebookkind — a Planner composite.Planexpands a Notebook into oneNotechild perspec.pages[], stamping the documented owner labels (openctl.io/owner-kind/owner-name) on each child. Notebook is file-backed (a.notebookmarker lists its children), so its Apply/Get/List/Delete are complete CRUD. The plugin creates its child Notes directly in Apply — there is no controller-side auto-expansion for external composites (ChildDispatcherFromis k3s-only), soPlanhere feeds the UI children-graph while Apply does the real work.Notedeclared a composite-child ofNotebookin the handshake (OwnerKind: "Notebook"+AdvancedNote). The UI flags it "advanced" and nudges toward creating a Notebook — entirely from the backend signal, no client-side list. Note stays directly authorable.AdvancedKindDescriber(Note → Notebook).docs/plugin-protocol.mddocumentsOwnerKind/AdvancedNoteand points at the Notebook→Note composite.No production code changes — this is example/plugin + test + docs only.
Local CI
gofmt / go vet / staticcheck / golangci-lint / modernize (generated-filtered) /
go test ./.../go test -race(example + external) all green.