Repository navigation
fix(*): add v3 model compatibility support and disable adding, creating and updating unversioned models - #1199
Conversation
Signed-off-by: muhammed-abdulkadir <muhammed.abdulkadir@docusign.com>
There was a problem hiding this comment.
Pull request overview
Updates Concerto v4 model loading to be more permissive about the concerto version pragma, allowing models that target an older major version to load under newer runtimes (to preserve compatibility with the existing v3 model ecosystem).
Changes:
- Extends
ModelFile#isCompatibleVersion()to accept a model’s declared version range when its minimum version targets an older major than the current runtime. - Adds clarifying JSDoc describing the new backward-compatibility behavior.
mttrbrts
left a comment
There was a problem hiding this comment.
IMO we should be stronger here @muhabdulkadir, we should specifically allow v3 versions to run with the v4 runtime, but nothing else. e.g. v0.82 is not compatible with v3
Signed-off-by: muhammed-abdulkadir <muhammed.abdulkadir@docusign.com>
Signed-off-by: muhammed-abdulkadir <muhammed.abdulkadir@docusign.com>
Signed-off-by: muhammed-abdulkadir <muhammed.abdulkadir@docusign.com>
| modelManager = new ModelManager(); | ||
| modelManager.addCTOModel('namespace test', 'test.cto'); | ||
| }).should.throw(/Cannot add an unversioned namespace/); | ||
| }).should.throw(/Cannot create a ModelFile with an unversioned namespace/); |
There was a problem hiding this comment.
When addCTOModel() is called, it internally calls addModelFile(), which parses the CTO by calling ModelFile.fromAst(). Since I added the strict validation at the ModelFile.fromAst() level (to enforce it at all entry points, not just ModelManager), the error is now thrown there first.
Signed-off-by: muhammed-abdulkadir <muhammed.abdulkadir@docusign.com>
Signed-off-by: muhammed-abdulkadir <muhammed.abdulkadir@docusign.com>
Closes #
Concerto v4 currently rejects models that declare a concerto version range targeting v3, even when those models are otherwise valid and semantically compatible with the v4 runtime. As a result, existing v3 models fail at load time and cannot be reused in v4 environments.
This change restores practical backward compatibility for v3-authored models while keeping strict validation for unsupported versions.
Screenshots or Video
Related Issues
Author Checklist
--signoffoption of git commit.mainfromfork:branchname