Skip to content

dsconfig: base#771

Open
yesoreyeram wants to merge 9 commits into
mainfrom
dsconfig/schema-base
Open

dsconfig: base#771
yesoreyeram wants to merge 9 commits into
mainfrom
dsconfig/schema-base

Conversation

@yesoreyeram

@yesoreyeram yesoreyeram commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds the datasource configuration schema for the datasource. With the schema consumers such as llm agents, provisioning agents, etc will understand the shape and meta data about the datasource configuration.

Read more at

Copilot AI review requested due to automatic review settings June 19, 2026 10:06
@yesoreyeram yesoreyeram requested a review from a team as a code owner June 19, 2026 10:06
@yesoreyeram yesoreyeram requested a review from jcolladokuri June 19, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dsconfig-backed base schema for the GitHub datasource plugin, commits the generated schema artifacts, and ensures those artifacts ship with the built plugin bundle. It also adjusts backend settings parsing to tolerate legacy appId/installationId representations and updates dependencies/build wiring accordingly.

Changes:

  • Introduce dsconfig schema source (pkg/schema/dsconfig.json), Go helpers/tests, and generated schema artifacts (pkg/schema/*.gen.json).
  • Package schema artifacts (and skills) into dist/ via a new root webpack.config.ts and updated package.json build/dev scripts.
  • Normalize legacy appId / installationId parsing in pkg/models/settings.go and update tests; minor test determinism fix and SDK config API update.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
webpack.config.ts Extends scaffolded webpack config to copy schema artifacts (and skills) into the built bundle.
pkg/schema/dsconfig.json Adds dsconfig “single source of truth” schema for plugin settings.
pkg/schema/schema.go Embeds dsconfig schema and produces SDK plugin schema object.
pkg/schema/schema_test.go Adds artifact generation via go generate and runs dsconfig conformance tests.
pkg/schema/schema.gen.json Committed generated plugin schema (v0alpha1).
pkg/schema/settings.gen.json Committed generated settings schema (v0alpha1).
pkg/schema/settings.examples.gen.json Committed generated settings examples artifact.
pkg/models/settings.go Adds legacy-tolerant JSON unmarshal for appId/installationId and adds githubPlan for frontend parity.
pkg/models/settings_test.go Updates expectations for the new normalized appId/installationId representation.
pkg/github/stargazers_test.go Makes time zone formatting deterministic for golden output.
pkg/github/sql_handler_test.go Switches to config.NewGrafanaCfg per updated plugin SDK API.
package.json Bumps version and switches build/dev scripts to use the new root webpack config.
go.mod Updates Go/tooling and dependency versions; adds dsconfig modules.
go.sum Updates module checksums to match go.mod changes.
cspell.config.json Adds dsconfig-related words and formats ignore list.
CHANGELOG.md Documents 2.8.2 changes and adjusts prior formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/schema/schema.go Outdated
Comment thread pkg/schema/schema_test.go Outdated
Comment thread pkg/models/settings.go Outdated
yesoreyeram and others added 3 commits June 19, 2026 11:11
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@yesoreyeram yesoreyeram changed the title dsconfig: base schema chore: dsconfig base schema - github Jun 19, 2026
@yesoreyeram yesoreyeram changed the title chore: dsconfig base schema - github dsconfig: base Jul 8, 2026

@jcolladokuri jcolladokuri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits, otherwise LGTM, thanks!

@@ -0,0 +1,5 @@
---
'grafana-github-datasource': patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changeling + version bump instead?


// Force a fixed +0000 zone so the rendered time is deterministic across
// environments/Go versions (always "+0000" instead of "UTC"/"GMT").
starredAt = starredAt.In(time.FixedZone("", 0))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I follow why we needed to add this, was the test failing?

Comment thread go.mod
github.com/grafana/otel-profiling-go v0.5.1 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect
github.com/grafana/dsconfig/dsconfig v0.0.12 // indirect
github.com/grafana/dsconfig/schema v0.0.12 // indirect

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be a direct dependency? There also seem to be a lot of updates here, is that needed / expected?

Comment thread pkg/schema/dsconfig.json
@@ -0,0 +1,296 @@
{
"$schema": "https://raw.githubusercontent.com/grafana/dsconfig/refs/tags/dsconfig/v0.0.10/dsconfig/schema.json",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"$schema": "https://raw.githubusercontent.com/grafana/dsconfig/refs/tags/dsconfig/v0.0.10/dsconfig/schema.json",
"$schema": "https://raw.githubusercontent.com/grafana/dsconfig/refs/tags/dsconfig/v0.0.12/dsconfig/schema.json",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants