concerto icon indicating copy to clipboard operation
concerto copied to clipboard

feat(compare-config): add optional includeInherited property and apply it to comparison logic

Open gaumrab opened this issue 2 months ago • 3 comments

Summary

Fixed inheritance chain comparison bug in Concerto analysis where inherited properties were incorrectly reported as "removed" when comparing model versions. Added includeInherited option to CompareConfig to properly handle inherited properties during model comparison.

Changes

  • Added includeInherited?: boolean option to CompareConfig type in compare-config.ts
  • Updated compare.ts to use getProperties() instead of getOwnProperties() when includeInherited is true
  • Modified property comparison logic to consider inherited properties from parent classes
  • Maintained backward compatibility by making includeInherited optional with default false

Flags

  • This is a breaking change for users who rely on the current behavior of ignoring inherited properties
  • Users must explicitly set includeInherited: true to get the new behavior
  • Default behavior remains unchanged to maintain backward compatibility

Screenshots or Video

Screenshot From 2025-10-22 22-30-16 image

Related Issues

  • Issue #1067: Concerto Analyser ignores the inheritance chain when comparing properties between two model versions

Author Checklist

  • [x] Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • [x] Vital features and changes captured in unit and/or integration tests
  • [x] Commits messages follow AP format
  • [ ] Extend the documentation, if necessary
  • [x] Merging to main from fork:branchname

gaumrab avatar Oct 22 '25 14:10 gaumrab

@gaumrab Could you update the PR title to follow commit conventions please? https://www.conventionalcommits.org/en/v1.0.0/

ekarademir avatar Oct 23 '25 11:10 ekarademir

sure @ekarademir

Is this looks good: feat(compare-config): add optional includeInherited property and apply it to comparison logic

according to the commit conventions.

let me know if still any change required.

gaumrab avatar Oct 23 '25 11:10 gaumrab

@gaumrab could you also add test cases for the fix?

ekarademir avatar Oct 23 '25 11:10 ekarademir

This PR is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Nov 16 '25 02:11 github-actions[bot]