Skip to content

Conversation

jcobis
Copy link
Collaborator

@jcobis jcobis commented Oct 20, 2025

Description

Include MongoDB collection validation rules in LLM requests to improve faker.js schema generation quality and accuracy.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Better faker mappings: Eg. Email regex patterns → faker.internet.email() vs generic strings
  • Numeric validation rules inform min/max ranges
  • Help ensure generated mock data respects collection validation rules

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the feat label Oct 20, 2025
@jcobis jcobis added the no release notes Fix or feature not for release notes label Oct 20, 2025
@jcobis jcobis marked this pull request as ready for review October 20, 2025 17:53
@jcobis jcobis requested a review from a team as a code owner October 20, 2025 17:53
Copy link
Contributor

@Copilot 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

This PR enhances the mock data schema generation feature by including MongoDB collection validation rules in LLM requests. This allows the AI to generate more accurate faker.js mappings that respect collection constraints (e.g., email patterns, numeric ranges).

Key changes:

  • Added validationRules parameter to LLM request payload
  • Added comprehensive test coverage for validation rules handling (provided, null, and undefined cases)

Reviewed Changes

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

File Description
packages/compass-generative-ai/src/atlas-ai-service.ts Added validationRules field to the request body sent to the LLM service
packages/compass-generative-ai/src/atlas-ai-service.spec.ts Added test coverage for validation rules inclusion in requests, including edge cases for null and undefined values

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jcobis jcobis merged commit 077dc66 into main Oct 21, 2025
64 of 67 checks passed
@jcobis jcobis deleted the CLOUDP-347304 branch October 21, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants