Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Framework] Fixed error in register_raw when there's no relevant mappings for a specific kind #596

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

omby8888
Copy link
Contributor

@omby8888 omby8888 commented Apr 30, 2024

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:

  • 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.

Copy link
Collaborator

@yairsimantov20 yairsimantov20 left a comment

Choose a reason for hiding this comment

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

🌊

CHANGELOG.md Outdated Show resolved Hide resolved
@omby8888 omby8888 merged commit 6a1a43d into main Apr 30, 2024
4 checks passed
@omby8888 omby8888 deleted the bugfix/no-relavent-mapping-for-kind branch April 30, 2024 07:24
@omby8888 omby8888 changed the title Fixed error in register_raw when there's no relevant mappings for a specific kind [Framework] Fixed error in register_raw when there's no relevant mappings for a specific kind Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants