Maintaining your own branch of Drupal core

5,100 views
5,032 views

Published on

Neil Drumm, the Drupal 5.x maintainer, talks about his experiences being a Drupal core maintainer. Includes how to do the main task, review patches.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
5,100
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
109
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Maintaining your own branch of Drupal core

  1. 1. <ul><ul><li>How to maintain your own </li></ul></ul><ul><ul><li>branch of Drupal core </li></ul></ul><ul><ul><li>Neil Drumm </li></ul></ul><ul><ul><li>5.x branch maintainer </li></ul></ul>
  2. 2. <ul><ul><li>I am not actually going to tell you about branching Drupal. Do not do that. </li></ul></ul>
  3. 3. <ul><ul><li>This is about Drupal 5.x. </li></ul></ul>
  4. 4. <ul><ul><li>“Neil has quite a knack for detecting attempts to get cruft into Drupal.” </li></ul></ul><ul><ul><li>“Neil has been the co-founder and maintainer of CivicSpace, the first Drupal distribution.” </li></ul></ul><ul><ul><li>— Dries Buytaert </li></ul></ul><ul><ul><li>http://buytaert.net/neil-drumm </li></ul></ul>
  5. 5. <ul><ul><li>One rule: </li></ul></ul><ul><ul><li>Do not commit features </li></ul></ul><ul><ul><li>from coworkers </li></ul></ul>
  6. 10. Patch reviews Collected 16/Sep/2007
  7. 11. Commits per week
  8. 12. Top reviewers 318 total Collected 16/Sep/2007 Number of issues changed from needs review or ready to commit
  9. 13. Top patch writers 830 total Collected 16/Sep/2007 Number of issues posting an attachment follow up
  10. 14. <ul><ul><li>How to review a patch </li></ul></ul>
  11. 15. Code style if (arg(0) == 'node' && arg(1) == 'add' && $type = arg(2)) { $type = node_get_types('type', str_replace('-', '_', arg(2))); - return '<p>'. filter_xss_admin($type->help) .'</p>'; + + if ( $help = filter_xss_admin($type->help) ) { + return '<p>'. $help .'</p>'; + } } } http://drupal.org/node/112140
  12. 16. Functionality <ul><ul><li>+ if ($return_path && !ini_get('safe_mode')) { </li></ul></ul><ul><ul><li>+ return mail( </li></ul></ul><ul><ul><li>+ $to, </li></ul></ul><ul><ul><li>+ mime_header_encode($subject), </li></ul></ul><ul><ul><li>+ str_replace(&quot; &quot;, '', $body), </li></ul></ul><ul><ul><li>+ join(&quot; &quot;, $mimeheaders), </li></ul></ul><ul><ul><li>+ '-f'. $return_path </li></ul></ul><ul><ul><li>+ ); </li></ul></ul><ul><ul><li>+ } </li></ul></ul><ul><ul><li>http://drupal.org/node/131737 </li></ul></ul>
  13. 17. Usability <ul><ul><li>// Output a list of queries executed </li></ul></ul><ul><ul><li>if (!empty($_SESSION['update_results'])) { </li></ul></ul><ul><ul><li>$output .= '<div id=&quot;update-results&quot;>'; </li></ul></ul><ul><ul><li>- $output .= '<h2>The following queries were executed</h2>'; </li></ul></ul><ul><ul><li>+ $output .= '<h2> The following status messages were returned </h2>'; </li></ul></ul><ul><ul><li>foreach ($_SESSION['update_results'] as $module => $updates) { </li></ul></ul><ul><ul><li>$output .= '<h3>'. $module .' module</h3>'; </li></ul></ul><ul><ul><li>http://drupal.org/node/167610 </li></ul></ul>
  14. 18. Scalability $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where']; $sql .= tablesort_sql($header); - $result = pager_query($sql, 50, 0, NULL, $filter['args']); + $count_sql = 'SELECT COUNT(DISTINCT(u.uid)) FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where'] ; + $count_sql .= tablesort_sql($header); + + $result = pager_query($sql, 50, 0, $count_sql, $filter['args']); $form['options'] = array( '#type' => 'fieldset', <ul><ul><li>http://drupal.org/node/137754 </li></ul></ul>
  15. 19. Security $session_name = $cookie_domain; } else { + // If the site is using session.cookie_secure, use $base_url as + // session name. + if (ini_get('session.cookie_secure')) { + $session_name = $base_url; + } // Otherwise use $base_url as session name, without the protocol // to use the same session identifiers across http and https. - list( , $session_name) = explode('://', $base_url, 2); + else { + list( , $session_name) = explode('://', $base_url, 2); + } // We try to set the cookie domain to the hostname. // We escape the hostname because it can be modified by a visitor. if (!empty($_SERVER['HTTP_HOST'])) { <ul><ul><li>http://drupal.org/node/170310 </li></ul></ul>
  16. 20. How to review a patch <ul><li>Code style Is it readable? </li></ul><ul><li>Functionality Does it work? </li></ul><ul><li>Usability Does it make sense? </li></ul><ul><li>Scalability Will it scale? </li></ul><ul><li>Security Is it secure? </li></ul>More at http://drupal.org/patch/review
  17. 21. <ul><ul><li>Releases </li></ul></ul>
  18. 22. <ul><ul><li>5.0 </li></ul></ul>
  19. 23. <ul><ul><li>5.1 </li></ul></ul>
  20. 24. <ul><ul><li>5.2 </li></ul></ul>
  21. 25. <ul><ul><li>What I learned </li></ul></ul>
  22. 26. <ul><ul><li>It is impossible to fix everything </li></ul></ul>
  23. 27. <ul><ul><li>There will be another release </li></ul></ul>
  24. 28. <ul><ul><li>Someone will find the right solution for every issue </li></ul></ul>

×