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

Delete GitLab webhooks with partial URL match #4259

Merged
merged 9 commits into from
Oct 27, 2024
Merged

Conversation

pat-s
Copy link
Contributor

@pat-s pat-s commented Oct 26, 2024

fix #4248

  • Ensure to process all matching webhooks and don't exit after the first one
  • Use partial string match as webURL != hook.URL (the latter always has the api/token suffix, the former doesn't)

Tested on gitlab.com.

@pat-s pat-s added bug Something isn't working forge/gitlab gitlab forge related build_pr_images If set, the CI will build images for this PR and push to Dockerhub labels Oct 26, 2024
@pat-s pat-s force-pushed the fix/gitlab-token-delete branch from d400758 to 3326e6a Compare October 26, 2024 22:02
Copy link

codecov bot commented Oct 26, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 26.51%. Comparing base (ddd55ee) to head (cf8d299).
Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
server/forge/gitlab/gitlab.go 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4259      +/-   ##
==========================================
+ Coverage   26.47%   26.51%   +0.04%     
==========================================
  Files         376      377       +1     
  Lines       27465    27447      -18     
==========================================
+ Hits         7270     7278       +8     
+ Misses      19530    19504      -26     
  Partials      665      665              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pat-s pat-s marked this pull request as ready for review October 27, 2024 07:30
server/forge/gitlab/gitlab.go Outdated Show resolved Hide resolved
server/forge/gitlab/gitlab.go Outdated Show resolved Hide resolved
@anbraten anbraten changed the title fix: delete GitLab webhook on partial URL match Delete GitLab webhooks with partial URL match Oct 27, 2024
@6543
Copy link
Member

6543 commented Oct 27, 2024

server/forge/gitlab/gitlab.go:544:2: ineffectual assignment to hookID (ineffassign)
	hookID := -1
	^

@6543 6543 merged commit 9a76233 into main Oct 27, 2024
9 checks passed
@6543 6543 deleted the fix/gitlab-token-delete branch October 27, 2024 22:28
@woodpecker-bot
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build_pr_images If set, the CI will build images for this PR and push to Dockerhub forge/gitlab gitlab forge related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitLab: disabling repo doesn't remove webhook
4 participants