Skip to content

feat: added local Strategy handlers#7

Merged
petruki merged 1 commit into
masterfrom
staging
May 14, 2026
Merged

feat: added local Strategy handlers#7
petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented May 14, 2026

This pull request introduces a comprehensive refactor and expansion of the local strategy evaluation logic. The main changes include moving all local strategy processing into a new local_strategies.go file, supporting a wider range of validation strategies (such as numeric, date, time, payload, network, and regex), and adding thorough unit tests for these strategies. The previous, much simpler local strategy logic is removed from resolver.go.

Key changes include:

Local strategy logic refactor and expansion

  • Introduced a new file local_strategies.go containing a unified processLocalStrategy function that supports multiple validation strategies (VALUE_VALIDATION, NUMERIC_VALIDATION, DATE_VALIDATION, TIME_VALIDATION, PAYLOAD_VALIDATION, NETWORK_VALIDATION, and REGEX_VALIDATION) with their respective operations. This replaces the previous limited and duplicated logic.
  • Removed the old evaluateLocalStrategy, containsString, and networkExists functions from resolver.go, and updated all usages to call the new, more comprehensive processLocalStrategy. [1] [2] [3] [4]

Testing

  • Added a new test file local_strategies_test.go that provides extensive unit tests for all supported local strategy types and operations, ensuring correctness and robustness of the new logic.

These changes greatly increase the flexibility and maintainability of local strategy validation, while ensuring correctness through thorough testing.

@petruki petruki self-assigned this May 14, 2026
@petruki petruki added enhancement New feature or request ai-assisted Indicates that AI tools were used to assist this with this change labels May 14, 2026
@sonarqubecloud
Copy link
Copy Markdown

@petruki petruki merged commit 1fd7c32 into master May 14, 2026
7 checks passed
@petruki petruki deleted the staging branch May 14, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Indicates that AI tools were used to assist this with this change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant