Skip to content

Conversation

@magnusbaeck
Copy link
Member

Applicable Issues

Closes #131

Description of the Change

Fixes two fatal problems encountered while trying to update schemas and generate POJOs on Linux:

  • Removes backslashes from pathnames. Reworks various constants in EiffelConstants to be java.nio.file.Path objects instead of strings. That makes the intention of the constants clear and we can easily work with Path objects to generate correct paths on any platform.
  • Makes schema generation independent of order of files returned from OS. Previously all versions of the events were returned and they were all converted and written to the same destination file. This happened to work fine when the list of files returned from File.listFiles() was in the correct order so that the latest version was the last file to be processed. If that wasn't the case one or more schema files didn't get the most recent version of the event. We address this by using a version string parser to sort the filenames in version order before picking the greatest version and generating a schema from that file only.

Alternate Designs

None.

Benefits

Non-Windows users can update the schemas.

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: Magnus Bäck <magnus.back@axis.com>

Rework various constants in EiffelConstants to be java.nio.file.Path
objects instead of strings. That makes the intention of the constants
clear and we can easily work with Path objects to generate correct
paths on any platform.
Previously all versions of the events were returned and they were all
converted and written to the same destination file. This happened to
work fine when the list of files returned from File.listFiles()
was in the correct order so that the latest version was the last file
to be processed. If that wasn't the case one or more schema files
didn't get the most recent version of the event.

We address this by using a version string parser to sort the filenames
in version order before picking the greatest version and generating a
schema from that file only.
Copy link

@raja-maragani raja-maragani left a comment

Choose a reason for hiding this comment

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

Nice code refactor changes.

@m-linner-ericsson
Copy link
Member

@raja-maragani @SantoshNC68: Should we merge this now or do we have anything outstanding?

@SantoshNC68
Copy link
Member

We have a small task to change the domain Id part of handling, once that is done we can merge this changes
We will complete that task soon.

@magnusbaeck
Copy link
Member Author

We have a small task to change the domain Id part of handling, once that is done we can merge this changes
We will complete that task soon.

How does the domain id code overlap with this patch?

@SantoshNC68
Copy link
Member

sorry thought this was the paris release, the other PR. my mistake. It is ok to merge this change.

@SantoshNC68
Copy link
Member

I will merge these changes

@SantoshNC68 SantoshNC68 merged commit 0390ff2 into eiffel-community:master Apr 20, 2021
@SantoshNC68
Copy link
Member

Will make a release of this along with the domain Id changes.

@magnusbaeck
Copy link
Member Author

Thanks! I'm just about to push the PR for reverting manual changes which would enable merging the Paris update. Including those two PRs in the new release would probably save everyone's time.

@magnusbaeck magnusbaeck deleted the non-windows branch April 20, 2021 13:31
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.

Schema update process only runs on Windows

4 participants