#60 Make allow_build(...) method more dynamic and use it in sign_rpm handler.
Merged by jkaluza. Opened by jkaluza.
jkaluza/freshmaker allow-build  into  master

Download 60.patch

In this PR, it is easier to extend allow_build without actually touching its internals. You just pass another keyword argument to it and it checks its appearance in whitelist/blacklist.

The goal is to be able to configure Freshmaker to handle only "RHSA-*" Errata advisories with configuration like this:

HANDLER_BUILD_WHITELIST = {
    "BrewSignRPMHandler": {
        "image": [
            {"advisory_name": "RHSA-.*"}
        ]
    }
}

This is complicated enough that it is probably worth adding positive and negative tests.

This is a negative test. (The rule says RHSA but you pass in RHBA and ensure that nothing happens).

Please add a test for the positive case too where the rule says RHSA and you pass in RHSA and then ensure that the action takes place.

Looks like a good approach.

I added a comment requesting one more test case. Otherwise, :+1:.

rebased

I've improved tests a bit and they also test both positive and negative situations. I'm curious what's going on with Jenkins :(

rebased

Tests are passing, started manually in jenkins: https://jenkins.fedorainfracloud.org/job/freshmaker/242/

Pull-Request has been merged by jkaluza

Metadata