Who, where, when: Component system to separate team areas of responsibility

, PHP- Badoo Bumble. 200 -, . . 2006 , . , : , , . ยซ ยป โ€” , . 





, . 





: , . , ?





, . (DocBlock) :





  • @team โ€” , ;





  • @maintainer โ€” , ( ).





/**
 * @team Team name <team@example.com>
 * @maintainer John Smith <john.smith@example.com>
 * @maintainer ....
 */
      
      



. , PhpStorm โ€” . Git hook, , .





. , - โ€” . , Zabbix. โ€” , . , .





. , . 





.





: โ€” , . , , () . 





โ€” , . , .





:





  • ;





  • ( );





  • , โ€” โ€” ;





  • ;





  • (alias).





. :





Example of a component intranet page

, :





  • ;





  • email;





  • , ;





  • , , Jira;





  • , , ;





  • : , ( , , );





/**
 * @component component_alias
 */
      
      



Git hook, . , , , @component . 





remote: ERROR in SomeClass.php:        
remote: * Unknown @component: UnknownComponent. You have to create component before using it in the code   
      
      



, , . , .





, , . , .





$componentManager = new \Components\ComponentManager();
$component = $componentManager->getComponent('component_alias');

$recipients = [];
foreach ($component->getMaintainers() as maintainer) {
    $recipients[] = $maintainer->getEmail();
}
      
      



:





$componentManager = new \Components\ComponentManager();
$component = $componentManager->getComponent('component_alias');

foreach ($component->getMaintainers() as $maintainer) {
    if ($maintainer->isDuty()) {
        return $maintainer;
    }
}
      
      



PhpStorm

PhpStorm, . , , .





IDE . (Slack).





, . , . โ€” , (). - , - .





, . , . , .





, . - , . 80% , , 80% , , .





, , bus factor.





, . .





PHP-

PHP- , Sentry Splunk, . . 





โ€” . , - . 





:





  • ;





  • .





, , . -: 





Badoo Bumble , . MySQL.  





: , - . :





  1. , .





  2. ( , phpMyAdmin, Sequel Pro, IDE . .).





  3. .





  4. .





? 





, โ€” . โ€” . , .





: , . , .





, DBRegistry. , INFORMATION_SCHEMA.





, .





, - (, CPU) . DBRegistry, , , .





, . . ยซ ?ยป. โ€” .





, , .





. !








All Articles