Skip to content

[1245] Uniformize read-only computation#1508

Merged
AxelRICHARD merged 2 commits into
mainfrom
gda/enh/refactorReadOnly
Sep 25, 2025
Merged

[1245] Uniformize read-only computation#1508
AxelRICHARD merged 2 commits into
mainfrom
gda/enh/refactorReadOnly

Conversation

@gdaniel

@gdaniel gdaniel commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Bug: #1245

Fixes #1245

PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW

Project management

  • Has the pull request been added to the relevant milestone?
  • Have the priority: and pr: labels been added to the pull request? (In case of doubt, start with the labels priority: low and pr: to review later)
  • Have the relevant issues been added to the pull request?
  • Have the relevant labels been added to the issues? (area:, type:)
  • Have the relevant issues been added to the same project milestone as the pull request?

Changelog and release notes

  • Has the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc been updated to reference the relevant issues?
  • Have the relevant API breaks been described in the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a change with a visual impact, are there any screenshots in the doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a key change, has the change been added to Key highlights section in doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • Are the new / upgraded dependencies mentioned in the relevant section of the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?

Documentation

  • Have you included an update of the documentation in your pull request? Please ask yourself if an update (installation manual, user manual, developer manual...) is needed and add one accordingly.

Tests

  • Is the code properly tested? Any pull request (fix, enhancement or new feature) should come with a test (or several). It could be unit tests, integration tests or cypress tests depending on the context. Only doc and releng pull request do not need for tests.

@gdaniel

gdaniel commented Aug 28, 2025

Copy link
Copy Markdown
Contributor Author

This PR also fixes #1342

@gdaniel gdaniel force-pushed the gda/enh/refactorReadOnly branch from 3ab13a6 to 25509a3 Compare September 23, 2025 13:47
@gdaniel

gdaniel commented Sep 23, 2025

Copy link
Copy Markdown
Contributor Author

This PR updates what is considered read-only as follows:

  • (Sirius Web) libraries imported by reference are always read-only
  • (Sirius Web) libraries imported by copy are always read-write
  • Textual SysML imported as read-only/read-write is read-only/read-write
  • Standard libraries (SysML and KerML) are always read-only

As a summary, resources are read-only when a user imports them as read-only, or if they contain standard SysML/KerML models.

The previous implementation added an extra hypothesis and made resources containing at least one LibraryPackage with isStandard=true read-only. This is not the case anymore, and these resources are read-only based on how they have been created/imported. This change is motivated by #1286, which prevents users from updating LibraryPackage#isStandard, and the internal discussions we had stating that only KerML and SysML libraries should have this attribute set to true.

Comment thread CHANGELOG.adoc
The `org.eclipse.syson.services.grammars` package in `syson-direct-edit-grammar` has been renamed into `org.eclipse.syson.direct.edit.grammars`.
`AbtractItemUsageBorderNodeDescriptionProvider` has been renamed to `AbstractItemUsageBorderNodeDescriptionProvider`.
- https://github.com/eclipse-syson/syson/pull/1508[#1245] [syson] Uniformize read-only computation.
The class `SysMLReadOnlyService` and the interface `ISysMLReadOnlyService` have been removed, use `IReadOnlyObjectPredicate` instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't mention this API break in the release notes, I don't think it is very useful to the end users. Let me know if I should add it there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, no need to mention API breaks in the release notes

@gdaniel gdaniel marked this pull request as ready for review September 23, 2025 13:49
@gdaniel gdaniel force-pushed the gda/enh/refactorReadOnly branch from 25509a3 to 7045bdc Compare September 23, 2025 13:50
@gdaniel gdaniel added this to the 2025.10.0 milestone Sep 23, 2025
@gdaniel gdaniel force-pushed the gda/enh/refactorReadOnly branch 3 times, most recently from 310ed1d to 282ef53 Compare September 23, 2025 16:25

}

@DisplayName("GIVEN an empty SysML Project, WHEN the explorer is displayed with KerML and SysML libraries expanded, THEN the library models are visible")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added this test for testing coverage purpose. It tests whether standard library elements are editable/deletable, which wasn't tested before.

@gdaniel gdaniel force-pushed the gda/enh/refactorReadOnly branch from 282ef53 to 6395963 Compare September 23, 2025 16:27
Bug: #1245
Signed-off-by: Gwendal Daniel <gwendal.daniel@obeosoft.com>
@AxelRICHARD AxelRICHARD force-pushed the gda/enh/refactorReadOnly branch 2 times, most recently from 701c29c to f518c6c Compare September 25, 2025 13:17
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
@AxelRICHARD AxelRICHARD force-pushed the gda/enh/refactorReadOnly branch from f518c6c to 0fb0ece Compare September 25, 2025 13:19
@AxelRICHARD AxelRICHARD merged commit 3c4e6b9 into main Sep 25, 2025
4 checks passed
@AxelRICHARD AxelRICHARD deleted the gda/enh/refactorReadOnly branch September 25, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Published libraries imported by reference are editable if they contain no LibraryPackages Refactor how SysON computes whether an element is read-only

2 participants