Skip to content

Conversation

@paula-stacho
Copy link
Collaborator

@paula-stacho paula-stacho commented Oct 22, 2025

Description

Storing database with diagram. I figured since we're before release, we can make this non-optional - so you'll loose your pre-existing diagrams, but we don't have to maintain any fallbacks going forward.

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

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

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)

@paula-stacho paula-stacho requested a review from a team as a code owner October 22, 2025 16:50
@github-actions github-actions bot added the fix label Oct 22, 2025
Copy link
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

This PR adds mandatory database storage to diagram data, making the database field required instead of optional. Since this is a pre-release change, fallback logic for handling diagrams without database information is removed.

  • Adds database field to diagram storage schema and all diagram operations
  • Updates diagram creation, export, and import flows to include database information
  • Refactors collection naming to use stored database field instead of deriving it from namespace
  • Updates tests and fixtures to include the new required database field

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
packages/compass-data-modeling/src/services/data-model-storage.ts Adds required database field to MongoDBDataModelDescription schema
packages/compass-data-modeling/src/store/diagram.ts Updates diagram state management to include database field and refactors collection naming logic
packages/compass-data-modeling/src/store/analysis-process.ts Adds database field to analysis completion action
packages/compass-data-modeling/src/store/export-diagram.ts Updates diagram export to include database parameter
packages/compass-data-modeling/src/services/open-and-download-diagram.ts Updates diagram file format to include database field with validation
packages/compass-data-modeling/src/components/saved-diagrams-list.tsx Simplifies database display by using stored database field instead of deriving from collections
packages/compass-data-modeling/src/components/diagram-card.tsx Updates component type to remove decorated databases field
packages/compass-e2e-tests/tests/data-modeling-tab.test.ts Adds test assertion for database field in exported diagram
Multiple test files Updates test fixtures and assertions to include database field

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

@paula-stacho paula-stacho added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Oct 22, 2025
@paula-stacho paula-stacho requested a review from mabaasit October 22, 2025 16:54
* anything that would require re-fetching data associated with the diagram
*/
connectionId: z.string().nullable(),
database: z.string(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please add a processor here that would try to extract the value from existing model instead of breaking all existing diagrams? It's just a good practice to try to follow even if we know that we can break it right now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, I thought we could avoid the extra code as we don't have any public users yet, but you're right, sooner or later these things will come anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added z.preprocess

@paula-stacho paula-stacho merged commit dd76f3f into main Oct 23, 2025
61 checks passed
@paula-stacho paula-stacho deleted the COMPASS-9718 branch October 23, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature flagged PRs labeled with this label will not be included in the release notes of the next release fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants