Skip to content

Cicero should check that the template version is a valid semver #499

@jeromesimeon

Description

@jeromesimeon

Describe the bug
Each Accord Project template has a version number that is assumed to be a valid semver (https://semver.org).

Currently the check for valid semver uses a coercion on the version for both Cicero and the template:

https://github.com/accordproject/cicero/blob/c348ab2ae36ee70c43cb0d26402450d7517a3e26/packages/cicero-core/src/metadata.js#L79-L86

This does not update the versions in the package.json which means applications relying on those to be proper semver numbers would have to do the same coercion, which isn't documented.

To Reproduce
Steps to reproduce the behavior:

  1. got to any existing template
  2. Change the template version to 1.0
  3. Call cicero archive
  4. See that it does not raise an error

Changing the template version to foo would raise an error.

Expected behavior
Reject non-valid semver versions in templates.

Metadata

Metadata

Assignees

Labels

1.0Type: Bug 🐛Something isn't workingmaintainer-engagedA maintainer has commented or reviewed this item

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions