Skip to content

feat(compass-generative-ai): Update @faker-js/faker from 9.9.0 to 10.4.0 - CLOUDP-381777#8018

Merged
jcobis merged 4 commits intomainfrom
CLOUDP-381777-faker
Apr 24, 2026
Merged

feat(compass-generative-ai): Update @faker-js/faker from 9.9.0 to 10.4.0 - CLOUDP-381777#8018
jcobis merged 4 commits intomainfrom
CLOUDP-381777-faker

Conversation

@jcobis
Copy link
Copy Markdown
Collaborator

@jcobis jcobis commented Apr 23, 2026

Description

Bumps @faker-js/faker 9.9.0 → 10.4.0.

  • internet.userNameinternet.username (renamed in the LLM prompt, the type-to-method map, and the eval criterion set).
  • Added a prompt line forbidding format-string args to phone.number since v10 dropped the positional format-string signature.

Drive-by: Relaxed the Mflix cast[] / directors[] / writers[] expected methods from strict helpers.arrayElement to person.fullName.

Eval Run Results:

https://www.braintrust.dev/app/mongodb-education-ai/p/compass-mock-data-generator/experiments/CLOUDP-381777-faker-1776974054?c=CLOUDP-381777-faker-1776973928

image

Tested and Confirmed Script Succeeds:

image

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
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

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)

Copilot AI review requested due to automatic review settings April 23, 2026 19:41
@github-actions github-actions Bot added the feat label Apr 23, 2026
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

Updates Compass mock data tooling to align with @faker-js/faker v10.4.0, including method-name updates and prompt/UI guidance so generated schemas and scripts target the correct faker API.

Changes:

  • Bump @faker-js/faker to ^10.4.0 in relevant workspaces and refresh package-lock.json.
  • Update method references/docs from internet.userNameinternet.username and update the mock-data-generator prompt to reference faker v10.4.0 (including phone.number guidance).
  • Relax some eval expectations for person-name arrays (cast/directors/writers) to accept a broader “generic string” method criterion.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/compass-generative-ai/tests/evals/use-cases/mock-data-schema.ts Adjusts expected faker-method criteria for certain string-array fields in eval fixtures.
packages/compass-generative-ai/tests/evals/types.ts Updates allowed generic string faker methods (notably internet.username).
packages/compass-generative-ai/src/mock-data-generator/prompt.ts Updates LLM prompt to target faker v10.4.0 and correct method list.
packages/compass-generative-ai/package.json Bumps devDependency @faker-js/faker to ^10.4.0.
packages/compass-collection/src/components/mock-data-generator-modal/script-screen.tsx Updates user-facing install instructions to @faker-js/faker@10.
packages/compass-collection/src/components/mock-data-generator-modal/constants.ts Updates faker v10 docs link + method list (internet.username).
packages/compass-collection/package.json Bumps dependency @faker-js/faker to ^10.4.0.
package-lock.json Locks @faker-js/faker to 10.4.0 in the affected workspaces.

Comment thread packages/compass-generative-ai/tests/evals/use-cases/mock-data-schema.ts Outdated
>
npm install @faker-js/faker@9
npm install @faker-js/faker@10
</Copyable>
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

The generated instructions now tell users to install @faker-js/faker@10, but @faker-js/faker@10.4.0 declares engines node: ^20.19.0 || ^22.13.0 || … and npm: >=10 (see package-lock). Users on older Node/npm will hit install/engine errors. Consider adding a Node/npm minimum-version note in the Prerequisites UI (or choosing a faker major/version that matches the supported user runtime).

Suggested change
</Copyable>
</Copyable>
<Body className={instructionTextStyle}>
<strong>Note:</strong> <InlineCode>@faker-js/faker@10</InlineCode>{' '}
requires Node.js <InlineCode>20.19.0+</InlineCode> and npm{' '}
<InlineCode>10+</InlineCode>. If you&apos;re using an older
runtime, upgrade Node.js and npm before running this install
command.
</Body>

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Runtime fails on mongosh < 2.5 (pre-Node-20.19). Thoughts on adding a note "Requires mongosh 2.5 or later"?

Comment thread packages/compass-generative-ai/tests/evals/use-cases/mock-data-schema.ts Outdated
Comment thread packages/compass-generative-ai/tests/evals/use-cases/mock-data-schema.ts Outdated
@jcobis jcobis added the no release notes Fix or feature not for release notes label Apr 23, 2026
@jcobis jcobis marked this pull request as ready for review April 23, 2026 20:03
@jcobis jcobis requested a review from a team as a code owner April 23, 2026 20:03
@jcobis jcobis requested review from gribnoysup and mabaasit April 23, 2026 20:03
@jcobis jcobis merged commit 704fc4e into main Apr 24, 2026
84 of 87 checks passed
@jcobis jcobis deleted the CLOUDP-381777-faker branch April 24, 2026 20:20
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