dturecek / copr / copr

Forked from copr/copr 6 years ago
Clone

391e94b frontend, common: enrich the module state enum options

2 files Authored by frostyx 4 years ago, Committed by praiskup 4 years ago,
    frontend, common: enrich the module state enum options
    
    Fix #607
    
    The original idea was to have a separate set of states for module
    builds besides the regular build states. I'd still say, that it
    is a good idea to have a separate enum for it, but it should be
    a subset of a build states enum.
    
    Basically, module build consists of a set of package builds and then
    a backend action to do something (details are irelevant here) with
    their results. The action is created if and only if all the builds
    finishes successfully.
    
    So, how the module state should be determined. If the action doesn't
    exist (yet), then we should determine the state from build states,
    e.g. some of the builds is running, then the whole module build is
    running, etc. In the same transaction, that sets the last build to
    succeeded state, the backend action is created. Therefore it won't
    happen that a module acts as succeded even though we are still
    waiting to the action to finish. Once the action exists the module
    state should be determined entirely based on it.
    
    Action status enum have a different set of options than (module) build
    status, so we can't return the action result directly. Fortunately,
    even though the options are not same, they are transformable from
    one enum to other.
    
        
file modified
+4 -2