fix(actionsV2): executing request/response type for 'all' condition (#11071)

# Which Problems Are Solved

In actions v2, when the condition `all` is chosen, or a specific method
is not specified for a service action, the actions are not executed.

# How the Problems Are Solved

The wildcard suffix `.*` is used only for event groups. As global
`requests`, `responses` or `services with no specified method` do not
have this suffix, they were bypassing the prefix-match check. This check
therefore does not apply to action types other than `event`

This issue is fixed by removing the `e.ID == "event"` condition when
prefix-matching execution IDs to not exclude other action types
(`request`, `response`, etc).

# Additional Changes
N/A

# Additional Context

- Closes #10895

---------

Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
Gayathri Vijayan
2025-12-04 06:14:55 +00:00
committed by GitHub
co-authored by Livio Spring
parent e26859d644
commit a1bfdeb257
2 changed files with 83 additions and 10 deletions
+4 -3
View File
@@ -44,8 +44,7 @@ func (r Router) Get(executionID string) ([]Target, bool) {
// GetEventBestMatch returns the best matching execution targets for an event.
// The following match priority is used:
// 1. Exact match
// 2. Wildcard match
// 3. Prefix match ("event")
// 2. Longest matching prefix (with wildcard suffix .* for events)
func (r Router) GetEventBestMatch(executionID string) ([]Target, bool) {
t, ok := r.Get(executionID)
if ok {
@@ -53,9 +52,11 @@ func (r Router) GetEventBestMatch(executionID string) ([]Target, bool) {
}
var bestMatch element
for _, e := range r {
if e.ID == "event" && strings.HasPrefix(executionID, e.ID) {
if strings.HasPrefix(executionID, e.ID) {
bestMatch, ok = e, true
}
// .* is suffixed for "all" condition on events
cut, has := strings.CutSuffix(e.ID, ".*")
if has && strings.HasPrefix(executionID, cut) {
bestMatch, ok = e, true