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

feat: delete scm webhook when disable repo. #2982

Closed
wants to merge 4 commits into from

Conversation

dakele123
Copy link

when disable repo, drone delete scm webhook.

for this issue: https://discourse.drone.io/t/disabling-repo-on-drone-does-not-delete-webhook/5146

@CLAassistant
Copy link

CLAassistant commented Jun 21, 2020

CLA assistant check
All committers have signed the CLA.

@bradrydzewski
Copy link

bradrydzewski commented Jun 21, 2020

thanks for the pull request. a few comments

  1. deleting the webhook should probably come after the database update
  2. if deleting the webhook fails it should output warning logs, but should not fail the API call. There are valid scenarios where we expect deleting the webhook to fail (for example, repo was deleted in github)
  3. the repo owner should be used when making the API call. see https://github.com/drone/drone/blob/master/handler/api/repos/builds/create.go#L52. If returning the owner from the database fails, it should not fail the api call, and deleting the webhook should be skipped.

also please be sure to sign the CLA

@dakele123
Copy link
Author

thanks for the pull request. a few comments

  1. deleting the webhook should probably come after the database update
  2. if deleting the webhook fails it should output warning logs, but should not fail the API call. There are valid scenarios where we expect deleting the webhook to fail (for example, repo was deleted in github)
  3. the repo owner should be used when making the API call. see https://github.com/drone/drone/blob/master/handler/api/repos/builds/create.go#L52. If returning the owner from the database fails, it should not fail the api call, and deleting the webhook should be skipped.

also please be sure to sign the CLA

thanks for reply.

i will check the code and

  1. move delete func after update the database updated.
  2. delete the return statement when webhook delete failed.
  3. refer to the link and check the repo owner.
  4. signed the CLA.

if there is any mistakes in comprehension, let me know.

@hitesharinga hitesharinga changed the base branch from master to drone October 4, 2023 02:44
@bot2-harness
Copy link
Collaborator

This PR has been automatically closed due to inactivity.

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.

None yet

4 participants