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

Validate webhook after auth flow #55

Conversation

vbihun
Copy link
Contributor

@vbihun vbihun commented Aug 2, 2023

Description

Added webhook handling after auth flow for checking if webhook already exists on the Gitlab side. Also, fixed the issue with the disconnect process if the webhook was manually deleted on the Gitlab side.

Checklist

Please ensure that each of these items has been addressed:

  • I have tested these changes in my local environment
  • I have added/modified tests as applicable to cover these changes
  • (Atlassian contributors only) I have removed any Atlassian-internal changes including internal modules, references to internal tickets, and internal wiki links

@vbihun vbihun requested a review from a team as a code owner August 2, 2023 12:47
try {
const connectedGroups = await getConnectedGroups();

if (connectedGroups.length) {
await setupAndValidateWebhook(connectedGroups[0].id);
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this change the current implementation? It looks like it doesn't throw currently, so if the webhook is valid or invalid, would the behavior here change?

Copy link
Contributor Author

@vbihun vbihun Aug 2, 2023

Choose a reason for hiding this comment

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

We have checked that webhook exists on the GitLab side and re-set up if the webhook was deleted manually. We have the same behavior on GitHub integration. Gitlab support only manually checks the webhook health

src/client/gitlab.ts Show resolved Hide resolved
@kbielaski kbielaski merged commit 03a7aca into atlassian-labs:main Aug 2, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants