POC: Render config editor using json-render from config JSON schema#687
Draft
Copilot wants to merge 3 commits intotypes-and-schema/configfrom
Draft
POC: Render config editor using json-render from config JSON schema#687Copilot wants to merge 3 commits intotypes-and-schema/configfrom
Copilot wants to merge 3 commits intotypes-and-schema/configfrom
Conversation
Add a proof-of-concept ConfigEditor using @json-render/core and @json-render/react that renders the data-source configuration form from a json-render spec derived from the config JSON schema. - Install @json-render/core and @json-render/react - Create component catalog mapping form primitives to Grafana UI - Create component registry with Grafana UI implementations - Build json-render spec by reading the config JSON schema structure - Bridge json-render state to Grafana's onOptionsChange - Wire POC as the active config editor in module.ts - Add tests for the new component Co-authored-by: yesoreyeram <153843+yesoreyeram@users.noreply.github.com>
…for secure fields, fix type assertions Co-authored-by: yesoreyeram <153843+yesoreyeram@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement POC to render config editor using json-render
POC: Render config editor using json-render from config JSON schema
Mar 18, 2026
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.
Explores whether the existing config JSON schema can drive UI rendering via vercel-labs/json-render. Answer: yes. This PR implements a working proof-of-concept.
Approach
The config JSON schema uses discriminated unions (
anyOf/allOf) for auth types and license plans. The POC walks this schema structure at runtime to extract field metadata, then renders via json-render'sRendererwith Grafana UI components.src/jsonrender/catalog.ts— Component catalog (8 form primitives: RadioGroup, TextInput, SecretInput, SecretTextArea, etc.) with Zod-typed propssrc/jsonrender/registry.tsx— Maps catalog → Grafana UI implementations (ConfigSection,RadioButtonGroup,Input,SecretInput, etc.), wired withuseBoundPropfor two-way bindingsrc/jsonrender/configEditorSpec.ts— Readspkg/schema/config.jsonto extract discriminator values, field descriptions, and radio options; builds a json-renderSpecwith$bindStatebindings and$state-based conditional visibilitysrc/views/ConfigEditorJsonRender.tsx— Bridges json-render's controlledStateStore↔ Grafana'sonOptionsChangesrc/module.ts— Swaps in the new editorKey details
Schema-driven conditional visibility replaces hand-coded
{selectedAuthType === 'github-app' && (...)}blocks:Field labels and descriptions are extracted from the JSON schema rather than hard-coded:
Limitations
<Collapse>section (access token setup instructions) andSecureSocksProxySettingsare not included — this is a structural POC, not a drop-in replacementWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
ofcncog2cu-dsn.algolia.net/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/github-datasource/github-datasource/.yarn/releases/yarn-4.12.0.cjs add @json-render/core @json-render/react(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.