Skip to content

feat: schema analyzer modal#258

Merged
vkarpov15 merged 2 commits into
mainfrom
vkarpov15/schema-analysis
Jun 3, 2026
Merged

feat: schema analyzer modal#258
vkarpov15 merged 2 commits into
mainfrom
vkarpov15/schema-analysis

Conversation

@vkarpov15
Copy link
Copy Markdown
Member

image image

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio Ready Ready Preview, Comment Jun 2, 2026 9:32pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f018bb58f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/src/document/document.html Outdated
<div v-if="!validationResult.valid" class="rounded border border-edge bg-muted p-3 text-sm text-content-secondary">
{{ validationResult.error }}
</div>
<div v-if="Object.keys(validationResult.errors).length > 0" class="rounded border border-edge">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard null validation errors before Object.keys

When the API returns a validation result with errors: null (which it does for valid documents and for timeout/non-ValidationError failures), this template still evaluates Object.keys(validationResult.errors), causing Vue to throw instead of rendering the modal result. This makes the new Validate action break on every valid document and on timeout-style invalid results; guard with validationResult.errors && ... or normalize errors to {} before rendering.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 new “Schema Analyzer” UI modal and supporting backend endpoints to analyze a model’s schema against stored documents, including validation results and per-path observed value type distributions. This complements the existing model/document tooling by surfacing schema/data drift and validation failures directly in the Studio UI.

Changes:

  • Add backend actions Model.analyzeSchema and Model.validateDocument plus a shared validation-with-timeout helper, and wire them into authorization.
  • Add a new frontend “Analyze Schema” modal in the Models page and a “Validate” modal action in the Document page.
  • Add test coverage for schema analysis sampling, nested paths/arrays (depth-limited), and validation timeout/parallelism behavior.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/Model.analyzeSchema.test.js Adds tests for schema analysis output, sampling behavior, nested path depth, arrays, and validation timeouts.
package.json Adds direct mpath dependency (used in frontend).
frontend/src/models/models.js Adds state + handler to open the schema analyzer modal.
frontend/src/models/models.html Adds “Analyze Schema” action and renders the modal component.
frontend/src/models/analyze-schema-modal/analyze-schema-modal.js New Vue component to fetch and display schema analysis, with filtering and type visualizations.
frontend/src/models/analyze-schema-modal/analyze-schema-modal.html New modal UI for schema analysis (summary stats, invalid docs list, per-path type breakdown).
frontend/src/document/document.js Adds “Validate Document” modal flow that calls Model.validateDocument.
frontend/src/document/document.html Adds “Validate” menu option and renders validation results in a modal.
frontend/src/api.js Adds frontend API methods for Model.analyzeSchema and Model.validateDocument (lambda + non-lambda).
backend/helpers/validateDocumentWithTimeout.js New helper to validate a hydrated doc with a 1s timeout and return structured error info.
backend/authorize.js Grants roles access to Model.analyzeSchema and Model.validateDocument.
backend/actions/Model/validateDocument.js New backend action to validate a single document by id.
backend/actions/Model/index.js Exports the new Model actions.
backend/actions/Model/analyzeSchema.js New backend action to sample documents, validate them, and compute per-path observed type counts (depth-limited).

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

Comment thread frontend/src/document/document.html Outdated
Comment thread backend/helpers/validateDocumentWithTimeout.js
@vkarpov15 vkarpov15 merged commit 4fbf609 into main Jun 3, 2026
30 checks passed
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.

2 participants