Expose notebooks as a chronoctl entity - #127
Draft
crob611 wants to merge 1 commit into
Draft
Conversation
Notebooks are already served by the unstable config API but had no CLI surface, so they could not be managed declaratively alongside the other config entities. Adding `notebooks` to the generator's UNSTABLE_ENTITIES allowlist gives them the same treatment as dashboards and link templates. The only hand-written change is the Makefile line; everything else is the output of `make gen-cli`. The generated init() registers the Notebook type into types.Registry and the generated ApplyMappings entry does an upsert with CreateIfMissing, so `apply` round-trips a Notebook YAML object with no additional wiring. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
crob611
marked this pull request as draft
August 5, 2026 16:02
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.
Summary
Notebooks are already served by the unstable config API but had no CLI surface, so they could not be managed declaratively alongside the other config entities. This adds
notebooksto theUNSTABLE_ENTITIESallowlist in the Makefile and checks in the regenerated output.The Makefile line is the only hand-written change;
src/generated/cli/configunstable/notebooks.gen.goand the two hunks incli.gen.goaremake gen-clioutput. Regeneration is idempotent, somake test-genstays clean.No extra wiring was needed for
apply: the generatedinit()callstypes.MustRegisterObject(NotebookTypeMeta, &Notebook{}), and the generatedApplyMappings()entry upserts viaUpdateNotebook(..., UpdateOptions{CreateIfMissing: true}).Command surface
Worth calling out, since it differs from how this is sometimes described: unstable entities are registered under the hidden
unstableroot command (src/cmd/pkg/unstable/root.go), and this repo has noget/delete <slug>top-level verbs. Notebooks land exactly where the other five unstable entities do:chronoctl apply -f notebook.yamlworks from the top level as usual.Testing
make gen-clire-run — output identical, working tree unchanged (satisfies thetest-genCI check)go test ./src/...— pass, 17 packagesgolangci-lint run -D gosec— cleango mod tidy— no-opunstable notebooks --helplists all six subcommands;scaffoldemits the expected YAMLapply -fon a notebook YAML decodes the object and issuesPUT /api/unstable/config/notebooks/{slug}Not run: a round trip against a real test tenant. Local verification reached the network boundary with the correct upsert request but no tenant was available in this environment. Worth a quick manual
apply+readbefore relying on this.🤖 Generated with Claude Code