Coding Together - A Dev Workflow

83
A Dev Workflow CODING TOGETHER Peter Chester @peterchester // tri.be

Transcript of Coding Together - A Dev Workflow

A Dev WorkflowCODING TOGETHER

Peter Chester@peterchester // tri.be

THE

EVENTS CALENDAR

WE CODE AWESOME

Enough about me.

SustainablecollaborativeSYNERGY

Sustainablecollaborative

coding practices

Deploy.

Deployments should be

BORING(Save your energy for the afterparty!)

How did we get here?

the Solo Developer

development

strategyaccount management

project managementquality assurance

support

sales

design

financeoperations

Benefits of the Bachelor• Control• Low Overhead (and High Profits)• Competitive• Efficient

the Price of Freedom• Stressful & Exhausting• Scatterbrain Syndrome• Quality Assurance• It’s lonely.

I had a simple workflow.

Codi

ng li

ke it

’s

Customer’s need is fulfilled

Review with customer

Deploy code (FTP)

Test locally

Write code

Translate to scope

Customer states a need

1999

What’s missing from thesolo workflow?

Customer’s need is fulfilled

Review with customer

Deploy code (FTP)

Test locally

Write code

Translate to scope

Customer states a need

• Source Control

• Deployment Process

• Dev Site

What’s missing from thesolo workflow?

Customer’s need is fulfilled

Review with customer

Deploy code (FTP)

Test locally

Write code

Translate to scope

Customer states a need

Youth is bad for your health.

• Late nights• Hairy releases• Tiny fonts• Giant functions• A general disdain for wellness

Youth is bad for your health.

Then there was

hulu

Then there was

a baby

This is not

sustainable!

Maybe I need a team.

Teams are Awesome!

• Share the load• Inspire & Educate• Smarter than me• Income stability

Teams are Awesome!

Teams are Expensive!

• Communication• Efficiency• Scale

Teams are Expensive!

Deploy code

Customer’s need is fulfilledCustomer’s need is fulfilled

Review with customerReview with customer

Deploy code

Test locally

Write code

Translate to scopeTranslate to scope

Customer states a needCustomer states a needSm

all t

eam

wor

kflo

w Developer

Deploy code

Customer’s need is fulfilledCustomer’s need is fulfilled

Review with customerReview with customer

Deploy code

Test locally

Write code

Translate to scopeTranslate to scope

Customer states a needCustomer states a needSm

all t

eam

wor

kflo

w Team Lead

Developer

Deploy code

Customer’s need is fulfilled

Review with customer

Test locally

Write code

Translate to scope

Customer states a needSm

all t

eam

wor

kflo

w Developer

Deploy code

Test locally

Write code

QA

DeveloperSm

all t

eam

wor

kflo

wTest on dev server

Push to origin/develop

Test locally

Write code

Deploy code

Test locally

Write code

QA

DeveloperSm

all t

eam

wor

kflo

wTest on dev server

Push to origin/develop

Test locally

Write code

Version Control

Dev Server

Deployment Process

Deploy code

Test on dev server

Push to origin/develop

Test locally

Write code

What’s missing from thesmall team workflow?

Deploy code

Test on dev server

Push to origin/develop

Test locally

Write code

• Asynchronous production

• Code quality

• Scalability

What’s missing from thesmall team workflow?

A better workflow

BIG

team

wor

kflo

w CI Server

Developer

QA

Dev #2

Post-release smoke test

Tag Pull Request “merge”

Code review

Run automated tests

Create Pull Request

Push to Origin

Write code

Create feature branch

Deploy!

Pre-release smoke test

Run automated tests

Delete feature branch

Merge

Test feature branch

Into the Sausage Factory

Conscious Coding

Code unto others as you would have them

code unto you.

Code foryour future self

Code fornon-coders

Code fordesigners

Code foryour dad

Code for is for

people

Poem to a PC

1000101101011011010010101001110101010010101101

Architecture

• Files• Functions• Classes• Variables

NomenclatureQUACK!

Short summaryClearly named Class

Clearly named variables

Succinct documentation

Unambiguous function titles

• WP-CLI• ACF or CMB2• SASS or LESS• Grunt or Gulp• …

Leverage Libraries

TDDTest Driven Development

Version Control

Centralized Workflow

MASTER

Feature Branch Workflow

FEATURE

MASTER

Gitflow Workflow

THANK YOU TO VINCENT DRIESSEN AND ATLASSIAN

HOT FIX RELEASE

FEATURE

DEVELOP

MASTER

Read more.

http://m.tri.be/gitworkflow

• Central (Redmine)• Jira• Asana• Trac

Use a Ticketing System

• PHPLint• Unit Testing• Integration Testing• API Integrations & Automation• Deployments

Continuous Integration

• Consistency• Quality• Learning

Code Reviews

Deployment System

Simple git cron

http://m.tri.be/securityscript

Remote Deployment Tool

Capistrano or Rocketeer

Continuous Integration Deployment

Snap CI, Circle CI, Codeship

Dev Sites

the Three Servers

the Three Servers

Production

Staging

Dev

/SERVERS/PRODUCTION

/SERVERS/STAGING

/SERVERS/DEV

Branch based testing sites

Basic branch testing

Production

Dev

FEATURES/ONE

SERVER/PRODUCTION

Production Production

Dev

FEATURES/TWO

Branch testing elaborated

Production

Dev

Production Production

HOT FIX RELEASE

FEATURE

DEVELOP

MASTER

Dev

Dev

Pick-n-pull

Pick-n-pull

Pantheon’s Multidev

Pantheon’s Multidev

Quality Assurance

Ticket Testing

Smoke Testing

Deploy.

Deploy.

Q&APeter Chester

@peterchester // tri.be