Click here to load reader
Upload
lorenzo-frattini
View
145
Download
0
Embed Size (px)
Citation preview
AUTOMATING CODE REVIEWS FOR SALESFORCE APPS
LORENZO FRATTINI
ABOUT ME
LORENZO FRATTINI
▸ Not very photogenic
▸ Salesforce Certified Technical Architect
▸ 10+ years experienced in Professional Services
▸ Strong focus on Agile & DevOps
▸ Based in London, UK
▸ Creator of Clayton.io
ON TWITTER @LOFRATTINI
AS A TECHNICAL ARCHITECT, WHAT’S THE #1 THING YOU DO ON ANY PROJECT?
PUT CODE REVIEWS IN PLACE.MY ANSWER NORMALLY IS
CODE REVIEWS
BENEFITS OF CODE REVIEWS
▸ Enforce standards, promote internal consistency
▸ Make your code better
▸ Early issue detection
▸ Simple, yet very effective
▸ Slowly erode your technical debt
▸ Promote a culture in which code quality matters
CODE REVIEWS
HOW TO DO CODE REVIEWS?
▸ Use a checklist
▸ Simple Git workflow
▸ Build your feature on a branch
▸ Pull request
▸ Comments on the pull request diff
My code review checklist available at https://github.com/eroispaziali/force-code-review-checklists
CAN CODE REVIEWS BE AUTOMATED?
IDEA
AUTOMATING CODE REVIEWS
CLAYTON: IN A NUTSHELL
▸ Connects to GitHub or Bitbucket and acts as a gatekeeper to block bad code from slipping into your repository
▸ 100% cloud based, nothing to install
▸ Configure your own standards
▸ A code review is triggered every time a pull request is created/updated
▸ Review completed in seconds with pass-or-fail result
▸ Inline comments on the diff
CLAYTON.IODEMO
CLAYTON
SOME RESULTS
▸ First prototype presented at Dreamforce 16, now available to the public
▸ 27 million lines reviewed
▸ It works! The project on the right is an AppExchange product
▸ ~500,000 lines of code
▸ ~10 pull requests per day (average)
▸ 20 active developers
▸ From 7% to 1% defect density in 2 months
CLAYTON
SOME FEATURES
▸ GitHub and Bitbucket
▸ Detects and reviews Apex
▸ Support for teams
▸ Insights
▸ Historic issue distribution
▸ Track team quality of contributions, per project
▸ On the roadmap
▸ Visualforce
▸ Lightning
▸ Dynamic Code Analysis
GET INVOLVED
ARE YOU INTERESTED?
▸ Reach out on Twitter @lofrattini
▸ Try Clayton! Go on www.clayton.io and create an account
▸ Share your feedback and suggestions