Skip to content

Conversation

paula-stacho
Copy link
Collaborator

@paula-stacho paula-stacho commented Aug 29, 2025

Description

Small follow up on the edit and delete field operations - ensuring the list of required stays up to date. We don't visualize required atm so this is not super obvious, but it would show in the exported schema and also it could lead to bugs later on.

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)

@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 12:26
@paula-stacho paula-stacho requested a review from a team as a code owner August 29, 2025 12:26
@github-actions github-actions bot added the fix label Aug 29, 2025
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 fixes a bug in the data modeling functionality where the required field list was not being properly maintained when fields were removed or renamed from schemas. The fix ensures that when a field is deleted, it's also removed from the required array, and when a field is renamed, the required array is updated to reference the new field name.

Key changes:

  • Enhanced removeField operation to clean up the required array by removing deleted field names
  • Enhanced renameField operation to update field names in the required array
  • Added comprehensive test coverage for both operations to verify required field handling

Reviewed Changes

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

File Description
packages/compass-data-modeling/src/utils/schema-traversal.tsx Added logic to maintain required field lists during remove and rename operations
packages/compass-data-modeling/src/utils/schema-traversal.spec.tsx Added test cases to verify required field cleanup and updates

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 Aug 29, 2025
@paula-stacho paula-stacho merged commit f1a9036 into main Sep 1, 2025
64 of 67 checks passed
@paula-stacho paula-stacho deleted the COMPASS-9659-update-required branch September 1, 2025 13:55
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.

2 participants