NSDanger

 NSDanger

@ Cocoaheads Taipei 2016 October Meetup

Errata: p.3 Cocoapods should be CocoaPods. Thanks orta to point out!

771951f55ed37335f238e1a80dfda9cd?s=128

Juanito Fatas

October 13, 2016
Tweet

Transcript

  1. Cocoaheads 13.10.2016 like unit tests, but for TEAM culture !

    NS
  2. None
  3. DANGER CREATORS Felix Krause Orta Therox Artsy, Cocoapods, danger Fastlane

  4. DANGER EVANGELIST Juanito Fatas deppbot

  5. WHAT

  6. Tests for team culture

  7. FEEDBACK SYSTEM DURING CODE REVIEW

  8. FREE AND OPEN SOURCE

  9. MODERN WORKFLOW ! " CI # You created a Pull

    Request or Merge Request
  10. " CI # SCM tells CI to build MODERN WORKFLOW

    ! Source Control Management Continuous Integration
  11. " CI # Your CI runs your Build MODERN WORKFLOW

    !
  12. " CI # Human checks PR MODERN WORKFLOW ! $

  13. None
  14. " CI # DANGER checks PR POSTMODERN WORKFLOW !

  15. Reports back if anything POSTMODERN WORKFLOW

  16. " CI # Human Checks Important Things ! $ POSTMODERN

    WORKFLOW
  17. ! " CI # POSTMODERN WORKFLOW BETTER MERGED

  18. Stop saying
 "You forgot to…" in Code Review for trivial

    things
  19. HOWTO

  20. INSTALL

  21. gem "danger" INSTALL

  22. TOKEN GitHub GitLab BITBUCKET server

  23. Add SCM Token to Your CI TOKEN

  24. DANGERFILE

  25. DANGERFILE Domain Specific Language

  26. Paths for files that were added during the diff added_files

    [String] Paths for files that were removed during the diff deleted_files [String] Paths for files that changed during the diff modified_files [String] The overall lines of code added/removed in the diff lines_of_code Int The overall lines of code removed in the diff deletions Int The overall lines of code added in the diff insertions Int The log of commits inside the diff commits Git::Log Details for a specific file in this diff diff_for_file Git::Diff::DiffFile GIT
  27. The title of the Pull Request. pr_title String The body

    text of the Pull Request. pr_body String The username of the author of the Pull Request. pr_author String The labels assigned to the Pull Request. pr_labels String The base commit to which the PR is going to be merged as a parent. base_commit String The head commit to which the PR is requesting to be merged from. head_commit String The hash that represents the PR's JSON. pr_json Hash Provides access to an API client used inside Danger. Different per platform. api Octokit::Client GITHUB gitlab bitbucket
  28. Print markdown to below the table markdown (message: String, file=nil:

    String, line=nil: String) Print out a generate message on the PR message (message: String, sticky=true: Boolean, file=nil: String, line=nil: String) Specifies a problem, but not critical warn (message: String, sticky=true: Boolean, file=nil: String, line=nil: String) Declares a CI blocking error fail (message: String, sticky=true: Boolean, file=nil: String, line=nil: String) A list of all messages passed to Danger, including the markdowns. status_report Hash A list of all violations passed to Danger, we don't anticipate users of Danger needing to use this. violation_report Hash MESSAGING
  29. CI Bitrise Buildkite circleci Jenkins GitLab Drone Travis CI Semaphore

    TeamCity Surf Buildasaur
  30. CI bundle exec danger CI config file .circle.yml, .travis.yml, et

    cetera
  31. CASE

  32. Artsy OPEN SOURCE https://www.objc.io/issues/22-scale/artsy/ https://github.com/artsy/eigen https://github.com/artsy/energy https://github.com/artsy/emission https://github.com/artsy/emergence (Chinese translation)

  33. Artsy/eigen https://artsy.github.io

  34. Warn reviewers if PR is classed as Work In Progress

    Enforce CHANGELOG for big changes Enforce CHANGELOG for big changes that needs test on iPhone Fail if someone accidentally committed skipped tests Fail if changes Developer Specific files Fail if changes Analytics without tests Fail if CHANGELOG is broken Fail if Snapshots fails Warn if has unstubbed network requests Warn performance outliners in PR Artsy/eigen
  35. Warn reviewers if PR is classed as Work In Progress

    Artsy/eigen
  36. Enforce CHANGELOG for big changes Enforce CHANGELOG for big changes

    that needs test on iPhone Artsy/eigen
  37. Fail if someone accidentally committed skipped tests Artsy/eigen

  38. Fail if changes Developer Specific files Artsy/eigen

  39. Fail if changes Analytics without tests Artsy/eigen

  40. Artsy/eigen

  41. Fail if CHANGELOG is broken Artsy/eigen

  42. Fail if Snapshots fails Artsy/eigen

  43. Warn if unstubbed network requests Artsy/eigen

  44. Warn performance outliners in PR Artsy/eigen

  45. Artsy/eigen https://github.com/artsy/eigen/pull/1905

  46. Spell Check Markdown Highlight JUnit Errors Highlight Xcode build issues

    Apply Commit Rules Enforce CHANGLOGs Only let certain developers touch some files Show slow swift compilation steps Keep your Git history short highlight undocumented methods Check if the author is in an org Ensure PR summaries Ensure each PR has a JIRA ticket Ensure developers write tests Only accept PRs to a specific branch Ensure all PRs have an assignee Warn when specific libs are added Fail big PRs Add links to build artifacts Run linters on your code, highlighting per line Ensure some files are never changed Ensure some texts are never added to files Ensure coupled files are both changed Prose check files Ensure PR title Merge OK PRs automatically
  47. PLUGINS

  48. None
  49. SWIFTLINT

  50. SWIFTLINT

  51. SWIFTLINT

  52. SWIFTLINT

  53. USERS

  54. danger/danger artsy/eigen fastlane/fastlane CocoaPods/CocoaPods moya/moya jpsim/SourceKitten mozilla-mobile/firefox-ios Buffer, Soundcloud, Jazzy,

    and RxSwift PIONEERS
  55. TAKE DANGER WITH YOU

  56. JOIN THE DANGER PARTY

  57. None
  58. THANK YOU @JuanitoFatas