HomeDevCentral

Refactor analyzer classes to offer better modularity

Description

Refactor analyzer classes to offer better modularity

Summary:
The GitHub and Jenkins analyzers configuration and workflows
are very similar: they map items (repos or jobs) to groups.

Phabricator is more complex, as we want to try to sort what humans
forgot to sort (e.g. a task without any project but with a keyword
in the title can go to the right group), but still shares the same
logic to locate or parse the configuration file.

The analyzer configuration for GitHub so becomes the base class
PayloadAnalyzerConfiguration. It can be used as is if nothing
else is to be configured than an item/group mapping.

When something else is needed (replace mapping for Phabricator,
add notify only on failure array for Jenkins), we extend it.

The base analyzer will load only the custom class if existing,
and will use the base class when it doesn't.

That simplify a lot the preparation of an analyzer for a new service:
if only mapping is needed, only one analyzer class is needed, and they
can reuse standard payload analyzer configuration.

Test Plan:

  • Current unit tests already cover abstract class methods, as they test the GitHub implementation.
  • Edit configurations to use 'map', run tests, fire payloads.
  • Check test coverage for base classes is well 100%.

Reviewers: dereckson

Subscribers: alken-orin

Differential Revision: https://devcentral.nasqueron.org/D629

Details

Provenance
derecksonAuthored on Aug 23 2016, 14:25
Differential Revision
D629: Refactor analyzer classes to offer better modularity
Parents
rNOTIFb1c179eb454b: Allow Jenkins jobs to be only notified on failure
Branches
Unknown
Tags
Unknown