DSD-DBS / capella-collab-manager

A web app for collaboration on Capella (MBSE) projects
https://dsd-dbs.github.io/capella-collab-manager/
Apache License 2.0
23 stars 4 forks source link

Add library support in Collab Manager #232

Closed MoritzWeber0 closed 1 year ago

MoritzWeber0 commented 2 years ago

Capella offers a feature called "libraries". With libraries, you can reference and use objects from the library model.

While the library model can be developed independently in another workstream, this is not reflected in TeamForCapella. In TeamForCapella, a library model has to live in the same repository.

In general, there are two different options that are in use: 1) The library should reference a specific fixed version of the library model. This depends on the release management implementation (#231). The model with the represented version should be exported to the corresponding T4C repository. 2) The library should reference the latest version of the library model. In this case, there should be regular backup job that exports the latest Git version to the T4C repository.

Related work: In version 2, there will a flag to mark a model as library. However, there is not much functionality around it.

MoritzWeber0 commented 1 year ago

Resolved with the implementation of general tool (and types) support.

MoritzWeber0 commented 1 year ago

Needs some testing

amolenaar commented 1 year ago

Check test models in py-capellambse

amolenaar commented 1 year ago

Hi,

I tried with the test models from py-capellambse, on a local k3d setup. I configured 2 models, one for /tests/data/Library Project/Library Project.aird (library) and one for /tests/data/Library Test/Library Test.aird (model). A readonly session does not load. My readonly session image is k3d-myregistry.localhost:12345/capella/remote:$version-latest.

@MoritzWeber0 Any idea what's going on?

readonly session logs ``` + echo ---START_PREPARE_WORKSPACE--- ---START_PREPARE_WORKSPACE--- + export DISPLAY=:99 + DISPLAY=:99 + /opt/capella/capella -clean -data /workspace --launcher.suppressErrors -nosplash -consolelog -application org.eclipse.ease.runScript -script file:/opt/scripts/load_models.py + Xvfb :99 -screen 0 1920x1080x8 -nolisten tcp _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created. !SESSION 2022-11-28 15:48:04.391 ----------------------------------------------- eclipse.buildId=unknown java.version=14.0.2 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB Framework arguments: -application org.eclipse.ease.runScript -script file:/opt/scripts/load_models.py Command-line arguments: -os linux -ws gtk -arch x86_64 -clean -data /workspace -consolelog -application org.eclipse.ease.runScript -script file:/opt/scripts/load_models.py !ENTRY org.eclipse.ease 1 0 2022-11-28 15:48:16.493 !MESSAGE Loading early startup extension: org.eclipse.ease.ui.scripts.repository.impl.Startup !ENTRY org.eclipse.ease 1 0 2022-11-28 15:48:16.816 !MESSAGE Loading early startup extension: org.eclipse.swtbot.generator.server.StartupRecorderServer !ENTRY org.eclipse.ease 1 0 2022-11-28 15:48:16.817 !MESSAGE Loading early startup extension: org.eclipse.swtbot.eclipse.ui.preferences.PreferenceInitializer !ENTRY org.eclipse.ease 1 0 2022-11-28 15:48:17.997 !MESSAGE Loading early startup extension: org.eclipse.mylyn.internal.team.ui.FocusedTeamUiPlugin$FocusedTeamUiStartup !ENTRY org.eclipse.osgi 4 0 2022-11-28 15:48:18.002 !MESSAGE An error occurred while automatically activating bundle org.eclipse.mylyn.team.ui (366). !STACK 0 org.osgi.framework.BundleException: Exception in org.eclipse.mylyn.internal.team.ui.FocusedTeamUiPlugin.start() of bundle org.eclipse.mylyn.team.ui. at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:864) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:792) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365) at org.eclipse.osgi.container.Module.doStart(Module.java:605) at org.eclipse.osgi.container.Module.start(Module.java:468) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493) at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:477) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:620) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:923) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63) at org.eclipse.ease.tools.PlatformExtension.createInstance(PlatformExtension.java:46) at org.eclipse.ease.applications.RunHeadlessScript.loadStartupExtension(RunHeadlessScript.java:63) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1694) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at org.eclipse.ease.applications.RunHeadlessScript.loadEarlyStartupExtensions(RunHeadlessScript.java:258) at org.eclipse.ease.applications.RunHeadlessScript.start(RunHeadlessScript.java:151) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) at org.eclipse.equinox.launcher.Main.run(Main.java:1447) at org.eclipse.equinox.launcher.Main.main(Main.java:1420) Caused by: java.lang.IllegalStateException: Workbench has not been created yet. at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:99) at org.eclipse.mylyn.internal.team.ui.FocusedTeamUiPlugin.start(FocusedTeamUiPlugin.java:72) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:843) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) at java.base/java.security.AccessController.doPrivileged(AccessController.java:554) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835) ... 45 more Root exception: java.lang.IllegalStateException: Workbench has not been created yet. at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:99) at org.eclipse.mylyn.internal.team.ui.FocusedTeamUiPlugin.start(FocusedTeamUiPlugin.java:72) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:843) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) at java.base/java.security.AccessController.doPrivileged(AccessController.java:554) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:792) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365) at org.eclipse.osgi.container.Module.doStart(Module.java:605) at org.eclipse.osgi.container.Module.start(Module.java:468) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493) at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:477) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:620) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:923) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63) at org.eclipse.ease.tools.PlatformExtension.createInstance(PlatformExtension.java:46) at org.eclipse.ease.applications.RunHeadlessScript.loadStartupExtension(RunHeadlessScript.java:63) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1694) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at org.eclipse.ease.applications.RunHeadlessScript.loadEarlyStartupExtensions(RunHeadlessScript.java:258) at org.eclipse.ease.applications.RunHeadlessScript.start(RunHeadlessScript.java:151) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) at org.eclipse.equinox.launcher.Main.run(Main.java:1447) at org.eclipse.equinox.launcher.Main.main(Main.java:1420) ERROR: Could not create instance for startup code: org.eclipse.mylyn.internal.team.ui.FocusedTeamUiPlugin$FocusedTeamUiStartup !ENTRY org.eclipse.ease 1 0 2022-11-28 15:48:18.004 !MESSAGE Loading early startup extension: org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin$TasksUiStartup !ENTRY org.eclipse.ease 1 0 2022-11-28 15:48:18.507 !MESSAGE Loading early startup extension: org.eclipse.swtbot.generator.ui.StartupRecorder !ENTRY org.eclipse.ease.lang.python 4 0 2022-11-28 15:48:18.895 !MESSAGE The method name "zip" from the module "__EASE_MOD_org_eclipse_ease_modules_platform_resources_ResourcesModule" can not be wrapped because it's name is reserved ---START_LOAD_MODEL--- INFO:/opt/capella/plugins/org.eclipse.ease.lang.python.py4j_0.10.0.I202209201249/pysrc/ease_py4j_main.py:Cloning git repository with url https://github.com/DSD-DBS/py-capellambse.git Cloning into '/tmp/models/bf6470f616c390c41fca1c22b5e938f10e345891'... INFO:/opt/capella/plugins/org.eclipse.ease.lang.python.py4j_0.10.0.I202209201249/pysrc/ease_py4j_main.py:Clone of git repository with url https://github.com/DSD-DBS/py-capellambse.git was successful ---FAILURE_LOAD_MODEL--- INFO:py4j.clientserver:Received command c on object id p8 org.eclipse.ease.ScriptExecutionException: Traceback (most recent call last): File "<...>", line 142, in File "<...>", line 137, in File "<...>", line 102, in generate_project_file StopIteration !ENTRY org.eclipse.mylyn.monitor.ui 4 0 2022-11-28 15:48:20.983 !MESSAGE Monitor UI stop failed !STACK 0 java.lang.IllegalStateException: Workbench has not been created yet. at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:99) at org.eclipse.ui.plugin.AbstractUIPlugin.getWorkbench(AbstractUIPlugin.java:293) at org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin.stop(MonitorUiPlugin.java:165) at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:900) at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:1) at java.base/java.security.AccessController.doPrivileged(AccessController.java:554) at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:892) at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:1029) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:370) at org.eclipse.osgi.container.Module.doStop(Module.java:660) at org.eclipse.osgi.container.Module.stop(Module.java:521) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1886) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1761) at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:275) at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:202) at org.eclipse.osgi.container.Module.doStop(Module.java:660) at org.eclipse.osgi.container.Module.stop(Module.java:521) at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207) at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:220) at java.base/java.lang.Thread.run(Thread.java:832) Capella: JVM terminated. Exit code=255 /opt/capella/jre/bin/java -Dosgi.requiredJavaVersion=14 -Xms1000m -Xmx3000m -Xss4m -Dosgi.configuration.area=file:/opt/capella/configuration -Dorg.eclipse.swtbot.search.timeout=1000 -jar /opt/capella//plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar -os linux -ws gtk -arch x86_64 -launcher /opt/capella/capella -name Capella --launcher.library /opt/capella//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1200.v20200508-1552/eclipse_1801.so -startup /opt/capella//plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar --launcher.overrideVmargs -exitdata 3 -clean -data /workspace -consolelog -application org.eclipse.ease.runScript -script file:/opt/scripts/load_models.py -vm /opt/capella/jre/bin/java -vmargs -Dosgi.requiredJavaVersion=14 -Xms1000m -Xmx3000m -Xss4m -Dosgi.configuration.area=file:/opt/capella/configuration -Dorg.eclipse.swtbot.search.timeout=1000 -jar /opt/capella//plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar ```
MoritzWeber0 commented 1 year ago

Hi,

I tried with the test models from py-capellambse, on a local k3d setup. I configured 2 models, one for /tests/data/Library Project/Library Project.aird (library) and one for /tests/data/Library Test/Library Test.aird (model). A readonly session does not load. My readonly session image is k3d-myregistry.localhost:12345/capella/remote:$version-latest.

@MoritzWeber0 Any idea what's going on?

readonly session logs

Hi @amolenaar,

sorry for the late reply. Can you try whether it works with this fix? https://github.com/DSD-DBS/capella-dockerimages/pull/73 It adds support for entrypoints with a starting / character.

amolenaar commented 1 year ago

A library still shows as a model in Capella:

image

MoritzWeber0 commented 1 year ago

A library still shows as a model in Capella:

image

In general, this is ok (as long as the "real" project is able to reference the library project).

amolenaar commented 1 year ago

@MoritzWeber0

image

It required one small fix: https://github.com/DSD-DBS/capella-dockerimages/pull/97, then it "just works".

MoritzWeber0 commented 1 year ago

@MoritzWeber0

image

It required one small fix: DSD-DBS/capella-dockerimages#97, then it "just works".

Perfect, thanks for the update! :)