Slide 1

Slide 1 text

Jenkins Plugin development REX

Slide 2

Slide 2 text

@gboissinot

Slide 3

Slide 3 text

@alecharp

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Why a new plugin?

Slide 6

Slide 6 text

Client Stack C/C++ CodeSonar Jenkins

Slide 7

Slide 7 text

Client Stack C/C++ CodeSonar Jenkins

Slide 8

Slide 8 text

Client Stack C/C++ CodeSonar Jenkins codesonar- jenkins plugin

Slide 9

Slide 9 text

And the requirements are…

Slide 10

Slide 10 text

Find & fetch latest analyse for project

Slide 11

Slide 11 text

Find & fetch latest analyse for project - Parse the report to extract issues

Slide 12

Slide 12 text

Find & fetch latest analyse for project - Parse the report to extract issues - Generate graphs and code-browsing

Slide 13

Slide 13 text

Find & fetch latest analyse for project - Parse the report to extract issues - Generate graphs and code-browsing - Create issue on Jira if threshold are overstepped

Slide 14

Slide 14 text

Find & fetch latest analyse for project - Parse the report to extract issues - Generate graphs and code-browsing - Create issue on Jira if threshold are overstepped - As cheaply as possible

Slide 15

Slide 15 text

How to develop a plugin

Slide 16

Slide 16 text

How to develop a plugin NOT THE SUBJECT

Slide 17

Slide 17 text

How have we done this one?

Slide 18

Slide 18 text

wget report * Using Jira-plugin xml --> java dashboard history graph code-browsing summary issue creation **

Slide 19

Slide 19 text

wget report * Using Jira-plugin xml --> java dashboard history graph code-browsing summary issue creation ** CodeSonar API is locked Fetch a first XML to discover the URL of the XML Report

Slide 20

Slide 20 text

wget report * Using Jira-plugin xml --> java dashboard history graph code-browsing summary issue creation ** CodeSonar API is locked Fetch a first XML to discover the URL of the XML Report Possible 401 because too many simultaneous connections

Slide 21

Slide 21 text

wget report * Using Jira-plugin xml --> java dashboard history graph code-browsing summary issue creation ** CodeSonar API is locked Fetch a first XML to discover the URL of the XML Report Possible 401 because too many simultaneous connections The URL of the server can change between 2 builds

Slide 22

Slide 22 text

wget report * Using Jira-plugin xml --> java dashboard history graph code-browsing summary issue creation ** CodeSonar API is locked Fetch a first XML to discover the URL of the XML Report Possible 401 because too many simultaneous connections The URL of the server can change between 2 builds SPECIFIC TO CODESONAR

Slide 23

Slide 23 text

wget report * Using Jira-plugin xml --> java dashboard history graph code-browsing summary issue creation **

Slide 24

Slide 24 text

wget report * Using Jira-plugin xml --> java dashboard history graph code-browsing summary issue creation ** SPECIFIC TO JENKINS

Slide 25

Slide 25 text

What have we done?

Slide 26

Slide 26 text

CodeSonar plugin code calls Jira-plugin code

Slide 27

Slide 27 text

CodeSonar plugin shouldn’t be responsible to create issue on Jira server

Slide 28

Slide 28 text

Yet another reporting plugin

Slide 29

Slide 29 text

Yet another reporting plugin gets reports parse reports create graphs

Slide 30

Slide 30 text

Yet another reporting plugin as specific as the client required

Slide 31

Slide 31 text

Who does the maintenance?

Slide 32

Slide 32 text

Who make it evolves?

Slide 33

Slide 33 text

Who make it evolves? Zenika Client CodeSonar

Slide 34

Slide 34 text

Who make it evolves? Zenika Client CodeSonar knows Jenkins use Jenkins doesn’t know Jenkins (?)

Slide 35

Slide 35 text

Who make it evolves? Zenika Client CodeSonar knows Jenkins use Jenkins doesn’t know Jenkins (?) doesn’t know CodeSonar use CodeSonar knows CodeSonar

Slide 36

Slide 36 text

