fix(compare): correct drift classification and improve object comparison stability#141
Merged
fix(compare): correct drift classification and improve object comparison stability#141
Conversation
- Modify comparison logic to classify only orphaned and drift folders as 'DRIFT'; added folders are now considered growth and result in a 'PASS'. - Update related tests to reflect the new logic, ensuring accurate detection of drift and growth scenarios.
…terminism in tests
- Introduce `normalizeObject` and `objectsEqual` functions to ensure stable comparison of objects with varying key orders. - Update comparison logic to handle props and emits as arrays, ensuring valid identifiers are used and filtering out invalid entries. - Improve display functions to accurately reflect changes in props and emits, including handling order changes. - Refactor multiFile and singleFile comparison logic for consistency and robustness against edge cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR improves the robustness and correctness of the
comparecommand.Drift classification fix
Updates drift detection logic so that added folders are treated as growth rather than drift.
DRIFTPASSComparison robustness improvements
Improves object comparison and contract display logic to avoid false positives caused by key ordering and invalid entries.
Changes include:
normalizeObjectandobjectsEqualutilities to ensure stable comparison of objects with different key orderspropsandemitsarrays by filtering invalid entries and ensuring identifier validityTests were updated to reflect the new drift classification and improved comparison behavior.
Type of Change
Architectural Impact
Testing
Related Issues
None.
Checklist
mainAdditional Notes
These improvements reduce false positives in comparison results and make drift detection more aligned with real-world development workflows.