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 event schemas to edition-lyon #40

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

t-persson
Copy link
Collaborator

Applicable Issues

fixes: #39

Description of the Change

The eiffel protocol has updated. Update eiffellib to follow the latest.
Also set all default versions in the event classes to the the latest eiffel spec.
Added tests that make sure that a version that exists is used as default and that the default is the latest event version.

Note that I added a tox.ini file, but updating the whole repository in this change seemed bad.
I will make another PR where black, pylint and pydocstyle are happy.

Alternate Designs

Updating this library every time that we have a new edition is a small pain, but I didn't want to dabble in auto updates right now. We should follow the same design as eiffel-go-sdk in the future.

Benefits

Latest and greatest

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: Tobias Persson [email protected]

@t-persson t-persson requested a review from a team as a code owner October 29, 2021 08:19
@t-persson t-persson requested review from fredjn and magnusbaeck and removed request for a team October 29, 2021 08:19
Copy link
Member

@magnusbaeck magnusbaeck left a comment

Choose a reason for hiding this comment

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

I haven't cross-checked the event versions or the completeness or correctness of the schemas.

Comment on lines +74 to +88
def _latest_schema(self, base_path):
"""Find the latest schema file in path.

:param base_path: The base path of the events schemas.
:type base_path: str
:return: The latest version found in path.
:rtype: :obj:`packagin.version.Version`
"""
latest = None
for path in glob.glob("%s/*.json" % base_path):
name = path.split("/")[-1]
version = parse(name.replace(".json", ""))
if latest is None or version > latest:
latest = version
return latest
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be more robust to read the version from the schema and not be dependent a particular filename?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably, but the eiffellib uses the filenames for versioning so we have to test it the same way.
If we want to change it in the library, then we should write an issue on it.

@t-persson t-persson merged commit 72a9f58 into eiffel-community:main Nov 4, 2021
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.

Support schemas introduced in Lyon edition
3 participants