[5947] Add support for publishing libraries from non-main editing context#6072
Conversation
|
|
||
| Library library = Library.newLibrary() | ||
| .namespace(publishLibrariesInput.projectId()) | ||
| .namespace(publishLibrariesInput.editingContextId()) |
There was a problem hiding this comment.
I am wondering if this is a good idea.
We can maybe still use the projectId as the namespace to ensure all the libraries published from the same project are published in the same namespace.
There was a problem hiding this comment.
Looking back at it, it doesn't make sense to use the editingContextId as namespace of a library.
It should still be the projectId, even if the PublishLibrariesInput gives the editingContextId.
I'll fix that.
There was a problem hiding this comment.
Done.
Note that it is the StudioLibraryPublicationListener that is in charge of retrieving the projectId. This means that if, somehow, someone attempts to publish a library from an editing context not contained in a project, the StudioLibraryPublicationHandler will create the library SemanticData, but the Library itself won't be created.
I don't know if I need to do anything else in this PR (e.g. compute the namespace in the handler and pass it to the listener via StudioLibrarySemanticDataCreationRequested) , or if fixing #6075 will be good enough to ensure we never reach this state.
There was a problem hiding this comment.
I think it's good for the scope of this PR
a52518e to
2531d55
Compare
2531d55 to
eddf816
Compare
| // The shared component contains all its elements in its root, and its content may vary between version, | ||
| // it is more stable to use a fixed name as the resource identifier. | ||
| String resourceId = input.projectId() + ":" + "shared_components"; | ||
| String resourceId = input.editingContextId() + ":" + "shared_components"; |
There was a problem hiding this comment.
We should also keep the projectId here: we want a stable identifier for the shared_components resource, it should remain stable if the resource has been published from one editing context or another.
eddf816 to
b4fc7d8
Compare
sbegaudeau
left a comment
There was a problem hiding this comment.
This looks good, I'll merge it this week
b4fc7d8 to
1da0a9e
Compare
…text Bug: #5947 Signed-off-by: Gwendal Daniel <gwendal.daniel@obeosoft.com>
1da0a9e to
6e30b53
Compare
Bug: #5947
Fixes #5947
Pull request template
General purpose
What is the main goal of this pull request?
Project management
priority:andpr:labels been added to the pull request? (In case of doubt, start with the labelspriority: lowandpr: to review later)area:,difficulty:,type:)CHANGELOG.adocbeen updated to reference the relevant issues?CHANGELOG.adoc? (Including changes in the GraphQL API)CHANGELOG.adoc? For example indoc/screenshots/2022.5.0-my-new-feature.pngArchitectural decision records (ADR)
[doc]?CHANGELOG.adoc?Dependencies
CHANGELOG.adoc?CHANGELOG.adoc?Frontend
This section is not relevant if your contribution does not come with changes to the frontend.
General purpose
Typing
We need to improve the typing of our code, as such, we require every contribution to come with proper TypeScript typing for both changes contributing new files and those modifying existing files.
Please ensure that the following statements are true for each file created or modified (this may require you to improve code outside of your contribution).
useMutation<DATA_TYPE, VARIABLE_TYPE>(…)useQuery<DATA_TYPE, VARIABLE_TYPE>(…)useSubscription<DATA_TYPE, VARIABLE_TYPE>(…)useMachine<CONTEXT_TYPE, EVENTS_TYPE>(…)useState<STATE_TYPE>(…)?.(if the GraphQL API specifies that a field cannot benull, do not treat it has potentiallynullfor example)let diagram: Diagram | null = null;)Backend
This section is not relevant if your contribution does not come with changes to the backend.
General purpose
Architecture
Review
How to test this PR?
Please describe here the various use cases to test this pull request