Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(*): compare two concerto models (contributes to #442) #476

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

sstone1
Copy link
Contributor

@sstone1 sstone1 commented Aug 5, 2022

Introduce a new API and CLI command that allows you to compare two versions of the same model to determine how compatible your changes are, so that you can make a decision of how to increment the version. Breaking changes should result in major version changes, and compatible changes should result in minor or patch version changes.

CLI examples:

% concerto compare --old compare-a.cto --new compare-b.cto
[required-field-added]: The required field "flag" was added to the concept "Thing" (major)

overall result: major
% concerto compare --old compare-b.cto --new compare-c.cto
[optional-field-added]: The optional field "number" was added to the concept "Thing" (patch)

overall result: patch
% concerto compare --old compare-a.cto --new compare-c.cto
[required-field-added]: The required field "flag" was added to the concept "Thing" (major)
[optional-field-added]: The optional field "number" was added to the concept "Thing" (patch)

overall result: major

There's a lot more work to be done to fully find all the differences; the following differences are identified so far:

  • Namespace changed
  • Declaration added
  • Declaration removed
  • Required/optional field added
  • Field removed

Signed-off-by: Simon Stone [email protected]

@sstone1 sstone1 force-pushed the simon-stone/concerto-compare branch from 39a9a65 to 6289259 Compare August 5, 2022 10:30
@sstone1 sstone1 marked this pull request as ready for review August 5, 2022 12:53
@sstone1 sstone1 requested review from mttrbrts and dselman August 5, 2022 12:53
Copy link
Contributor

@dselman dselman left a comment

Choose a reason for hiding this comment

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

Looks great! I didn't see any tests for enums...

@sstone1 sstone1 merged commit 2e17bf1 into accordproject:master Aug 5, 2022
@sstone1 sstone1 deleted the simon-stone/concerto-compare branch August 5, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants