Slide 1

Slide 1 text

CODE TEST DEPLOY REPEAT Antonello D'Ippolito @antodippo

Slide 2

Slide 2 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 2 CONTINUOUS INTEGRATION CONTINUOUS DELIVERY CONTINUOUS DEPLOYMENT

Slide 3

Slide 3 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 3 HELLO! Antonello D'Ippolito @antodippo backend engineer @

Slide 4

Slide 4 text

1. CODE 4

Slide 5

Slide 5 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 5 FAST AND TINY PRs CODE REVIEWS PAIR PROGRAMMING CODE

Slide 6

Slide 6 text

6 FEATURE TOGGLES

Slide 7

Slide 7 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 7 if (toggleIsOn) { $this->newFancyFunctionality(); } else { $this->oldFunctionality(); } FEATURE TOGGLES

Slide 8

Slide 8 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 8 FEATURE TOGGLES https://www.martinfowler.com/articles/feature-toggles.html

Slide 9

Slide 9 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 9 DECOUPLE TOGGLE FROM DECISION CENTRALIZE THE LOGIC AVOID CONDITIONALS REMOVE TOGGLES FEATURE TOGGLES

Slide 10

Slide 10 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 10 ● github.com/qandidate-labs/qandidate-toggle ● github.com/qandidate-labs/qandidate-toggle-bundle ● github.com/qandidate-labs/qandidate-toggle-api FEATURE TOGGLES qandidate/toggle

Slide 11

Slide 11 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 11 FEATURE TOGGLES qandidate/toggle ALWAYS ACTIVE ALWAYS INACTIVE CONDITIONALLY ACTIVE

Slide 12

Slide 12 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 12 FEATURE TOGGLES qandidate/toggle // Create the ToggleManager $manager = new ToggleManager(new InMemoryCollection()); // A toggle that will be active when the user id is less than 42 $operator = new LessThan(42); $condition = new OperatorCondition('user_id', $operator); $toggle = new Toggle('toggling', array($condition)); // Add the toggle to the manager $manager->add($toggle); // Create and check a new context for a user with id 42 $context = new Context(); $context->set('user_id', 42); var_dump($manager->active('toggling', $context)); // false

Slide 13

Slide 13 text

2. TEST 13

Slide 14

Slide 14 text

14

Slide 15

Slide 15 text

15

Slide 16

Slide 16 text

16

Slide 17

Slide 17 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 17 SMOKE TESTS USER ACCEPTANCE TESTS (BEHAT) TEST UI INTEGRATION UNIT INTEGRATION & COMPONENT TESTS (BEHAT, PHPUNIT) UNIT TESTS (PHPSPEC)

Slide 18

Slide 18 text

3. DEPLOY 18

Slide 19

Slide 19 text

“ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 19 IF IT HURTS DO IT MORE OFTEN DEPLOY

Slide 20

Slide 20 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 20 DEPLOY

Slide 21

Slide 21 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 21 EVERYONE CAN DEPLOY DEPLOY

Slide 22

Slide 22 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 22 PIPELINES (JENKINS) DEPLOY SETUP PROJECT TEST SUITES MISC. CHECKS BUILD ARTIFACT SETUP PROJECT TEST SUITES MISC. CHECKS BUILD ARTIFACT DEPLOY ACCEPTANCE SETUP PROJECT TEST SUITES MISC. CHECKS BUILD ARTIFACT DEPLOY PRODUCTION SMOKE TESTS PUSH MERGE TAG ACC. TESTS

Slide 23

Slide 23 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 23 MEASURE & MONITOR EVERYTHING DEPLOY ● API CALLS RESPONSE TIME ● CONTROLLERS LOADING TIME ● CRONS EXIT STATUS ● ERROR LOGS ● ...

Slide 24

Slide 24 text

4. DELIVER 24

Slide 25

Slide 25 text

“ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 25 DECOUPLE DEPLOY FROM RELEASE DELIVER

Slide 26

Slide 26 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 26 DELIVER A/B TESTING CANARY RELEASE

Slide 27

Slide 27 text

5. YES, BUT WHAT'S IN IT FOR ME? 27

Slide 28

Slide 28 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 28 IT SHARPENS YOUR DEVOPS SKILLS

Slide 29

Slide 29 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 29 STRESS FREE DEPLOYS

Slide 30

Slide 30 text

30

Slide 31

Slide 31 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 31 FAST FEEDBACK ● FROM CI ● FROM MONITORING ● FROM USERS

Slide 32

Slide 32 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 32 YOU'RE GONNA FAIL. THE PROBLEM IS HOW SOON

Slide 33

Slide 33 text

33

Slide 34

Slide 34 text

“ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 34 EL CAMINO ES LA RECOMPENSA Oscar W. Tabárez

Slide 35

Slide 35 text

“ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 35 You can’t do it without automating your entire build, deploy, test, and release process. You can’t do it without a comprehensive, reliable set of automated tests. You can’t do it without writing system tests that run against a production-like environment. Continuous Delivery - Jez Humble, David Farley

Slide 36

Slide 36 text

“ Antonello D'Ippolito CODE TEST DEPLOY REPEAT 36 That’s why, even if you can’t actually release every set of changes that passes all your tests, you should aim to create a process that would let you do so if you choose to. Continuous Delivery - Jez Humble, David Farley

Slide 37

Slide 37 text

Antonello D'Ippolito CODE TEST DEPLOY REPEAT 37 THANKS! (No canaries were harmed in the making of this talk) Antonello D'Ippolito @antodippo