Skip to content

Improve bulk webhook re-registration and refresh changed secrets - #801

Draft
KostyaSha wants to merge 7 commits into
masterfrom
fix/webhook-bulk-registration-798
Draft

KostyaSha wants to merge 7 commits into
masterfrom
fix/webhook-bulk-registration-798

Conversation

@KostyaSha

@KostyaSha KostyaSha commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes part of #798 by:

  • Grouping bulk re-registration by unique GitHub repository and combining event subscriptions across Jenkins jobs.
  • Explicitly refreshing existing webhook configuration on bulk re-registration so a newly configured shared secret is applied even when events are unchanged. GitHub does not expose existing secret values.
  • Tracking asynchronous per-repository outcomes (created, skipped, failed, pending) and exposing the latest status via doReRegisterStatus() instead of claiming queued Jenkins jobs are successful hook registrations.
  • Preventing overlapping bulk runs from repeated clicks.
  • Adding tests for explicit refresh and ordinary no-op behavior.

Important caveats / review needed

  • Draft / unverified: tests have not been run in this environment; the GitHub connector does not provide Maven execution.
  • Refresh currently deletes and recreates matching hooks, consistent with the existing replacement mechanism. This has availability and rate-limit implications; consider a GitHub update API alternative before merge.
  • The current statistics endpoint reports a snapshot; the UI does not yet poll it automatically.
  • Repository scope deduplication is implemented for bulk registration only; unrelated per-job registrations remain unchanged.

Suggested verification

mvn -Dtest=WebhookManagerTest test and mvn verify on JDK 21, plus integration testing against a GitHub repository whose hook was initially created without a secret.


This change is Reviewable

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.

1 participant