Page MenuHomeDevCentral

Refactor GitHubPayloadAnalyzer into payloads individual rules
ClosedPublic

Authored by dereckson on Feb 6 2016, 05:36.

Details

Summary

Instead of trying to parse every payload in GitHubPayloadAnalyzer,
we split the processing into several rules class, one class per type.
They are located in app/Analyzers/GitHub/Events.

So, if GitHub introduces a new event type, the only thing to do is
to create a new class for this event, provide sensible return values
for getDescription and getLink. The class will then be autoloaded.

Test Plan

phpunit

Code coverage at 100% for the new classes and the
modified parts of GitHubPayloadAnalyzer.

Diff Detail

Repository
rNOTIF Notifications center
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dereckson updated this revision to Diff 635.Feb 6 2016, 05:36
dereckson retitled this revision from to [WIP] Refactor GitHubPayloadAnalyzer.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson updated this revision to Diff 636.Feb 6 2016, 05:41
dereckson edited edge metadata.

Whitespace issues

dereckson updated this revision to Diff 637.Feb 8 2016, 17:22
dereckson edited edge metadata.

More tests: WithCommit, DeleteEvent

dereckson updated this revision to Diff 638.Feb 8 2016, 20:04

UnknownEvent

dereckson updated this revision to Diff 639.Feb 8 2016, 22:11

Previous diff 638 overwrote the UnknownEvent class with the test class.

dereckson updated this revision to Diff 640.Feb 9 2016, 01:59
  • More tests
  • Fixed a l10n issue in PushEvent::getDescriptionMessageKey
dereckson updated this revision to Diff 641.Feb 9 2016, 02:24

+StatusEventTest

dereckson updated this revision to Diff 642.Feb 9 2016, 03:52

StatusEventTest

dereckson updated this revision to Diff 643.Feb 9 2016, 16:01

RepositoryEventTest coverage

dereckson updated this revision to Diff 644.Feb 9 2016, 16:46
  • GitHubPayloadAnalyzerTest code coverage for our refactoring
  • Tidy up a little these files
dereckson retitled this revision from [WIP] Refactor GitHubPayloadAnalyzer to Refactor GitHubPayloadAnalyzer into payloads individual rules .Feb 9 2016, 16:52
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson updated this object.
dereckson updated this revision to Diff 645.Feb 9 2016, 17:08
dereckson retitled this revision from Refactor GitHubPayloadAnalyzer into payloads individual rules to Refactor GitHubPayloadAnalyzer into payloads individual rules.
dereckson updated this object.

Final tweaks, renamed DockerHubPush… by GitHubPush…

dereckson accepted this revision.Feb 9 2016, 17:18
dereckson edited edge metadata.
This revision is now accepted and ready to land.Feb 9 2016, 17:18
This revision was automatically updated to reflect the committed changes.