Who make it evolves? Zenika Client CodeSonar knows Jenkins use Jenkins doesn’t know Jenkins (?) doesn’t know CodeSonar use CodeSonar knows CodeSonar can’t follow CodeSonar evolutions buy new versions not involved in Jenkins

Slide 37

Slide 37 text

Who make it evolves? Zenika Client CodeSonar knows Jenkins use Jenkins doesn’t know Jenkins (?) doesn’t know CodeSonar use CodeSonar knows CodeSonar can’t follow CodeSonar evolutions buy new versions not involved in Jenkins do IT services has it own business sells CodeSonar

Slide 38

Slide 38 text

What should we do now?

Slide 39

Slide 39 text

Jira-plugin refactoring make it extendable

Slide 40

Slide 40 text

Jira-plugin refactoring make it extendable add trigger

Slide 41

Slide 41 text

Jira-plugin refactoring make it extendable add trigger add tokenization

Slide 42

Slide 42 text

Try to merge with other plugins

Slide 43

Slide 43 text

Try to merge with other plugins Violations plugin

Slide 44

Slide 44 text

Try to merge with other plugins Violations plugin DTKit Plugin is also a good approach

Slide 45

Slide 45 text

Environment* CCCC" Klocwork" CodeSonar" Checkstyle" Cpptest" Gnatmetric" ."."." Unified" Model" Report" Dashboard* in* Jenkins* Extrac>on" Step" Jenkins"DTKit"Plugin" GETS" REPORTS" PARSE" REPORTS" CREATE" GRAPHS" •  Add"Dashboard"(graph,"summary,"threshold,"etc)"to"the"exis>ng"DTKit"plugin" •  Add"a"genera>on/extrac>on"extension"point"to"DTKit"plugin"for"the"‘GET"Reports’"step" Parsing" Step"

Slide 46

Slide 46 text

Vert.x' EventBus' Vert.x' Libs' Event'Bus' Generic'Jenkins'Dashboard' Metrics'Plugin' Hazelcast' Get'Report' VerBcle' Parse'Report' VerBcle' A'Module/Plugin' 'by'Metric' •  Use$a$Micro+service$pla/orm$(such$as$Vert.x)$with$dedicated$metrics$module$for$ ge=ng$and$parsing$metrics$reports$ •  Enable$to$use$the$beAer$languages$and$frmks$(not$only$Java)$for$ge=ng$ and/or$reporFng$metrics$data$ •  $Jenkins$is$used$as$a$client$of$the$pla/orm$and$for$reporFng$only$ Enviro nment'

Slide 47

Slide 47 text

BUILD& BUILD& BUILD& BUILD& Component(C1( Component(C2( Component(C3( Component(Cn( ASSEMBLE& PACKAGE& DEPLOY& Build& Ar6fact& Repository& Package& Ar6fact& Repository& Deploy& Ar6fact& Repository& Unified( Model( Report( Unified( Model( Report( Unified( Model( Report( •  Use(a(specific(mechanism(for(ge:ng(the(report(and(for(a;aching(the( report((the(unfiied(model(result)(to(your(build(arAfacts( •  Report(your(metrics(on(demand( (

Slide 48

Slide 48 text

Metadata& Repository& Environment* Extrac1on& Step& && Push&Step& Outbound*Getway* Inbound*Getway* Unified& Model& Report& CCCC& Klocwork& CodeSonar& Checkstyle& Cpptest& .&.&.&

Slide 49

Slide 49 text

M" C" M" C" M" C" M" C" Binary'Metadata'Repository' $"org" $"name" $"version" $"status" $"dependencies" $"ar4facts" $"buildContext"{" """""env"vars,"etc" }" $"reportsFile"{" """xunit,"viola4ons,"""" coverage,"etc" }" "BUILD"API"REST" Mvn" Gradle" Jenkins" PROMOTION"API" Client" All"component"informa4on" stored"with"metadata" Metadata"Driven"Repository"with"Reports"

Slide 50

Slide 50 text

The end

Slide 51

Slide 51 text

Questions?