Skip to content

Add Sanity Plugin#71

Draft
andrewmumblebee wants to merge 5 commits into
mainfrom
work/ah/sanity
Draft

Add Sanity Plugin#71
andrewmumblebee wants to merge 5 commits into
mainfrom
work/ah/sanity

Conversation

@andrewmumblebee

@andrewmumblebee andrewmumblebee commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Warning

This is failing our pipeline currently, due to the new dependsOn step not being in production yet which this plugin uses

🔌 Plugin overview

  • Plugin name: Sanity
  • Purpose / problem solved: Brings Sanity headless-CMS content into SquaredUp. A single instance can cover many Sanity projects at once — listing the projects an admin token can see, and (per project) browsing datasets, running GROQ queries, breaking content down by document type, listing members, and tracking a full history of content changes.
  • Primary audience (e.g. platform teams, SREs, product teams): Content editors / platform teams running Sanity studios
  • Authentication method(s) (e.g. OAuth, Username/Password, API Key): API Key — an organization/personal admin token (management API: projects, datasets, members) plus a set of per-project API tokens (content API: GROQ queries and history). This split keeps content access least-privilege: each project token can only read its own project.

🖼️ Plugin screenshots

Plugin configuration

TODO: add screenshot of the config form (Admin API token, per-project token pairs, Content API version).

Default dashboards

TODO: add screenshots of the Sanity Project and Sanity Projects dashboards.


🧪 Testing

  • Validated all plugin JSON against the SquaredUp schema (schemaVersion 2.1).
  • Verified authentication via the listProjects config-validation step against a live Sanity organization.
  • Exercised each data stream end-to-end:
    • List projects — projects imported as Sanity Project objects.
    • Datasets / Dataset stats — per-project dataset tables and stats.
    • Document type counts_type breakdown via GROQ.
    • Custom GROQ query — arbitrary GROQ run from a tile.
    • Change history — transaction log over a dashboard timeframe.
    • Members — project members and roles via the admin token.
  • Confirmed both default dashboards render (Sanity Project, Sanity Projects).

⚠️ Known limitations

  • Dependent imports (blocking). Projects must be imported before datasets — see the warning above. Awaiting product support for dependent imports.
  • No usage or billing metrics. Sanity's HTTP API exposes no request counts, bandwidth, storage, or plan/quota figures.
  • Content tiles need a per-project token. Query, history and document-count tiles for a project only work if that project's token has been added under Project API tokens. Projects without a token still appear (datasets/members via the admin token) but content tiles show an authorization error.
  • Document type counts read document metadata via a GROQ query returning each document's _type; can be slow on very large datasets.
  • Change history depth. The transaction log is capped per request, so very busy timeframes may be truncated to the most recent transactions.
  • Members tile permissions. Requires the admin token to have member-read access; otherwise the tile shows an authorization error (nothing else is affected).

📚 Checklist

  • Plugin, datastream and UI naming follow SquaredUp guidelines
  • Logo added
  • One or more dashboards added
  • README added including configuration guidance
  • No secrets or credentials included
  • I agree to the Code of Conduct

@andrewmumblebee andrewmumblebee mentioned this pull request Jun 23, 2026
6 tasks
@andrewmumblebee andrewmumblebee added the new-plugin Used to PR newly added plugins label Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e4b0f1e1-2810-4323-8006-e4daed0dc47b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🧩 Plugin PR Summary

📦 Modified Plugins

  • plugins/Sanity/v1

📋 Results

Step Status
Validation ❌ Failed
Deployment ⏭️ Skipped

🔍 Validation Details

plugins/Sanity/v1
{
  "valid": false,
  "errors": [
    {
      "file": "indexDefinitions/default.json",
      "message": "Unrecognized key: dependsOn",
      "path": [
        "steps",
        1,
        "dependsOn"
      ]
    }
  ]
}

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

Labels

new-plugin Used to PR newly added plugins

Development

Successfully merging this pull request may close these issues.

1 participant