Skip to content

feat: Added DPP visualization and EcoPass KIT#391

Merged
matbmoser merged 70 commits intomainfrom
feat/consumer-dpp
Feb 22, 2026
Merged

feat: Added DPP visualization and EcoPass KIT#391
matbmoser merged 70 commits intomainfrom
feat/consumer-dpp

Conversation

@matbmoser
Copy link
Copy Markdown
Contributor

@matbmoser matbmoser commented Nov 26, 2025

WHAT

  • Moved items to industry-core-kit
  • Updated kit-features to be dynamic
  • Added eco-pass-kit functionality
image image

WHY

Currently, most of the feature configuration was hardocoded and not fitting to the overall architecture from the side bar.

FURTHER NOTES

List other areas of code that have changed but are not necessarily linked to the main feature. This could be method signature changes, package declarations, bugs that were encountered and were fixed inline, etc.

Closes # <-- insert Issue number if one exists

@matbmoser matbmoser marked this pull request as draft November 26, 2025 11:46
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 26, 2025

🧪 Test Summary

🎉 Status: SUCCESS

📊 Backend Tests

Passed Failed Total Coverage
✅ 147 ❌ 0 📋 147 📈 57.20%
Run Details
  • Branch: 391/merge
  • Commit: e71eb2b8923527548128a273b102fa0c675029d4
  • Trigger: pull_request

@matbmoser matbmoser changed the title feat: moved items from features to industry-core-kit with absolute imports Added DPP visualization and EcoPass KIT Nov 27, 2025
@matbmoser matbmoser changed the title Added DPP visualization and EcoPass KIT feat: Added DPP visualization and EcoPass KIT Nov 28, 2025
@matbmoser matbmoser added frontend documentation Improvements or additions to documentation labels Nov 28, 2025
- Introduced a new passport type for generic digital product passports.
- Created base components for passport visualization including GeneralInfoCard, ManufacturingCard, SustainabilityCard, and MaterialsCard.
- Implemented MaterialCompositionRenderer for displaying material composition data.
- Added mock data for testing purposes.
- Registered the new passport type in the central registry.
- Enhanced icon mapping for category-specific icons in metric cards.
- Updated schema parser to include category information.
- Adjusted navigation links in ShareDialog and AddSerializedPartDialog to include fragment identifiers for better user experience.
- Added a function to extract and format passport types from semantic IDs.
- Introduced a dialog view mode toggle between card and table views.
- Implemented sticky search bar and improved carousel controls with visual gradients.
- Enhanced card and table layouts for better readability and user interaction.
- Added QR code display and improved information sections for each passport.
- Updated button styles and hover effects for better user experience.
- Refactored code for better maintainability and readability.
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
Comment thread ichub-backend/managers/addons_service/ecopass_kit/v1/provision.py Fixed
@CDiezRodriguez CDiezRodriguez marked this pull request as ready for review February 13, 2026 07:53
Comment thread .github/workflows/deployment-tests.yaml Fixed
Copy link
Copy Markdown
Contributor

@CDiezRodriguez CDiezRodriguez left a comment

Choose a reason for hiding this comment

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

Excellent work. I’ve tested it successfully in both my local environment and our cloud environment.

{{- if .Values.backend.configuration.provider.submodel_dispatcher.http.auth.enabled }}
- name: SUBMODEL_SERVICE_TOKEN
valueFrom:
secretKeyRef:

Check notice

Code scanning / KICS

Secrets As Environment Variables Note

'spec.template.spec.containers.name={industry-core-hub-backend}.env.name={DATABASE_PASSWORD}.valueFrom.secretKeyRef' is defined
self._semantic_id_cache[sha256_hash] = semantic_id
self.logger.debug(f"Cached semantic_id mapping: {sha256_hash[:16]}... -> {semantic_id}")

def __del__(self):

Check notice

Code scanning / CodeQL

Overly complex `__del__` method Note

Overly complex '__del__' method.

Copilot Autofix

AI about 2 months ago

In general, we should avoid putting resource-release logic directly into __del__. Instead, define an explicit cleanup method like close() that callers can invoke deterministically (or use via a context manager), and have __del__ delegate to that method. This keeps __del__ simple while preserving existing behavior.

For this specific file (ichub-backend/managers/enablement_services/adapters/http_submodel_adapter.py), we can:

  1. Extract the logic from __del__ into a new close(self) -> None method on HttpSubmodelAdapter.
  2. Simplify __del__ so that it just calls self.close() inside a small try/except (keeping the existing safety against exceptions during garbage collection).
  3. Keep logging behavior identical, so existing observability is unchanged.

Concretely, around lines 516–523:

  • Replace the current body of __del__ with:
    • A close() method that:
      • Checks hasattr(self, "client").
      • Calls self.client.close().
      • Logs success.
      • Catches and logs any exceptions.
    • A simplified __del__ that just calls self.close() inside a try/except and logs a warning on error.

