Skip to content

Digital twin registry impl#820

Closed
FaheemBhatti wants to merge 25 commits into
eclipse-basyx:mainfrom
Smart-Systems-Hub:digital-twin-registry-impl
Closed

Digital twin registry impl#820
FaheemBhatti wants to merge 25 commits into
eclipse-basyx:mainfrom
Smart-Systems-Hub:digital-twin-registry-impl

Conversation

@FaheemBhatti

Copy link
Copy Markdown
Contributor

Pull Request Template

Description of Changes

Please provide a brief summary of what you have changed in this pull request. Be clear and concise.

Related Issue

If this pull request is related to an existing issue, please link that issue using the format #issue_number.

BaSyx Configuration for Testing

Describe any specific configuration settings or environment setup required to test these changes effectively. If possible, please provide the BaSyx configuration as .zip file.

AAS Files Used for Testing

Please provide any AAS files that were used in the testing of these changes. Include a brief descriptions of their relevance to the changes being proposed.

Additional Information

Include any additional information or context that could be useful for the reviewer. This could include challenges faced, alternative solutions that were considered, etc.


Please ensure that you have tested your changes thoroughly before submitting the pull request.

@aaronzi

aaronzi commented Aug 20, 2025

Copy link
Copy Markdown
Member

Thank you for the PR including the Digital Twin Registry implementation.

I noticed that the ECA fails. Please make sure that all your commits were signed with the same email address that you used for signing the ECA.

I noticed that there are changes in files outside of the new digital twin registry component. Please revert those unrelated changes.

@FaheemBhatti

Copy link
Copy Markdown
Contributor Author

@aaronzi

Thanks a lot for your detailed feedback and for pointing out the issues.

I’ve signed the ECA.

I’ll add the copyright headers to all newly introduced classes.

I’ll also add tests for the new component, or explain the reasoning in the PR description where applicable.

Regarding the Dockerfile, I’ll update the PR description with the intended purpose.

On your's comment about reverting files outside the DTR module: when we initially cloned, the build was failing. To get it working, we had to add some annotations and the Lombok plugin. That said, I wanted to clarify whether changes outside the DTR module are strictly not allowed. In our current implementation, the DTR calls the discovery service directly from the registry, and we’ve refactored the /shell-description endpoint.

If this implementation is not acceptable, we would need to do a major refactoring—creating a new entry point in the DTR that makes two separate requests (one to /shell-descriptors and another to /lookup). This would also require introducing a new endpoint with a different name from /shell-descriptor. Could you please clarify how you’d like us to proceed on this?

@aaronzi

aaronzi commented Aug 25, 2025

Copy link
Copy Markdown
Member

@FaheemBhatti

Thanks for signing the ECA.

Also thank you for adding tests and license headers 👍

It is totally fine if you need to add annotations as long as they don't change the functionalities of the original components. But I saw a few cosmetic changes in those files as well that can easily be reverted to reduce the diff. It would be nice if you could do that.

Please make sure to register you tests here in the action: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/.github/workflows/basyx_test.yml

Please include the DTR in our Docker release workflows:

We are also testing if the containers are starting here: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/.github/workflows/docker_test.yml

It would be appreciated if you could add a small example here: https://github.com/eclipse-basyx/basyx-java-server-sdk/tree/main/examples
and add this example to our example tests: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/.github/workflows/examples_test.yml

Thanks a lot :)

@FaheemBhatti

Copy link
Copy Markdown
Contributor Author

@aaronzi

Thank you very much for the detailed feedback and guidance.

I went ahead and applied the suggested changes. Even though nothing was originally changed in the modules where the tests are currently failing, I suspect I must have unintentionally introduced something along the way. I’ll continue investigating to track down the root cause.

Actually same kind of failures happen on the main branch also when I run the build, I am actually a bit unsure where exactly the change is required.

I registered the new tests in the GitHub action workflow as you asked.

The DTR has been included in the Docker release workflows, and I also verified its integration in the test workflow to ensure the containers start as expected.

Thanks again for your support and for pointing out these improvements. Please let me know if you spot anything further that needs adjustment.

@aaronzi aaronzi left a comment

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.

Thanks for addressing some of my remarks. I now also added some remarks and questions for you on the code level.

Btw. I noticed that you have 2024 as the year in the license headers. Please change to 2025 in the newly added files.

Please have a look. Thank you :)

Comment thread pom.xml
Comment on lines +122 to +138
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version> <!-- or latest stable -->
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>

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.

For my understanding, could you please explain why it was necessary to add lombok as a plugin in the parent pom?

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.

When I initially cloned the repository and started working on it, the build was failing. After some investigation, I found that the issue was due to Lombok’s annotation processing not being configured in the build. To fix this, I added Lombok to the annotationProcessorPaths of the maven-compiler-plugin in the parent POM.

Without this plugin configuration, Lombok’s annotation processor is never executed, so the compiler cannot generate code for annotations like @slf4j, @builder, and @AllArgsConstructor. This leads to missing variables, constructors, and methods during compilation.

