Open
Conversation
This parameter does not make sense--there is no way to account for different values of the parameter when multiple invocations are "squished" into one by debouncing.
This covers the common use case where Run() callers set up some state that the runner function subsequently acts upon.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the “debounce last” utilities to remove the ambiguous arg passed to Run() and to ensure calls made while a runner/action is executing start a new debounce cycle.
Changes:
- Refactors
DebounceLastandDebounceLastActionto accept zero-arg runners/actions and to track per-run state. - Updates controller-level reconciler debouncing to match the new action debouncer API.
- Extends/updates tests to validate new execution-cycle behavior and to remove argument-based expectations.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/resiliency/debounce_last.go | Refactors debouncer to zero-arg runner and per-run state tracking. |
| pkg/resiliency/debounce_last_action.go | Refactors action debouncer similarly, with per-run state and zero-arg action. |
| pkg/resiliency/debounce_last_test.go | Updates tests for new API and adds coverage for “Run during execution starts new run”. |
| pkg/resiliency/debounce_last_action_test.go | Updates action tests for new API and adds analogous execution-cycle test. |
| controllers/reconciler_debouncer.go | Adapts reconciler debouncer to the new DebounceLastAction API (no per-call args). |
| controllers/reconciler_base.go | Updates base reconciler to use the new reconciler debouncer interface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
karolz-ms
commented
Mar 20, 2026
| extensions := []DcpExtension{} | ||
|
|
||
| for _, extDir := range extDirs { | ||
| if _, statErr := os.Stat(extDir); statErr != nil { |
Collaborator
Author
There was a problem hiding this comment.
Unrelated to debouncer changes--just a small fix for unnecessary error I saw in the logs.
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.
While working on some other code I realized our debouncer(s) suffer from two issues:
argparameter toRun()method just does not make sense. There is no reasonable way to account for different values ofargwhen multipleRun()invocation are debounced into a single runner run.Run()invocations that happen when the runner is running should be associated with a new debounce cycle. The reason is a common scenario where the invoker ofRun()sets up some shared state and then expect the runner to consume it.This PR fixes these two issues.