Jenkins plugin development REX

Jenkins plugin development REX

Jenkins count more than 900 plugins now. It is easy, and most of the time quick to development a new one.

We made this presentation to show that, even if it seems easy, developing a plugin should only be done if there is no other option, and the "after development" questions must be solve before the first line of code.

8254814a3136a30724cd428841f8e155?s=128

Adrien Lecharpentier

September 10, 2014
Tweet

Transcript

  1. Jenkins Plugin development REX

  2. @gboissinot

  3. @alecharp

  4. None
  5. Why a new plugin?

  6. Client Stack C/C++ CodeSonar Jenkins

  7. Client Stack C/C++ CodeSonar Jenkins

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

  9. And the requirements are…

  10. Find & fetch latest analyse for project

  11. Find & fetch latest analyse for project - Parse the

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

    report to extract issues - Generate graphs and code-browsing
  13. 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
  14. 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
  15. How to develop a plugin

  16. How to develop a plugin NOT THE SUBJECT

  17. How have we done this one?

  18. wget report * Using Jira-plugin xml --> java dashboard history

    graph code-browsing summary issue creation **
  19. 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
  20. 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
  21. 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
  22. 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
  23. wget report * Using Jira-plugin xml --> java dashboard history

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

    graph code-browsing summary issue creation ** SPECIFIC TO JENKINS
  25. What have we done?

  26. CodeSonar plugin code calls Jira-plugin code

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

    server
  28. Yet another reporting plugin

  29. Yet another reporting plugin gets reports parse reports create graphs

  30. Yet another reporting plugin as specific as the client required

  31. Who does the maintenance?

  32. Who make it evolves?

  33. Who make it evolves? Zenika Client CodeSonar

  34. Who make it evolves? Zenika Client CodeSonar knows Jenkins use

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

    Jenkins doesn’t know Jenkins (?) doesn’t know CodeSonar use CodeSonar knows CodeSonar
  36. 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
  37. 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
  38. What should we do now?

  39. Jira-plugin refactoring make it extendable

  40. Jira-plugin refactoring make it extendable add trigger

  41. Jira-plugin refactoring make it extendable add trigger add tokenization

  42. Try to merge with other plugins

  43. Try to merge with other plugins Violations plugin

  44. Try to merge with other plugins Violations plugin DTKit Plugin

    is also a good approach
  45. 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"
  46. 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'
  47. 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( (
  48. Metadata& Repository& Environment* Extrac1on& Step& && Push&Step& Outbound*Getway* Inbound*Getway* Unified&

    Model& Report& CCCC& Klocwork& CodeSonar& Checkstyle& Cpptest& .&.&.&
  49. 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"
  50. The end

  51. Questions?