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

Gitlab Integration V2 #1038

Closed
wants to merge 34 commits into from
Closed

Conversation

MusahMusah
Copy link

Description

What - Implemented Gitlab Integration

Why - The goal is to ensure that the integration is efficient, intuitive, and user-friendly, while minimizing dependencies. This enables better control over rate limits, supports real-time events, and allows for easier maintenance and testing.

How - By building an async HTTP client using Ocean's custom implementation, integrating rate-limiting mechanisms, and streamlining the setup process to make parameters more intuitive. Webhook support and real-time event handling will enhance user interaction, and verbosity and testing ensure clarity and reliability throughout development.

Type of change

Please leave one option from the following and delete the rest:

  • New Integration (non-breaking change which adds a new integration)

All tests should be run against the port production environment(using a testing org).

I implemented my test cases by simulating those from integrations/fake-integration. However, when I run the tests, I consistently encounter the following error:

FAILED tests/test_integration.py::test_all_resync_methods - pydantic.error_wrappers.ValidationError: 1 validation error for IntegrationConfiguration unhashable type: 'list' (type=type_error)

Due to this error, I have temporarily commented out my test code here. I believe the issue may stem from the Ocean framework itself, which is why I have not removed the tests entirely. The commented-out code is retained for reference and future debugging.

Note: The test was passing in a previous version of Ocean that I had cloned locally. I suspect the error, which arises from invoking Ocean's get_raw_result_on_integration_sync_kinds test utility function, may have been introduced in an earlier version of the framework.

Core testing checklist

  • Integration able to create all default resources from scratch
  • Resync finishes successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Scheduled resync able to abort existing resync and start a new one
  • Tested with at least 2 integrations from scratch
  • Tested with Kafka and Polling event listeners
  • Tested deletion of entities that don't pass the selector

Integration testing checklist

  • Integration able to create all default resources from scratch
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Resync finishes successfully
  • If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • Docs PR link here

Preflight checklist

  • Handled rate limiting
  • Handled pagination
  • Implemented the code in async
  • Support Multi account

Screenshots

image image image image

API Documentation

Here are the GitLab REST API endpoints that I referenced for my integrations:

WEBHOOKS

RATE LIMITS

PAGINATION

Copy link
Contributor

@PeyGis PeyGis left a comment

Choose a reason for hiding this comment

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

looks great. left some comments

integrations/gitlab_v2/gitlab_integration.py Outdated Show resolved Hide resolved
integrations/gitlab_v2/gitlab_integration.py Show resolved Hide resolved
integrations/gitlab_v2/gitlab_integration.py Show resolved Hide resolved
@MusahMusah MusahMusah closed this Sep 20, 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.

2 participants