Skip to content

WW-2963 default-action-ref fails to find wildcard named actions#1614

Open
lukaszlenart wants to merge 2 commits intomainfrom
fix/WW-2963-default-action-ref-wildcard-fallback
Open

WW-2963 default-action-ref fails to find wildcard named actions#1614
lukaszlenart wants to merge 2 commits intomainfrom
fix/WW-2963-default-action-ref-wildcard-fallback

Conversation

@lukaszlenart
Copy link
Member

Summary

Fixes WW-2963

  • default-action-ref fallback now resolves via wildcard matching when the exact action map lookup fails
  • Mirrors the exact→wildcard resolution pattern already used for request action names (3 lines added)
  • Adds three tests covering exact-match default-action-ref, wildcard-match default-action-ref, and no-match fallback

Root Cause

In DefaultConfiguration.RuntimeConfigurationImpl.findActionConfigInNamespace(), the default-action-ref fallback only did actions.get(defaultActionRef) — an exact key lookup. If the default ref name (e.g., "movie-input") only matched a wildcard pattern (e.g., "movie-*"), the lookup returned null and the request failed with a 404.

Fix

After the exact lookup fails for the default action ref, also try the wildcard matcher:

config = actions.get(defaultActionRef);
if (config == null) {
    config = namespaceActionConfigMatchers.get(namespace).match(defaultActionRef);
}

Test plan

  • ConfigurationTest#testDefaultActionRefWithWildcard — default-action-ref resolves via wildcard matching
  • ConfigurationTest#testDefaultActionRefWithExactMatch — default-action-ref resolves via exact match (pre-existing behavior)
  • ConfigurationTest#testDefaultActionRefWithWildcardNoMatch — returns null when default-action-ref matches neither
  • Full ConfigurationTest suite passes with no regressions

🤖 Generated with Claude Code

lukaszlenart and others added 2 commits March 6, 2026 11:23
When default-action-ref names an action that only exists as a wildcard
pattern (e.g., "movie-list" matching "movie-*"), the fallback now tries
wildcard matching after the exact map lookup fails. This mirrors the
exact→wildcard resolution already used for request action names.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…igInNamespace

Extract default-action-ref resolution into findDefaultActionConfig() and
replace the deeply nested if-pyramid with early returns, reducing the
nesting depth from 5 to 1 to satisfy Sonar's complexity threshold.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Made-with: Cursor
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

@lukaszlenart lukaszlenart marked this pull request as ready for review March 6, 2026 11:12
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