#145 Build images according to configurable Errata state
Merged by jkaluza. Opened by cqi.
cqi/freshmaker configurable-adv-state  into  master

Download 145.patch
  • Use whitelist to allow to rebuild by advisory state. For development,
    either running freshmaker in development mode or running tests, states
    REL_PREP, PUSH_READY, IN_PUSH, SHIPPED_LIVE are set.
  • ErrataAdvisoryRPMsSignedHandler.handle is changed. If the advisory
    being handled currently is in SHIPPED_LIVE, do not request comopse
    from ODCS for it and start to rebuild the first batch images
    immediately.
  • Add new property errata_state to event class
    ErrataAdvisoryRPMsSignedEvent. It is used in
    ErrataAdvisoryRPMsSignedHandler.handle. And all code that initiate
    ErrataAdvisoryRPMsSignedEvent event object are updated by passing
    advisory.state accordingly.
  • Calling allow_build in BrewSignRPMHandler.handle and
    ErrataAdvisoryStateChangedHandler.handle by passing advisory state to
    determine whether the state is allowed by whitelist.
  • Add tests.

Signed-off-by: Chenxiong Qi cqi@redhat.com

I'm thinking why we cannot use HANDLER_BUILD_WHITELIST for this instead of creating new option in config.py. You could just do following in freshmaker/handlers/errata/errata_advisory_state_changed.py and elsewhere:

if not self.allow_build(
        ArtifactType.IMAGE,
        advisory_name=advisory.errata_name,
        advisory_security_impact=advisory.security_impact,
        advisory_state=advisory.state):
    return []

I think this way would be more consistent with what we have now.

rebased onto 272576b9c09407e379798a06f1c6d2439052269b

Updated by call allow_build instead of adding a new option to configuration.

This looks better now :).

+1, looks good :)

Commit 1cec3249 fixes this pull-request

Pull-Request has been merged by jkaluza

Pull-Request has been merged by jkaluza

Metadata