Handlers¶
Base¶
-
class
estuary_updater.handlers.base.
BaseHandler
(config)[source]¶ An abstract base class for handlers to enforce the API.
-
static
can_handle
(msg)[source]¶ Determine if this handler can handle this message.
Parameters: msg (dict) – a message to be analyzed Returns: a bool based on if the handler can handle this kind of message Return type: bool
-
get_or_create_build
(identifier, original_nvr=None, force_container_label=False)[source]¶ Get a Koji build from Neo4j, or create it if it does not exist in Neo4j.
Parameters: - identifier (str/int) – an NVR (str) or build ID (int), or a dict of info from Koji API
- original_nvr (str) – original_nvr property for the ContainerKojiBuild
- force_container_label (bool) – when true, this skips the check to see if the build is a container and just creates the build with the ContainerKojiBuild label
Return type: KojiBuild
Returns: the Koji Build retrieved or created from Neo4j
-
handle
(msg)[source]¶ Handle a message and update Neo4j if necessary.
Parameters: msg (dict) – a message to be processed
-
is_container_build
(build_info)[source]¶ Check whether a Koji build is a container build.
Parameters: build_info (KojiBuild) – build info from the Koji API Returns: boolean value indicating whether the build is a container build Return type: bool
-
is_module_build
(build_info)[source]¶ Check whether a Koji build is a module build.
Parameters: build_info (KojiBuild) – build info from Koji API Returns: boolean value indicating whether the build is a module build Return type: bool
-
koji_session
¶ Get a cached Koji session but initialize the connection first if needed.
Returns: a Koji session object Return type: koji.ClientSession
-
static
DistGit¶
-
class
estuary_updater.handlers.distgit.
DistGitHandler
(config)[source]¶ A handler for dist-git related messages.
-
static
can_handle
(msg)[source]¶ Determine if this is a dist-git message.
Parameters: msg (dict) – a message to be analyzed Returns: a bool based on if the handler can handle this kind of message Return type: bool
-
commit_handler
(msg)[source]¶ Handle a dist-git commit message and update Neo4j if necessary.
Parameters: msg (dict) – a message to be processed
-
static
Errata¶
-
class
estuary_updater.handlers.errata.
ErrataHandler
(config)[source]¶ A handler for dist-git related messages.
-
advisory_handler
(msg)[source]¶ Handle an Errata tool advisory changes and update Neo4j if necessary.
Parameters: msg (dict) – a message to be processed
-
builds_added_handler
(msg)[source]¶ Handle an Errata tool builds added message and update Neo4j if necessary.
Parameters: msg (dict) – a message to be processed
-
builds_removed_handler
(msg)[source]¶ Handle an Errata tool builds removed message and update Neo4j if necessary.
Parameters: msg (dict) – a message to be processed
-
Freshmaker¶
-
class
estuary_updater.handlers.freshmaker.
FreshmakerHandler
(config)[source]¶ A handler for Freshmaker-related messages.
-
build_state_handler
(msg)[source]¶ Handle a Freshmaker build state changed message and update Neo4j if necessary.
Parameters: msg (dict) – a message to be processed
-
static
can_handle
(msg)[source]¶ Determine if the message is a Freshmaker-related message and can be handled by this handler.
Parameters: msg (dict) – a message to be analyzed Returns: a bool based on if the handler can handle this kind of message Return type: bool
-
create_or_update_build
(build, event_id)[source]¶ Use the Koji Task Result to create or update a ContainerKojiBuild.
Parameters: Returns: the created/updated ContainerKojiBuild or None if it cannot be created
Return type: ContainerKojiBuild or None
-
create_or_update_freshmaker_build
(build, event_id)[source]¶ Create or update a FreshmakerBuild.
Parameters: Returns: the created/updated FreshmakerBuild or None if it cannot be created
Return type: FreshmakerBuild or None
-
Koji¶
-
class
estuary_updater.handlers.koji.
KojiHandler
(config)[source]¶ A handler for Koji related messages.
-
build_handler
(msg)[source]¶ Handle a build state message and update Neo4j if necessary.
Parameters: msg (dict) – a message to be processed
-