Slide 1

Slide 1 text

Investigating Regressions Quickly using Git Bisect John Blackbourn · @johnbillion

Slide 2

Slide 2 text

Investigating Regressions Efficiently using Git Bisect John Blackbourn · @johnbillion

Slide 3

Slide 3 text

“Well, it used to work...”

Slide 4

Slide 4 text

dae2820 Version 3.1. 8cec81d Tighten up some Composer dependencies so things don't break so freely. 4ddb969 Use QM's wrapper function for path normalising to ensure compatibility. 13e4ff6 Built CSS. 1344cba Debug Bar extension taming. 4e4a7c5 More tweaks for the sorting controls. c87b614 Introduce a git attributes file so files can be excluded during packaging. a172b79 Update the tests. 7f94fd2 Update the readme file. bee172b Template Part file string normalization b53995b Link to the privacy statement instead of bundling it. 9353086 Switch to system default fonts. 82edf66 Fix the sorting arrows again. a88af25 Add a min-width to logger messages. a49a2ed Improvements to link icons, and add an icon to regular links. eace3c9 More specificity! cd8ef84 More tweaks to paddings, alignment, sizing, yadda yadda. 6658f6c Tweak the array element names in the Environment collector. 721d5be Automatically wrap all box containers for now. Needs a better solution at some point. 75616b8 Add some styles specific to mobile/touch devices. 0d1d9db More tweaks to column min widths and wrapping. 156b6f7 Show a warning message in the Overview panel when a PHP error is trigger during an Ajax request. 664875c Don't output toggle links or a blank HTTP API transport if not necessary. 6113d4a Add a human readable representation of transient timeouts, and prevent some wrapping. ecc697e Display human-readable environment values inline. 308cbec Display a warning when time or memory usage is above 75% of the respective limit. f054c1f Utilise the output wrappers when outputting logs. 88375ab Re-add style for the logger warning in the menu. a71197d Place HTML comments between each panel output. e4b9c19 Separate asset dependencies and dependents with commas. 1c9a183 Add missing i18n for various data in the Environment and Debug Bar panels. 3109f04 Add a tear down for the capability checks collector. 41fc043 Move more rules under the #query-monitor selector.

Slide 5

Slide 5 text

20d9981 Switch to using labels and buttons for table sorting controls. 214b435 Don't use a heading for the jQuery error message. 081664f Headings! fd100fd Update some more heading levels, introduce a heading for the panel menu. e686d4c Place focus on the panel when selecting one. 19b8deb Add a missing Sass variable. e1e665f Include buttons when adding the hover style to parent rows of focused links. ca196e2 Begin restructuring the panel heading levels. da1c060 Tweak the toolbar buttons further. 786d7fd When tabbing between links in tables, apply the row hover style to the parent row. 95be19c Fix the Sass file header. 0e4d33d Make use of selector nesting. fc30f71 Improve the panel menu item focus styles for keyboard navigation. de6d311 Amazing! It's possible to prevent the "overscroll" behaviour. cf76b56 Refactor the admin toolbar styles, add some more variables. 607f9bd Increase the file watch interval to give my CPU a break. 1b90cac More visual tweaks to the toolbar buttons. 2491ca9 Add a link hover color. 55a7a54 Add missing default statements. 67d117c Namespace the Sass variables and convert them to default values. 9624c2d Link to each asset source. 46d4b4f Re-calculate table striping after column sorting. 01bd4a2 Strip HTML from PHP error messages during collection instead of during output. eb8c996 Add a notice style and use it in the Capability Checks panel when it hasn't been enabled. f3ac8f0 Add a background colour when hovering over the filter controls. 1785b9a Add a background colour when hovering over the toolbar buttons. 9fe76c5 Prevent accidental text selection when resizing the panel. 1302938 Everything is important. f7d8b70 Increase some contrast. 12642d4 Version 3.0.1. b7e5999 Update the Sass and built CSS. ce7c345 I continually underestimate how messed up some websites are with regard to jQuery. bc793ad Don't remove the stored container height when closing the QM panel. See #326.

Slide 6

Slide 6 text

Bisect “To cut or divide into two equal parts”

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

$ git bisect start $ git bisect good "2.6.10" $ git bisect bad HEAD Bisecting: 74 revisions left to test after this (roughly 6 steps). [c20280a] Further tweaks to QM's output if JavaScript isn't available for any reason.

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

$ git bisect start $ git bisect good "2.6.10" $ git bisect bad HEAD Bisecting: 74 revisions left to test after this (roughly 6 steps). [c20280a] Further tweaks to QM's output if JavaScript isn't available for any reason. $ git bisect bad Bisecting: 36 revisions left to test after this (roughly 5 steps). [a59860e] Correct some output priorities.

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

$ git bisect good Bisecting: 18 revisions left to test after this (roughly 4 steps). [c5f91e4] Consistent and correct output for closures and anonymous functions.

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

commit 6b3c8c2 Author: John Blackbourn Date: Mon Mar 16 00:27:08 2015 +0000 Don't add a warning indicator to the admin bar menu if the `all` hook is in use. The warning in the Hooks output is sufficient. $ git bisect good 6b3c8c2 is the first bad commit

Slide 15

Slide 15 text

$ git diff 1bd84ab 6b3c8c2 - public function admin_menu( array $menu ) { - $data = $this->collector->get_data(); - $args = array( - 'title' => $this->collector->name(), - ); - $menu[] = $this->menu( $args ); - return $menu; - } $ git bisect reset Previous HEAD position was 6b3c8c2... Don't add a warning indicator to the admin bar menu if the `all` hook is in use. Switched to branch 'master'

Slide 16

Slide 16 text

We can do better!

Slide 17

Slide 17 text

$ git bisect run test.php $ git bisect run behat features/menu.feature $ git bisect run test-menu.sh

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

$ git bisect run php -f test-menu.php running php -f test-menu.php Bisecting: 74 revisions left to test after this (roughly 6 steps) running php -f test-menu.php Bisecting: 36 revisions left to test after this (roughly 5 steps) running php -f test-menu.php Bisecting: 18 revisions left to test after this (roughly 4 steps) running php -f test-menu.php ... Bisecting: 0 revisions left to test after this (roughly 0 steps) running php -f test-menu.php 6b3c8c2 is the first bad commit

Slide 20

Slide 20 text

We can do better!

Slide 21

Slide 21 text

$ git bisect start -- path/to/code

Slide 22

Slide 22 text

I hope you don’t need this advice very often John Blackbourn · @johnbillion