3dde4bb Allow limiting handlers to handle some build targets on some events

Authored and Committed by qwan 6 years ago
    Allow limiting handlers to handle some build targets on some events
    
    Add HANDLER_BUILD_WHITELIST and HANDLER_BUILD_BLACKLIST options to
    support whitelist and blacklist the build target by checking its
    name and branch.
    
    For example:
    
        HANDLER_BUILD_WHITELIST = {
            "MBS": {
                "RPMSpecUpdated": {
                    "module": [
                        {
                            'name': 'base-.*',
                        },
                    ],
                },
            },
        }
        HANDLER_BUILD_BLACKLIST = {
            "MBS": {
                "RPMSpecUpdated": {
                    "module": [
                        {
                            'name': 'base-test-module',
                        },
                        {
                            'branch': 'rawhide',
                        },
                    ],
                },
            },
        }
    
    This will allow MBS handler to build any module on 'RPMSpecUpdated'
    event that name matches 'base-.*' but not:
    
        1. name is not 'base-test-module',
        2. branch is not 'rawhide'.
    
    so in this example:
    
        1. "base-mymodule' from any branch can be built
        2. "base-test-module" from any branch can not be built
        3. any module from 'rawhide' branch can not be built
    
    The two options are empty dicts by default.
    
        
file modified
+43 -0
file modified
+11 -1
file modified
+14 -0
file modified
+66 -0