-
Notifications
You must be signed in to change notification settings - Fork 119
gitlab integration apis #468
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
Conversation
gitlab_domain = ( | ||
integrations[0].provider_meta.get("custom_domain") | ||
if integrations[0].provider_meta | ||
else None | ||
) | ||
|
||
if not gitlab_domain: | ||
LOG.warn( | ||
f"Custom domain not found for intergration for org {org_id} and provider {UserIdentityProvider.GITLAB.value}" | ||
) | ||
return DEFAULT_DOMAIN |
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.
Would break for someone with github integration, and you are calling it irrespective of the provider
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.
Good catch. Thanks :)
if user_identity_provider == UserIdentityProvider.GITHUB: | ||
return ExternalIntegrationsService( | ||
org_id, | ||
user_identity_provider, | ||
_get_access_token(), | ||
) | ||
|
||
if user_identity_provider == UserIdentityProvider.GITLAB: | ||
return ExternalIntegrationsService( | ||
org_id, | ||
user_identity_provider, | ||
_get_access_token(), | ||
_get_custom_gitlab_domain(), | ||
) |
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.
if user_identity_provider == UserIdentityProvider.GITHUB: | |
return ExternalIntegrationsService( | |
org_id, | |
user_identity_provider, | |
_get_access_token(), | |
) | |
if user_identity_provider == UserIdentityProvider.GITLAB: | |
return ExternalIntegrationsService( | |
org_id, | |
user_identity_provider, | |
_get_access_token(), | |
_get_custom_gitlab_domain(), | |
) | |
custom_domain_name = None | |
if user_identity_provider == UserIdentityProvider.GITLAB: | |
custom_domain_name = _get_custom_gitlab_domain() | |
return ExternalIntegrationsService( | |
org_id, | |
user_identity_provider, | |
_get_access_token(), | |
custom_domain_name | |
) |
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
Linked Issue(s)
Closes #467
Proposed changes (including videos or screenshots)
This PR introduces the following 3 apis:
/orgs/<org_id>/integrations/gitlab/groups
- Method: GET/orgs/<org_id>/integrations/gitlab/user/repos
- Method: GET/orgs/<org_id>/integrations/gitlab/groups/<group_id>/repos
- Method: GET