-
Notifications
You must be signed in to change notification settings - Fork 66
[1861] Split responsibilities of SysONLibraryPublicationHandler #1874
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
base: cooldown
Are you sure you want to change the base?
[1861] Split responsibilities of SysONLibraryPublicationHandler #1874
Conversation
35379e7 to
6a6350f
Compare
| .toList(); | ||
| } | ||
|
|
||
| protected Optional<SemanticData> publishAsLibrary(final ICause parentCause, final Collection<Resource> resources, final String libraryNamespace, final String libraryName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why some methods here are protected and some others private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reasons SysONLibraryPublicationHandler had a single private method but I missed it.
Fixed by setting the private ones to protected so downstream applications can easily fork the SysON default implementation to suit their own needs.
| .formatted(libraryMetadataAdapter.getNamespace(), libraryMetadataAdapter.getName(), | ||
| libraryMetadataAdapter.getVersion()))); | ||
| }); | ||
| // Ignore the resource if it isn't a library: all non-library resources are published in a single |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this comment is here, not attached to anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by rewording the comment and moving it before the call to getLibraryMetadata(Resource).ifPresent(...) which is the subject for that comment.
| result = new ErrorPayload(cause.id(), | ||
| List.of(new Message("Cannot publish SysML library from editing context '%s'.".formatted(libraryAuthoringEditingContext.getId()), MessageLevel.ERROR))); | ||
| } else if (this.librarySearchService.findByNamespaceAndNameAndVersion(libraryNamespace, libraryName, libraryVersion).isPresent()) { | ||
| // Sirius Web works assumes that published libraries are immutable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works or assumes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of both I guess :-) Fixed by rewording that comment.
|
|
||
| final Optional<SemanticData> maybePublishedLibrarySemanticData = this.publishAsLibrary(cause, resourcesToPublish, libraryNamespace, libraryName, libraryVersion, libraryDescription, | ||
| dependencies); | ||
| // After this transaction is done, SysONLibraryPublicationListener reacts by also creating the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comments till true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that is still the case.
| return result; | ||
| } | ||
|
|
||
| private IPayload doPublish(final ICause cause, final IEMFEditingContext emfEditingContext, final String libraryNamespace, final String libraryName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please describe in the javadoc what this method does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by adding Javadoc to that method.
Bug: eclipse-syson#1861 Signed-off-by: Florent Latombe <florent.latombe@obeo.fr>
6a6350f to
3b44578
Compare
Bug: #1861
PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW
Auto review
Project management
priority:andpr:labels been added to the pull request? (In case of doubt, start with the labelspriority: lowandpr: to review later)area:,type:)Changelog and release notes
CHANGELOG.adoc+doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adocbeen updated to reference the relevant issues?CHANGELOG.adoc?CHANGELOG.adoc?doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Key highlightssection indoc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Documentation
Tests