-
Notifications
You must be signed in to change notification settings - Fork 62
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
[Integration][Gitlab] - Introduce Pagination and Run Code in Async #1047
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets setup listeners either way if webhook creation is successful or not
This should be run either way if possible with whatever webhooks it got.
for client, webhook_ids in client_to_webhooks:
for webhook_id in webhook_ids:
setup_listeners(client, webhook_id)
async for hook_batch in AsyncFetcher.fetch_batch( | ||
group.hooks.list | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets create a method in the client for it
@@ -90,11 +93,12 @@ def _create_group_webhook( | |||
f"Creating webhook for {group.get_id()} with events: {[event for event in webhook_events if webhook_events[event]]}" | |||
) | |||
try: | |||
resp = group.hooks.create( | |||
resp = await AsyncFetcher.fetch_single( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like maybe fetch_single
isn't the appropriate name for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I felt the same but I was also worried about duplication since the implementation will look the same, only the name of the method will change
f"Failed to setup webhook: {e}. {NO_WEBHOOK_WARNING}", | ||
stack_info=True, | ||
) | ||
logger.exception(f"Failed to setup webhook: {e}. {NO_WEBHOOK_WARNING}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to make sure that it actually prints the stacktrace, I think exception
does it but just lets make sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await event_handler.start_event_processor() | ||
await system_event_handler.start_event_processor() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets run them either way if app_host
is configured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
What - Added logs, pagination and async implementation to the GitLab integration
Why -
How -
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
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.