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

Update the ModelManager to handle multiple metamodel versions. #986

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Atul-khadse
Copy link

Closes #556

  • This PR adds metamodel versioning support to the Concerto codebase, allowing for the validation and processing of multiple metamodel versions (1.0.0 and 1.1.0). It introduces a dynamic versioning strategy to ensure backward compatibility and prepare for future versions.

Changes

  • Added metamodelVersions array to ModelManager to store supported metamodel versions.
  • Implemented validateMetamodelVersion method to check the version before adding a model.
  • Refactored addModel to extract the version from ast.$class and validate it.
  • Enhanced error messages for unsupported versions.

Flags

  • Future versions (2.x) will require a separate strategy to ensure backward compatibility.
  • This PR only supports 1.0.0 and 1.1.0 for now

Related Issues

* @throws {IllegalModelException}
* @return {ModelFile} The newly added model file (internal).
*/
addModel(ast, cto, fileName, disableValidation) {
Copy link
Member

Choose a reason for hiding this comment

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

This would override the addModel in BaseModelManager.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for pointing that out! I’ll review it and make sure the base functionality remains unaffected. I think if we want to extend the addModel from BaseModelManager without overriding it completely, we can call the parent method using super.addModel(...) like this

* @throws {Error} If the version is not supported.
*/
validateMetamodelVersion(version) {
if (!this.metamodelVersions.includes(version)) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks a lot for the PR. But we first need to decide on the strategy how do we support multiple versions of metamodel first and then make relavant changes.

Happy to hear you opinions on the issue discssion board. Thanks!

Copy link
Author

Choose a reason for hiding this comment

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

@sanketshevkar Thank you for the feedback! That makes sense. I'll share my thoughts on the strategy for supporting multiple metamodel versions on the issue discussion board. Looking forward to collaborating on this further!

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.

Fully support metamodel versioning
2 participants