Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed error in register_raw when there's no relevant mappings for a s…
…pecific kind (#596) # Description What - Fixed error in register_raw when there's no relevant mappings for a specific kind: ``` Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/tasks.py", line 267, in __step result = coro.send(None) ^^^^^^^^^^^^^^^ File "/Users/omribarouch/Desktop/ocean/integrations/gitlab/gitlab_integration/events/hooks/base.py", line 37, in on_hook await self._on_hook(body, project) File "/Users/omribarouch/Desktop/ocean/integrations/gitlab/gitlab_integration/events/hooks/merge_request.py", line 20, in _on_hook await ocean.register_raw(ObjectKind.MERGE_REQUEST, [merge_requests.asdict()]) File "/Users/omribarouch/Desktop/ocean/port_ocean/context/ocean.py", line 105, in register_raw await self.integration.register_raw(kind, change, user_agent_type) File "/Users/omribarouch/Desktop/ocean/port_ocean/core/integrations/mixins/sync_raw.py", line 229, in register_raw registered_entities, entities_to_delete = zip_and_sum( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 2, got 0) ``` This is happened to me when received merge request webhook from the gitlab integration, while the merge request mapping isn't created by default in the integration so the diffs object in `port_ocean/core/integrations/mixins/sync_raw.py` line 22 is empty ## Type of change Please leave one option from the following and delete the rest: - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] New Integration (non-breaking change which adds a new integration) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Non-breaking change (fix of existing functionality that will not change current behavior) - [ ] Documentation (added/updated documentation) ## Screenshots Include screenshots from your environment showing how the resources of the integration will look. ## API Documentation Provide links to the API documentation used for this integration. --------- Co-authored-by: Yair Siman Tov <[email protected]>
- Loading branch information