No new imports are needed; we reuse the existing logger and httpx client attribute.

Suggested changeset 1
ichub-backend/managers/enablement_services/adapters/http_submodel_adapter.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/ichub-backend/managers/enablement_services/adapters/http_submodel_adapter.py b/ichub-backend/managers/enablement_services/adapters/http_submodel_adapter.py
--- a/ichub-backend/managers/enablement_services/adapters/http_submodel_adapter.py
+++ b/ichub-backend/managers/enablement_services/adapters/http_submodel_adapter.py
@@ -513,11 +513,27 @@
         self._semantic_id_cache[sha256_hash] = semantic_id
         self.logger.debug(f"Cached semantic_id mapping: {sha256_hash[:16]}... -> {semantic_id}")
     
-    def __del__(self):
-        """Cleanup HTTP client on adapter destruction."""
+    def close(self) -> None:
+        """
+        Explicitly close the underlying HTTP client.
+
+        This method should be called when the adapter is no longer needed
+        to ensure that all HTTP resources are released in a timely manner.
+        """
         try:
-            if hasattr(self, 'client'):
+            if hasattr(self, "client"):
                 self.client.close()
                 self.logger.debug("HTTP client closed")
         except Exception as e:
+            # Log and suppress any errors during explicit close to avoid
+            # impacting callers that are attempting to clean up.
             self.logger.warning(f"Error closing HTTP client: {e}")
+
+    def __del__(self):
+        """Cleanup HTTP client on adapter destruction."""
+        try:
+            # Delegate cleanup to the explicit close() method.
+            self.close()
+        except Exception as e:
+            # Suppress any exceptions raised during garbage collection.
+            self.logger.warning(f"Error in __del__ while closing HTTP client: {e}")
EOF
@@ -513,11 +513,27 @@
self._semantic_id_cache[sha256_hash] = semantic_id
self.logger.debug(f"Cached semantic_id mapping: {sha256_hash[:16]}... -> {semantic_id}")

def __del__(self):
"""Cleanup HTTP client on adapter destruction."""
def close(self) -> None:
"""
Explicitly close the underlying HTTP client.

This method should be called when the adapter is no longer needed
to ensure that all HTTP resources are released in a timely manner.
"""
try:
if hasattr(self, 'client'):
if hasattr(self, "client"):
self.client.close()
self.logger.debug("HTTP client closed")
except Exception as e:
# Log and suppress any errors during explicit close to avoid
# impacting callers that are attempting to clean up.
self.logger.warning(f"Error closing HTTP client: {e}")

def __del__(self):
"""Cleanup HTTP client on adapter destruction."""
try:
# Delegate cleanup to the explicit close() method.
self.close()
except Exception as e:
# Suppress any exceptions raised during garbage collection.
self.logger.warning(f"Error in __del__ while closing HTTP client: {e}")
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +236 to +242
def _execute_submodel_operation(
self,
operation: OperationType,
submodel_id: UUID,
semantic_id: str,
payload: Dict[str, Any] | None = None
) -> Dict[str, Any] | None:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.

Copilot Autofix

AI about 2 months ago

In general, to fix “explicit returns mixed with implicit returns”, ensure that every control-flow path in the function ends with an explicit return statement, even when the function is intended to return None. For _execute_submodel_operation, the intent (per docstring and annotation) is that read operations return a Dict[str, Any] and write/delete operations return None. The most conservative fix, without changing any behavior, is to add a final return None at the end of the function body so that any path that currently falls off the end now explicitly returns None.

Since we must not assume or modify the unseen internal logic (lines 263–306), we will only add a single line at the end of _execute_submodel_operation, immediately before the next method definition (upload_twin_aspect_document). This ensures that: (1) existing explicit return statements (e.g., for read operations) still work unchanged; (2) any path without an explicit return now returns None, which matches the documented contract for write/delete operations; and (3) CodeQL’s complaint about mixed explicit/implicit returns is eliminated. No new imports or helper methods are required.

Suggested changeset 1
ichub-backend/managers/enablement_services/submodel_service_manager.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/ichub-backend/managers/enablement_services/submodel_service_manager.py b/ichub-backend/managers/enablement_services/submodel_service_manager.py
--- a/ichub-backend/managers/enablement_services/submodel_service_manager.py
+++ b/ichub-backend/managers/enablement_services/submodel_service_manager.py
@@ -304,6 +304,9 @@
             self.logger.info("Submodel deleted successfully.")
             return None
 
+        # End of operation handling
+        return None
+
     def upload_twin_aspect_document(
         self,
         submodel_id: UUID,
EOF
@@ -304,6 +304,9 @@
self.logger.info("Submodel deleted successfully.")
return None

# End of operation handling
return None

def upload_twin_aspect_document(
self,
submodel_id: UUID,
Copilot is powered by AI and may make mistakes. Always verify output.
@matbmoser matbmoser merged commit caa8e47 into main Feb 22, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants