'

Rise of the Machines - Automate Your Development

Понравилась презентация – покажи это...





Слайд 0

Rise of the machines Automate your development @svenpet


Слайд 1

Disclaimer Scripts Chef, Puppet, etc better build pipelines


Слайд 2

Disclaimer Ideas through examples


Слайд 3

Rise of the machines


Слайд 4

ROBOTS are coming to our day to day lives


Слайд 5


Слайд 6


Слайд 7


Слайд 8


Слайд 9

Rise of the machines IN Software Development


Слайд 10

Sven Peters Atlassian Evangelist svenpet.com @svenpet


Слайд 11

Automation in Software Development my personal story GUI builder 1996 1998 2001 build scripts (make) JUnit Eclipse (code generation) 2004 2006 2005 Hudson ant -> later maven 2009 Puppet 2013 Docker


Слайд 12

What are we automating right now? Deployments Build & Tests Small scripts


Слайд 13

What are we automating right now? Support Code Reviews Merging Stand Ups Ops Engineering Health


Слайд 14

Bots everywhere Coding bots Test bots Ops bots Service bots Report bots Doc bots


Слайд 15

I’m new Welcome… or


Слайд 16

Happy installing & setup… for the next 8 hours Add ons JDK IntelliJ Git Postgres Scala


Слайд 17


Слайд 18


Слайд 19


Слайд 20


Слайд 21


Слайд 22


Слайд 23


Слайд 24

Meet Agent Charlie


Слайд 25

Meet Download Install Configure Agent Charlie


Слайд 26

Meet Download Install Configure Agent Charlie


Слайд 27

Puppet, Shell & Ruby Works with OSX & Ubuntu IntelliJ IDEA Atlassian Plugin SDK JDK Bitbucket SSH Keys Maven Git PostgreSQL Mercurial Stash Keys HipChat and much more… HomeBrew


Слайд 28

Without Agent Charlie With Agent Charlie


Слайд 29

Coding bots Automate your Coding phase


Слайд 30

27’’ is not enough


Слайд 31

Repo manager IDE Chat Email Issue Tracker Command line


Слайд 32

Issue tracker workflow TODO IN PROGRESS IN REVIEW DONE


Слайд 33

Developer workflow BRANCH CODE REFACTOR PULL MERGE


Слайд 34

What you should do TODO BRANCH IN PROGRESS CODE IN REVIEW REFACTOR PULL DONE MERGE


Слайд 35

What you do TODO BRANCH IN PROGRESS CODE IN REVIEW REFACTOR PULL DONE MERGE


Слайд 36

Keep the team updated!


Слайд 37


Слайд 38

Smart commits mention issue_key and #trigger the issue tracker Github JIRA YouTrack Trello Bitbucket


Слайд 39

Control the issue by commits TODO IN PROGRESS IN REVIEW DONE JRA-566 #start-Progress JRA-566 #start-review fixes #566


Слайд 40

No tool switching Robot is just receiving commands


Слайд 41

Controlled by action TODO IN PROGRESS IN REVIEW DONE branch commit pull request create review merge close review


Слайд 42


Слайд 43

Our workflow TODO IN PROGRESS branch IN REVIEW pull DONE merge


Слайд 44

branch master JRA-554-bugfix pull merge


Слайд 45

branch pull commits code directly to the master branch! master merge


Слайд 46

branch master pull merge


Слайд 47

branch master JRA-554-bugfix pull merge


Слайд 48

branch master JRA-554-bugfix pull merge


Слайд 49

bad surprise sh*t happens, but can be avoided


Слайд 50

no bad surprise sh*t doesn’t happen that often


Слайд 51

branch pull merge master JRA-554-bugfix don’t branch from a red build


Слайд 52

branch pull merge master JRA-554-bugfix invite the best reviewers


Слайд 53


Слайд 54

Recent comitters or author


Слайд 55

auto suggest reviewer


Слайд 56

branch pull master JRA-554-bugfix minimum 2 approvals merge


Слайд 57

branch pull merge master JRA-554-bugfix unapprove reviewers when code changes


Слайд 58

The need to update older versions


Слайд 59

Support older versions master Version 1.1 Version 1.0


Слайд 60

Support older versions master Version 1.1 Version 1.0 JRA-234-hotfix


Слайд 61

Support older versions master Version 1.1 Version 1.0 JRA-234-bugfix boring!


Слайд 62

Huhu I can do it!


Слайд 63

auto merges master Version 1.1 Version 1.0 JRA-234-bugfix


Слайд 64

Test bots SMARTER Test Automation


Слайд 65

&:hover { text-decoration: none; color: @invertedBodyTextColor background-color: #366ca6; cursor: pointer; }


Слайд 66

&:hover { text-decoration: none; color: @invertedBodyTextColor background-color: #366ca6; cursor: pointer; } Static code analysis can catch this! Findbugs - Checkstyle - PMD


Слайд 67

Listen to what Freud tells you about your source code


Слайд 68

Freud Bot &:hover { text-decoration: none; color: @invertedBodyTextColor background-color: #366ca6; You should use a variable instead for #366CA6 . I suggest that you use a variable of similar color: @globalHeaderPrimaryActionFallbackColor @globalHeaderTopColor cursor: pointer; } @primaryLinkColor


Слайд 69

Freud Bot for Pull Requests


Слайд 70

Freud Bot less review work makes suggestions


Слайд 71

We are trying hard to write awesome code


Слайд 72

package com.miguelcatalan.materialsearchview; MyAwesomeClass import android.app.Activity; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; import java.lang.reflect.Field; import java.util.List; /** * @author Miguel Catalan Bañuls */ public class MaterialSearchView extends FrameLayout implements Filter.FilterListener { private MenuItem mMenuItem; LOC: 32 private boolean mIsSearchOpen = false; public MaterialSearchView(Context context) { this(context, null); } public MaterialSearchView(Context context, AttributeSet attrs) { this(context, attrs, 0); @Override public void onTextChanged(CharSequence s, int start, int before, int count) { mUserQuery = s; startFilter(s); MaterialSearchView.this.onTextChanged(s); } }


Слайд 73

One month later


Слайд 74

package com.miguelcatalan.materialsearchview; import android.app.Activity; import android.content.Context; MyAwesomeClass import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.TypedArray; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.speech.RecognizerIntent; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.util.AttributeSet; LOC: counting…. import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.EditText; import android.widget.Filter; import android.widget.Filterable; import android.widget.FrameLayout; …one month later import android.widget.ImageButton; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; import com.miguelcatalan.materialsearchview.utils.AnimationUtil;


Слайд 75

mSearchSrcTextView.setText(null); mSearchSrcTextView.requestFocus(); MyAwesomeClass if (animate) { AnimationUtil.fadeInView(mSearchLayout, AnimationUtil.ANIMATION_DURATION_MEDIUM, new AnimationUtil.AnimationListener() { @Override public boolean onAnimationStart(View view) { return false; } @Override public boolean onAnimationEnd(View view) { if (mSearchViewListener != null) { mSearchViewListener.onSearchViewShown(); } return false; } LOC: 986 @Override public boolean onAnimationCancel(View view) { return false; } }); } else { mSearchLayout.setVisibility(VISIBLE); if (mSearchViewListener != null) { mSearchViewListener.onSearchViewShown(); …one month later } } mIsSearchOpen = true; } /** * Close search view. */ public void closeSearch() {


Слайд 76

Code over time 86% test coverage 20 deprecated methods 1045 old unit tests (JUnit 3) 27 compiler warnings


Слайд 77

Code over time 83% test coverage 23 deprecated methods 1136 old unit tests (JUnit 3) 36 compiler warnings


Слайд 78

Code over time 75% test coverage 32 deprecated methods 1289 old unit tests (JUnit 3) 45 compiler warnings


Слайд 79

Developers don’t write bad code on purpose Developers are trying to solve problems


Слайд 80

Calling Dr. Code measure constantly the engineering health


Слайд 81

Calling Dr. Code measure constantly the engineering health


Слайд 82

JUnit 3 JUnit 4 No more JUnit 3 tests! jira.stats.tests.junit.3.count


Слайд 83

Inspect all the things jira.stats.tests.junit.3.count jira.stats.bundled.jars.in.plugins


Слайд 84

Caught by Dr Code? API compatibility :( New JUnit3 test JS not minified You’ll enter the Hall of Shame!


Слайд 85

You’ll enter the Hall of Shame! Wallboard - so everyone sees it!


Слайд 86

Fixed a matrix? You’ll enter the Hall of Fame!


Слайд 87

Old version New version public abstract class Task { public abstract class Task { public final void executeWith(Callback callback) { public final void executeWith(Callback callback) { execute(); execute(); if (callback != null) { if (callback != null) { callback.call(); callback.call(20); } } } } public abstract void execute(); public abstract void execute(); } }


Слайд 88

Old version New version public abstract class Task { public abstract class Task { public final void executeWith(Callback callback) { public final void executeWith(Callback callback) { execute(); execute(); if (callback != null) { if (callback != null) { callback.call(); 20 callback.call( } ); } } public abstract void execute(); } } public abstract void execute(); }


Слайд 89

Old version New version


Слайд 90

Old version Hard to spot? New version


Слайд 91

Image Compare Bot Compare images Alert on differences Easy reporting (on build) (build warning) (build report)


Слайд 92

Our functional tests ran for h urs so we ran them parallel


Слайд 93

waiting for the longest test block Test block 1 Test block 2 Test block 3 Test block 4 Test block 5 statically sized test blocks


Слайд 94

Hallelujah Functional Test Balancer


Слайд 95

Hallelujah T1 T6 T2 T8 T3 T4 T11 T13 T9 T7 T5 T14 T10 T 12


Слайд 96

build status


Слайд 97

build status


Слайд 98

build status


Слайд 99

Flaky Test Detector


Слайд 100

Flaky Test Detector rerun test failing test successful test continue build test in quarantaine create issue


Слайд 101

1888 flaky tests detected 817 quarantined tests fixed


Слайд 102

no manual reruns no more ‘this one again’ moments Flaky Test Detector forces fixing flaky tests no log file searching


Слайд 103

OPS bots Automated Operations


Слайд 104


Слайд 105

Ops problem now


Слайд 106

Slow feedback loop prob ops dev


Слайд 107

Faster feedback loop prob dev


Слайд 108

Faster feedback loop knows which team -> service responsibility


Слайд 109

Faster feedback loop But that’s a lot of configuration!


Слайд 110

Faster feedback loop add team in deployment descriptor add connection to pager duty


Слайд 111

Own your code end-to-end


Слайд 112

Prepared for the release? WAIT… Release Notes?


Слайд 113

Do you know which features really ship? Bugfix New Feature Improvement Release Branch


Слайд 114

Release Notes Bot Merged JRA-345 Commit messages + = Issue information Release notes


Слайд 115


Слайд 116

Label in GitHub Issues Label in GitHub Issues


Слайд 117


Слайд 118


Слайд 119

New features Improvements Fixed bugs


Слайд 120

No surprises Human readable issue descriptions Think about customer value Issue Description as Release Notes


Слайд 121

Service bots Automate your Service


Слайд 122

Support ask for log file Developer scanning log files system knowledge


Слайд 123

pause work


Слайд 124

Support ask for log file Developer scanning log files system knowledge


Слайд 125

Support ask for log file Hercules scanning log files system knowledge


Слайд 126

Teaching the robot


Слайд 127

Hercules get’s smarter suggest read update


Слайд 128

{ Well f*%k me THE ROBOT was right! }


Слайд 129

Your boss has a really important task for your team


Слайд 130

Everyone is working from home today


Слайд 131


Слайд 132

by


Слайд 133


Слайд 134

With chat you can reach everyone immediately


Слайд 135

How do I download the Sprint report? How do I set up a build for my feature branch? All these questions! What Java versions do we support?


Слайд 136

!ask Self service for chat I’ll look it up for you


Слайд 137

!ask the knowledge base first!


Слайд 138

REPORT bots Manual Reporting sucks


Слайд 139

Automating Stand Up s ?


Слайд 140

too long setup VC calls Stand Up timezones Problems remind people


Слайд 141


Слайд 142

Music - Start at 09:29:00 Crontab! Never miss a stand up


Слайд 143

Video - Open at 09:30 No video set up time


Слайд 144

Stand up report bots distributed colocated different timezones


Слайд 145

Status update


Слайд 146

Team update


Слайд 147

Stand up bot


Слайд 148

New issue Exception Chat Bots everywhere Build failure Deployment


Слайд 149

ΩΩΩΩ Builds


Слайд 150

ΩΩΩΩ Deployments


Слайд 151

ΩΩΩΩ Exceptions


Слайд 152

Chat Bots everywhere Fast feedback loops Team knowledge Start discussions


Слайд 153

The build failed New deployment


Слайд 154

The build failed New deployment


Слайд 155

The build failed New deployment


Слайд 156

New important issue New deployment


Слайд 157

New important issue New deployment


Слайд 158

Get the big picture New important issue New deployment


Слайд 159

Get the big picture


Слайд 160

e ck u tb i o b .b rd a h as tl /a :/ tp t g/ or t. Every team has one or more


Слайд 161

e ck u tb i g/ or t. .b rd a o b as tl /a :/ tp t Every team has one or more h see what’s going on point directly


Слайд 162

All kind of boards Advocates Developer Support


Слайд 163

Bots everywhere Coding bots Test bots Ops bots Service bots Report bots Doc bots


Слайд 164

Writing automation code Reinvent the wheel? Very specific problem Lots of unmaintained projects


Слайд 165

No. 1 Problem


Слайд 166

Technical debt 10% work time for better engineering health


Слайд 167

Technical debt 10% work time for better engineering health


Слайд 168


Слайд 169

Motivation Success Your Problems Fast feedback Automation is serious fun! Languages Technologies Go - Ruby - PHP - Python Puppet - Chef - Ansible - Docker


Слайд 170

From scripts on a developer hard disc


Слайд 171

to professional automation


Слайд 172

Add code to Source Control


Слайд 173

Do Code Reviews for every change


Слайд 174

Write Tests


Слайд 175

Have Deployment Scripts


Слайд 176

Keep your automated systems under control


Слайд 177

Keep your automated systems under control Lots of different places


Слайд 178

Instances for automation services


Слайд 179

We use labels for better overview st co service ow ne r e tr n ce


Слайд 180

Micros <our own PaaS> Python Docker Java Go


Слайд 181

Micros Simple to create & register micros service:create <service-name> Owner Service descriptor PagerDuty Cost Centre


Слайд 182

Were are we heading?


Слайд 183

Were are we heading? better conclusions collecting more data Better customer insides


Слайд 184

Were are we heading? less time updating & searching integrated tools Faster dev feedback loops


Слайд 185

Were are we heading? deeper code analysis smarter tests Better Quality


Слайд 186

Building software Creating customer value is a is an craft Parts can be automated art Hard to automate


Слайд 187

Rise of the machines …Skynet became self aware


Слайд 188


Слайд 189

@svenpet svenpet.com/talks find slides here I’ll be back…


Слайд 190

“VW Golf TDI Clean Diesel was 2010 8983" by Mariordo Mario Roberto Duran Ortiz - Own work. Licensed under CC BY-SA 3.0 via Commons - https:// commons.wikimedia.org/wiki/ Photo Credits Backyard Series by syauqee mohamad "http:// www.flickr.com/photos/7901820@N07/6945260735" Tesla Model S by Chrishmt0423 from flickr Burnt & Abandoned Computer "http://www.flickr.com/ photos/99649389@N02/13262802714"


Слайд 191


×

HTML:





Ссылка: