eiffel-community / eiffel

The Eiffel framework vocabulary, descriptions, guides and schemas along with links to relevant implementation repositories.
Apache License 2.0
122 stars 59 forks source link

Schema correction for ActC #377

Closed e-backmark-ericsson closed 9 months ago

e-backmark-ericsson commented 10 months ago

Applicable Issues

Closes #376

Description of the Change

Updated the event schema for ActC with correct spelling of 'additionalProperties', in a new major version of the event. The major version is stepped for clarity, even though it could be considered a backwards compatible change by most consumers. A producer that faultily add additional properties to this event will now need to be updated, so from a producer point-of-view this change is non-backwards compatible. No old event version was altered.

Alternate Designs

.

Benefits

Correct event schema for ActC

Possible Drawbacks

None

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

Signed-off-by: Emil Bäckmark emil.backmark@ericsson.com

e-backmark-ericsson commented 10 months ago

Should we really correct the old schemas, as I've done in the last commit, or should we let them be and just create a new version of the faulty event schema? I actually think so, but then we can not include a validation of all old event schemas...

e-backmark-ericsson commented 9 months ago

I'll commit the updates and then we should discuss how to deal with old schemas and with the non-backwards compatible issue.

e-backmark-ericsson commented 9 months ago

Discussed Jan 4 with Magnus:

e-backmark-ericsson commented 9 months ago

I am usually for stepping version when changing files but like to discuss the consequences of correcting this without stepping the versions.

I agree, and that is what is done in this PR. The bug is corrected in a new version of the ActC event, with a new major version on it.

e-backmark-ericsson commented 9 months ago

@m-linner-ericsson , given the recent TC discussions and the newly created issue #390, are you ok with approving this PR?

m-linner-ericsson commented 9 months ago

@m-linner-ericsson , given the recent TC discussions and the newly created issue #390, are you ok with approving this PR?

What about the TODO in the PR description?

TODO: Clarify why major version is stepped

e-backmark-ericsson commented 9 months ago

@m-linner-ericsson , given the recent TC discussions and the newly created issue #390, are you ok with approving this PR?

What about the TODO in the PR description?

TODO: Clarify why major version is stepped

I think that comment was left there without a valid reason. Anyway, I updated the description text slightly now for some more clarity on why the major version is stepped.

e-backmark-ericsson commented 9 months ago

Rebased

Current diff:

$ python3 diff_definitions.py origin/master
diff -u definitions/EiffelActivityCanceledEvent/3.2.0.yml definitions/EiffelActivityCanceledEvent/4.0.0.yml
diff -u schemas/EiffelActivityCanceledEvent/3.2.0.json schemas/EiffelActivityCanceledEvent/4.0.0.json

$ diff -u definitions/EiffelActivityCanceledEvent/3.2.0.yml definitions/EiffelActivityCanceledEvent/4.0.0.yml
--- definitions/EiffelActivityCanceledEvent/3.2.0.yml   2024-01-16 08:41:26.371764600 +0100
+++ definitions/EiffelActivityCanceledEvent/4.0.0.yml   2024-01-16 08:41:26.373301100 +0100
@@ -1,4 +1,4 @@
-# Copyright 2017-2023 Ericsson AB and others.
+# Copyright 2017-2024 Ericsson AB and others.
 # For a full list of individual contributors, please see the commit history.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -44,7 +44,7 @@
   - meta
   - data
   - links
-additonalProperties: false
+additionalProperties: false
 _links:
   ACTIVITY_EXECUTION:
     description: Declares the activity execution that was canceled.
@@ -94,6 +94,8 @@
       types:
         - EiffelFlowContextDefinedEvent
 _history:
+  - version: 4.0.0
+    changes: Fix bug in schema regarding additionalProperties (see [Issue 376](https://github.com/eiffel-community/eiffel/issues/376)).
   - version: 3.2.0
     introduced_in: edition-arica
     changes: Add schema URL to the meta object (see [Issue 280](https://github.com/eiffel-community/eiffel/issues/280)).

$ diff -u schemas/EiffelActivityCanceledEvent/3.2.0.json schemas/EiffelActivityCanceledEvent/4.0.0.json
--- schemas/EiffelActivityCanceledEvent/3.2.0.json      2024-01-16 08:44:09.120670000 +0100
+++ schemas/EiffelActivityCanceledEvent/4.0.0.json      2024-01-16 08:44:09.164362000 +0100
@@ -18,9 +18,9 @@
         "version": {
           "type": "string",
           "enum": [
-            "3.2.0"
+            "4.0.0"
           ],
-          "default": "3.2.0"
+          "default": "4.0.0"
         },
         "time": {
           "type": "integer"
@@ -184,5 +184,5 @@
     "data",
     "links"
   ],
-  "additonalProperties": false
+  "additionalProperties": false
 }