Add resource event listener extension point and Groovy callback#1015
Open
mPokornyETM wants to merge 7 commits intomasterfrom
Open
Add resource event listener extension point and Groovy callback#1015mPokornyETM wants to merge 7 commits intomasterfrom
mPokornyETM wants to merge 7 commits intomasterfrom
Conversation
Introduce a ResourceEventListener extension point that fires events when lockable resources change state (locked, unlocked, reserved, stolen, etc.). A built-in GroovyCallbackListener evaluates a user-configured Groovy script on each event, with async execution by default and configurable timeout. A read-only ResourceInfo snapshot is passed to scripts for safe sandbox access. Includes 15 automated tests and documentation examples. Fixes #340
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a ResourceEventListener extension point that fires events when lockable resources change state. A built-in GroovyCallbackListener evaluates a user-configured Groovy script on each event.
New features
Configuration
Navigate to Manage Jenkins → System → Lockable Resources Manager → Resource Event Callback to configure the Groovy script, async mode, and timeout.
Binding variables in Groovy callback
Testing
15 automated tests covering all event types, extension point registration, ResourceInfo snapshot correctness, Groovy callback execution (sync/async), and failure resilience.
Documentation
Added resource-event-notifications.md with usage examples.
Fixes #340
Fixes #676