- 
                Notifications
    
You must be signed in to change notification settings  - Fork 545
 
feat: optimize DSL rule phases and refactor zone types #3878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: optimize DSL rule phases and refactor zone types #3878
Conversation
      
          
      
      
            LaurenceJJones
  
      
      
      commented
        Sep 10, 2025 
      
    
  
- Auto-optimize rules to phase 1 when possible (headers, method, URI, GET args)
 - Maintain phase 2 for body-dependent zones (POST args, files, raw body)
 - Enforce same-phase constraint for chained (AND) rules
 - Allow independent phase optimization for OR rules
 - Replace string maps with typed Zone struct for better maintainability
 - Add comprehensive tests for mixed-phase scenarios
 
- Auto-optimize rules to phase 1 when possible (headers, method, URI, GET args) - Maintain phase 2 for body-dependent zones (POST args, files, raw body) - Enforce same-phase constraint for chained (AND) rules - Allow independent phase optimization for OR rules - Replace string maps with typed Zone struct for better maintainability - Add comprehensive tests for mixed-phase scenarios
| 
           @LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically. 
 DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.  | 
    
| 
           @LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit. 
 DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.  | 
    
| 
           /kind feature  | 
    
          Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@            Coverage Diff             @@
##           master    #3878      +/-   ##
==========================================
- Coverage   61.67%   61.67%   -0.01%     
==========================================
  Files         406      406              
  Lines       41839    41889      +50     
==========================================
+ Hits        25806    25833      +27     
- Misses      13914    13930      +16     
- Partials     2119     2126       +7     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
| 
           Manually run hub tests, results below 100% coverage, which makes sense since we changing phases should not impact effectiveness of rules. phase 2 rules: phase 1 rules: You can see most rules will optimize into   |