Skip to content

[PAI-2170] feat: declare config_schema on a dashboard widget type - #93

Open
sunder-ch wants to merge 1 commit into
mainfrom
feat/pai-2170-widget-type-config-schema
Open

sunder-ch wants to merge 1 commit into
mainfrom
feat/pai-2170-widget-type-config-schema

Conversation

@sunder-ch

@sunder-ch sunder-ch commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

What

WidgetType (a row of Dashboards.widget_types) declares config_schema: dict[str, Any] | None.

Plane's v2 widget-types/ response publishes each dashboard widget type's config as JSON Schema (makeplane/plane-ee#11681). Until now the SDK carried it only as an undeclared extra, because the model has extra="allow", so a caller had to read it with getattr and a type checker could not see the read.

Behaviour

  • A schema the server sends is available as row.config_schema.
  • None when the server sends null for the type, or is older and leaves the key out.
  • Nothing else changes; the field is optional, so responses from older servers parse as before.

Tests

test_widget_types_unwraps_the_envelope now covers a row with a schema, a row with null and a row without the key.

Run locally: ruff check plane/api/v2 plane/models/v2 tests/v2, black --check on the two changed files, and pytest tests/v2 --ignore=tests/v2/integration all pass. The integration tests were not run against a live server.

Not in this PR

No version bump. Plane AI pins plane-sdk and will read found.config_schema directly once a release with this field is pinned.

Summary by CodeRabbit

  • New Features
    • Widget type information now includes an optional configuration schema when one is provided. Missing or null schemas are represented as unavailable.
  • Documentation
    • Updated the dashboard widget-types example to include the configuration schema field.

The v2 widget-types response publishes each type's config as JSON Schema. WidgetType read it only as an undeclared extra; it is now a typed field, None when the server sends null or leaves the key out.
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The v2 WidgetType model now includes an optional config_schema field. The dashboard example documents the field, and tests cover omitted, null, and present schema values.

Changes: Widget type configuration schema

Layer / File(s) Summary
Model field and response validation
plane/models/v2/dashboards.py, README.md, tests/v2/test_dashboards_resource.py
WidgetType declares optional config_schema data. The README example documents it. Tests check omitted and null values, and confirm a present schema retains cycle_ids.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: akhil-vamshi-konam

Merge Risk: Minimal · up to 66d1b

WidgetType now exposes an optional config_schema field that is None when the server sends null or omits the key. This is additive and backward compatible, and the unit tests cover the field. No merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the v2 WidgetType model gains a typed, optional config_schema field. The title matches the PR objectives and the file-level summaries. The title also follows the conve…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the v2 WidgetType model gains a typed, optional config_schema field. The title matches the PR objectives and the file-level summaries. The title also follows the conventional prefix style with a ticket reference. No unrelated or misleading content appears in the title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 401c7e39-6fa1-4e35-a54f-f776e9ba1756
Commits

Reviewing files that changed from the base of the PR and between 89b5a8a and 66d1bee.

Files selected for processing: 3

  • README.md
  • plane/models/v2/dashboards.py
  • tests/v2/test_dashboards_resource.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@makeplane

makeplane Bot commented Dec 2, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

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.

1 participant