Conversation
|
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.



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.gofile, 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 fromresolver.go.Key changes include:
Local strategy logic refactor and expansion
local_strategies.gocontaining a unifiedprocessLocalStrategyfunction that supports multiple validation strategies (VALUE_VALIDATION,NUMERIC_VALIDATION,DATE_VALIDATION,TIME_VALIDATION,PAYLOAD_VALIDATION,NETWORK_VALIDATION, andREGEX_VALIDATION) with their respective operations. This replaces the previous limited and duplicated logic.evaluateLocalStrategy,containsString, andnetworkExistsfunctions fromresolver.go, and updated all usages to call the new, more comprehensiveprocessLocalStrategy. [1] [2] [3] [4]Testing
local_strategies_test.gothat 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.