As a result, Maven reports missing methods, constructors, and variables. For example, the build breaks with the following error:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13.505 s
[INFO] Finished at: 2025-08-27T00:53:13+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project basyx.submodelregistry-service: Compilation failure: Compilation failure: 
[ERROR] /Users/faheem/Documents/Work/basyx-java-server-sdk-dtr/basyx.submodelregistry/basyx.submodelregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/events/RegistryEventLogSink.java:[52,25] cannot find symbol
[ERROR]   symbol:   variable log
[ERROR]   location: class org.eclipse.digitaltwin.basyx.submodelregistry.service.events.RegistryEventLogSink
[ERROR] /Users/faheem/Documents/Work/basyx-java-server-sdk-dtr/basyx.submodelregistry/basyx.submodelregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/events/RegistryEventLogSink.java:[54,25] cannot find symbol
[ERROR]   symbol:   variable log
[ERROR]   location: class org.eclipse.digitaltwin.basyx.submodelregistry.service.events.RegistryEventLogSink
[ERROR] /Users/faheem/Documents/Work/basyx-java-server-sdk-dtr/basyx.submodelregistry/basyx.submodelregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/storage/CursorEncodingRegistryStorage.java:[40,17] constructor SubmodelRegistryStorageDecorator in class org.eclipse.digitaltwin.basyx.submodelregistry.service.storage.SubmodelRegistryStorageDecorator cannot be applied to given types;
[ERROR]   required: no arguments
[ERROR]   found:    org.eclipse.digitaltwin.basyx.submodelregistry.service.storage.SubmodelRegistryStorage
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /Users/faheem/Documents/Work/basyx-java-server-sdk-dtr/basyx.submodelregistry/basyx.submodelregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/storage/RegistrationEventSendingSubmodelRegistryStorage.java:[44,17] constructor SubmodelRegistryStorageDecorator in class org.eclipse.digitaltwin.basyx.submodelregistry.service.storage.SubmodelRegistryStorageDecorator cannot be applied to given types;
[ERROR]   required: no arguments
[ERROR]   found:    org.eclipse.digitaltwin.basyx.submodelregistry.service.storage.SubmodelRegistryStorage
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /Users/faheem/Documents/Work/basyx-java-server-sdk-dtr/basyx.submodelregistry/basyx.submodelregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/storage/RegistrationEventSendingSubmodelRegistryStorage.java:[78,50] cannot find symbol
[ERROR]   symbol:   method builder()
[ERROR]   location: class org.eclipse.digitaltwin.basyx.submodelregistry.service.events.RegistryEvent
[ERROR] /Users/faheem/Documents/Work/basyx-java-server-sdk-dtr/basyx.submodelregistry/basyx.submodelregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/storage/RegistrationEventSendingSubmodelRegistryStorage.java:[83,50] cannot find symbol
[ERROR]   symbol:   method builder()
[ERROR]   location: class org.eclipse.digitaltwin.basyx.submodelregistry.service.events.RegistryEvent
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :basyx.submodelregistry-service

The other pom changes were there because of the testing part; I have removed them.

Comment thread docs/Roadmap.md Outdated
Comment on lines +24 to +25


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.

Please remove cosmetic changes

Suggested change

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.

reverted

Comment on lines +198 to +202
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasdiscoveryservice-backend-mongodb</artifactId>
</dependency>
</dependencies>

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.

Could you please explain why it was necessary to add the discovery service to the dependencies of the Submodel Registry?

This could probably be the reason why some of the Submodel Registry tests fail.

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.

removed this dependency, added this by mistake probably.

Comment on lines +44 to +46



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.

Please remove cosmetic changes

Suggested change

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.

reverted

Comment thread basyx.aasregistry/pom.xml

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.

Please remove all changes in this file since they are only cosmetic

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.

removed

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.

Please revert this file since only cosmetic changes

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.

done

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.

please revert this file since only cosmetic changes

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.

done

Comment thread .github/workflows/docker_test.yml Outdated

- name: Clean up
run: exit 0

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.

Please remove this cosmetic change

Suggested change

@FaheemBhatti FaheemBhatti Aug 26, 2025

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.

looked nice with the blank space, but reverted :)

Comment on lines +570 to +597
build-test-aas-digital-twin-registry:
runs-on: ubuntu-latest
name: AAS Digital Twin Registry - Build and Start Docker Image
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: maven

- name: Build BaSyx
run: |
mvn clean install ${MVN_ARGS_BUILD_BASYX_NO_TESTS}

- name: Build AAS Digital Twin Registry Docker Image
run: |
mvn package -DskipTests -Ddocker.namespace=test \
--pl "org.eclipse.digitaltwin.basyx:basyx.digitaltwinregistry.component"

- name: Test AAS Digital Twin Registry Docker Image
run: chmod +x ./.github/workflows/scripts/build_start_docker_image.sh && \
./.github/workflows/scripts/build_start_docker_image.sh test/aas-digital-twin-registry ${VERSION} test_aas_digital_twin_registry

- name: Clean up
run: exit 0

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.

It seems like this test is currently not working. Please have a look in the respective GitHub action

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.

Will fix in the next commit

Comment on lines +744 to +768
test-basyx-digital-twin-registry:
runs-on: ubuntu-latest
name: Digital-Twin-Registry
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: maven

- name: Build BaSyx
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}

- name: Test DTR component
run: mvn test -f "basyx.digitaltwinregistry.component/pom.xml"

- name: Fail if no Surefire reports found
run: |
if ! find . -type f -path "*/target/surefire-reports/*.xml" | grep -q .; then
echo "No Surefire test reports found. Failing CI.";
exit 1;
fi

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.

This test seems to fail currently. Please have a look in the respective GitHub Action

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.

Will fix in the next commits

@FaheemBhatti

Copy link
Copy Markdown
Contributor Author

As discussed with @aaronzi, I am closing this PR and will open a new one implementing the agreed-upon method.

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.

2 participants