2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 1/52
Assisted Code Review with
source{d} Lookout
Vadim Markovtsev
Machine Learning for
Large Scale Code Analysis
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 2/52
Plan
Origins
What is Lookout?
SDK
From scratch: typo correction
1.
2.
3.
4.
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 3/52
Origins
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 4/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 5/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 6/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 7/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 8/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 9/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 10/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 11/52
Many efforts
target boring
stuff
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 12/52
Boring means
automatable
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 13/52
Automatable
≠ unattended
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 14/52
When to help?
While you type = IDE
While you check = CI
While you review = PR
Periodically, asynchronously = cron
•
•
•
•
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 15/52
IDE
Instant feedback
Rich information
Rich UI
Instant feedback
Many different IDEs and languages
+
+
+
–
–
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 16/52
CI
Part of the workflow
More time to run
No UI
Must not be wrong
Longer feedback loop
+
+
–
–
–
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 17/52
PR reviews
Part of the workflow
More time to run
UI
Should not be wrong
Longer feedback loop
+
+
+
–
–
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 18/52
cron
Plenty of time to run
Outside of the workflow
No UI
Longest feedback loop
+
–
–
–
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 19/52
Comparison
∈∈ workflow UI Feedback Rich info FP requirements
IDE ✓ ✓✓ instant ✓ low
CI ✓ ✗ minutes ✗ 0
PR ✓ ✓ minutes ✗ lowest
cron ✗ ✗ hours ✗ low
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 20/52
When to help?
While you type = IDE
While you check = CI
While you review = PR ←
Periodically, asynchronously
•
•
→
•
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 21/52
Welcome to the Codacy Blog
Insights for software builders
Subscribe
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 22/52
What is
Lookout?
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 23/52
Goals
Assisted code review platform
Tight git/GitHub integration
Analyzed language agnostic
Implementation language agnostic
Batteries included
•
•
•
•
•
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 24/52
Architecture
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 25/52
Push event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 26/52
Push event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 27/52
Push event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 28/52
Push event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 29/52
Push event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 30/52
Push event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 31/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 32/52
Push event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 33/52
PR event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 34/52
PR event
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 35/52
docs.sourced.tech/lookout
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 36/52
SDK
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 37/52
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 38/52
src-d/lookout-sdk
Single source of gRPC definitions
Low-level API: Go, Python
Low-level examples
•
•
•
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 39/52
src-d/lookout-sdk-ml
High-level Python API
Stateful analyzers
Integrated with source{d} ml ecosystem
•
•
•
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 40/52
Rule of
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 41/52
High-level API
class MyAnalyzer(Analyzer):
@classmethod
def train(cls, ...) -> AnalyzerModel:
# ...
def analyze(self, ...) -> [Comment]:
# do something with self.model
01.
02.
03.
04.
05.06.
07.
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 42/52
Train
@with_uasts_and_contents
def train(cls,
ptr: ReferencePointer,
config: Dict[str, Any],
data_service: DataService,
files: Iterable[File]
) -> AnalyzerModel:
01.
02.
03.
04.
05.
06.
07.
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 43/52
Analyze
@with_changed_uasts_and_contents
def analyze(self,
ptr_from: ReferencePointer,
ptr_to: ReferencePointer,
data_service: DataService,
changes: Iterable[Change]
) -> [Comment]:
01.
02.
03.
04.
05.
06.
07.
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 44/52
Behind the scenes
gRPC servers and clients
Pooling and threading
Database of trained models
Caches
Logging
Metrics
•
•
•
•
•
•
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 45/52
Hands on
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 46/52
Objective
class Packfile:
Review
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 47/52
Objective
def read_packfile(...):
# ...
class Packfile:
Review
01.
02.
03.
04.
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 48/52
Objective
def read_packfile(...):
# ...
class Packfle:
Review
01.
02.
03.
04.
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 49/52
Steps
Install lookout-sdk-ml and autocorrect
Write typos.py
Fork a repo, create a PR
Generate a new GitHub Personal Access Token
Run our analyzer
1.
2.
3.
4.
5.
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 50/52
Summary
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 51/52
Summary
source{d} decided to build products for assisted code review
Lookout is a great platform for assisted code review
Writing new analyzers is easy and fun
•
•
•
2/4/2019 Assisted Code Review with source{d} Lookout
http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 52/52
Thank you
 src-d/lookout
 src-d/lookout-sdk-ml
 blog.sourced.tech
 medium.com/sourcedtech
 go.sourced.tech/newsletter
 sourcedtech
 vadimlearning bit.ly/2H8U5ra

More Related Content

PDF
Python Visual Studio | Edureka
PPTX
Data Security and the Hard Outer Shell
PDF
Getting started with Go - Florin Patan - Codemotion Rome 2017
PPTX
Concourse in the Real World: A Case Study in CI/CD and DevOps
PPTX
Crossing the CI/CD/DevOps Chasm
PDF
Multilanguage pipelines with Jenkins, Docker and Kubernetes (DevOpsDays Riga ...
PDF
Hands on React Native: From Zero to Hero
PDF
Next ’19 的 Istio 場次 重點摘要
Python Visual Studio | Edureka
Data Security and the Hard Outer Shell
Getting started with Go - Florin Patan - Codemotion Rome 2017
Concourse in the Real World: A Case Study in CI/CD and DevOps
Crossing the CI/CD/DevOps Chasm
Multilanguage pipelines with Jenkins, Docker and Kubernetes (DevOpsDays Riga ...
Hands on React Native: From Zero to Hero
Next ’19 的 Istio 場次 重點摘要

What's hot (7)

PDF
Introduction to Go
PDF
Flutter vs React Native | Edureka
PPTX
Breizhcamp: Créer un bot, pas si simple. Faisons le point.
PPTX
Flutter festival ppt
PDF
Open Source In Enterprises Apache2009 Beijing Jack Cai
PDF
DEEP: a user success story
PDF
Introduction to License Compliance and My research (D. German)
Introduction to Go
Flutter vs React Native | Edureka
Breizhcamp: Créer un bot, pas si simple. Faisons le point.
Flutter festival ppt
Open Source In Enterprises Apache2009 Beijing Jack Cai
DEEP: a user success story
Introduction to License Compliance and My research (D. German)
Ad

Similar to Assisted code review with source{d} lookout (20)

PDF
How to get trusted AI in your favorite IDE
PDF
How to get trusted AI in your favorite IDE
PPTX
Spring Projects Infrastructure
PPTX
Spring Projects Infrastructure
PDF
20250403-trusted-ai-favorite-ide-javaland.pdf
PDF
CloudNativeAalborg2023_Jan.pdf
PDF
Easing IoT Development for Novice Programmers Through Code Recipes
PDF
The Software Developer’s Guide to Open Source Hardware
PDF
How to get trusted AI in your favorite IDE
PDF
Open Developer Platform: What Is It and Why Should I Care? Maurizio Pillitu
PPTX
No More Dockerfiles! Buildpacks to Help You Ship Your Image!
PPTX
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
PPTX
API Documentation Workshop tcworld India 2015
PDF
Enterprise DevOps Series: Using VS Code & Zowe
PDF
Golang skills pre-session
PDF
C language in our world 2019
PDF
CI/CD with OCP
PDF
Crossing the low-code and pro-code chasm: a platform approach
PDF
INTERFACE, by apidays - Crossing the low-code and pro-code chasm: a platform...
PDF
Digital Fabrication Studio v.0.2: Version Control System: Files
How to get trusted AI in your favorite IDE
How to get trusted AI in your favorite IDE
Spring Projects Infrastructure
Spring Projects Infrastructure
20250403-trusted-ai-favorite-ide-javaland.pdf
CloudNativeAalborg2023_Jan.pdf
Easing IoT Development for Novice Programmers Through Code Recipes
The Software Developer’s Guide to Open Source Hardware
How to get trusted AI in your favorite IDE
Open Developer Platform: What Is It and Why Should I Care? Maurizio Pillitu
No More Dockerfiles! Buildpacks to Help You Ship Your Image!
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
API Documentation Workshop tcworld India 2015
Enterprise DevOps Series: Using VS Code & Zowe
Golang skills pre-session
C language in our world 2019
CI/CD with OCP
Crossing the low-code and pro-code chasm: a platform approach
INTERFACE, by apidays - Crossing the low-code and pro-code chasm: a platform...
Digital Fabrication Studio v.0.2: Version Control System: Files
Ad

More from source{d} (15)

PDF
Overton, Apple Flavored ML
PDF
Unlocking Engineering Observability with advanced IT analytics
PDF
What's new in the latest source{d} releases!
PDF
Code as Data workshop: Using source{d} Engine to extract insights from git re...
PPTX
Gitbase, SQL interface to Git repositories
PPTX
Deduplication on large amounts of code
PDF
Machine Learning on Code - SF meetup
PDF
Inextricably linked reproducibility and productivity in data science and ai ...
PDF
source{d} Engine - your code as data
PDF
Introduction to the source{d} Stack
PDF
source{d} Engine: Exploring git repos with SQL
PDF
Introduction to source{d} Engine and source{d} Lookout
PDF
Machine learning on Go Code
PPTX
Improving go-git performance
PDF
Machine learning on source code
Overton, Apple Flavored ML
Unlocking Engineering Observability with advanced IT analytics
What's new in the latest source{d} releases!
Code as Data workshop: Using source{d} Engine to extract insights from git re...
Gitbase, SQL interface to Git repositories
Deduplication on large amounts of code
Machine Learning on Code - SF meetup
Inextricably linked reproducibility and productivity in data science and ai ...
source{d} Engine - your code as data
Introduction to the source{d} Stack
source{d} Engine: Exploring git repos with SQL
Introduction to source{d} Engine and source{d} Lookout
Machine learning on Go Code
Improving go-git performance
Machine learning on source code

Recently uploaded (20)

DOCX
search engine optimization ppt fir known well about this
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Modernising the Digital Integration Hub
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
The various Industrial Revolutions .pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PPTX
Configure Apache Mutual Authentication
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PPT
Geologic Time for studying geology for geologist
PDF
Five Habits of High-Impact Board Members
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
search engine optimization ppt fir known well about this
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Modernising the Digital Integration Hub
Enhancing emotion recognition model for a student engagement use case through...
UiPath Agentic Automation session 1: RPA to Agents
Taming the Chaos: How to Turn Unstructured Data into Decisions
The various Industrial Revolutions .pptx
NewMind AI Weekly Chronicles – August ’25 Week III
Developing a website for English-speaking practice to English as a foreign la...
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Module 1.ppt Iot fundamentals and Architecture
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
OpenACC and Open Hackathons Monthly Highlights July 2025
Configure Apache Mutual Authentication
CloudStack 4.21: First Look Webinar slides
Convolutional neural network based encoder-decoder for efficient real-time ob...
Geologic Time for studying geology for geologist
Five Habits of High-Impact Board Members
A proposed approach for plagiarism detection in Myanmar Unicode text
Abstractive summarization using multilingual text-to-text transfer transforme...

Assisted code review with source{d} lookout

  • 1. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 1/52 Assisted Code Review with source{d} Lookout Vadim Markovtsev Machine Learning for Large Scale Code Analysis
  • 2. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 2/52 Plan Origins What is Lookout? SDK From scratch: typo correction 1. 2. 3. 4.
  • 3. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 3/52 Origins
  • 4. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 4/52
  • 5. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 5/52
  • 6. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 6/52
  • 7. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 7/52
  • 8. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 8/52
  • 9. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 9/52
  • 10. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 10/52
  • 11. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 11/52 Many efforts target boring stuff
  • 12. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 12/52 Boring means automatable
  • 13. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 13/52 Automatable ≠ unattended
  • 14. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 14/52 When to help? While you type = IDE While you check = CI While you review = PR Periodically, asynchronously = cron • • • •
  • 15. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 15/52 IDE Instant feedback Rich information Rich UI Instant feedback Many different IDEs and languages + + + – –
  • 16. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 16/52 CI Part of the workflow More time to run No UI Must not be wrong Longer feedback loop + + – – –
  • 17. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 17/52 PR reviews Part of the workflow More time to run UI Should not be wrong Longer feedback loop + + + – –
  • 18. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 18/52 cron Plenty of time to run Outside of the workflow No UI Longest feedback loop + – – –
  • 19. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 19/52 Comparison ∈∈ workflow UI Feedback Rich info FP requirements IDE ✓ ✓✓ instant ✓ low CI ✓ ✗ minutes ✗ 0 PR ✓ ✓ minutes ✗ lowest cron ✗ ✗ hours ✗ low
  • 20. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 20/52 When to help? While you type = IDE While you check = CI While you review = PR ← Periodically, asynchronously • • → •
  • 21. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 21/52 Welcome to the Codacy Blog Insights for software builders Subscribe
  • 22. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 22/52 What is Lookout?
  • 23. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 23/52 Goals Assisted code review platform Tight git/GitHub integration Analyzed language agnostic Implementation language agnostic Batteries included • • • • •
  • 24. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 24/52 Architecture
  • 25. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 25/52 Push event
  • 26. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 26/52 Push event
  • 27. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 27/52 Push event
  • 28. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 28/52 Push event
  • 29. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 29/52 Push event
  • 30. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 30/52 Push event
  • 31. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 31/52
  • 32. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 32/52 Push event
  • 33. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 33/52 PR event
  • 34. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 34/52 PR event
  • 35. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 35/52 docs.sourced.tech/lookout
  • 36. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 36/52 SDK
  • 37. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 37/52
  • 38. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 38/52 src-d/lookout-sdk Single source of gRPC definitions Low-level API: Go, Python Low-level examples • • •
  • 39. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 39/52 src-d/lookout-sdk-ml High-level Python API Stateful analyzers Integrated with source{d} ml ecosystem • • •
  • 40. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 40/52 Rule of
  • 41. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 41/52 High-level API class MyAnalyzer(Analyzer): @classmethod def train(cls, ...) -> AnalyzerModel: # ... def analyze(self, ...) -> [Comment]: # do something with self.model 01. 02. 03. 04. 05.06. 07.
  • 42. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 42/52 Train @with_uasts_and_contents def train(cls, ptr: ReferencePointer, config: Dict[str, Any], data_service: DataService, files: Iterable[File] ) -> AnalyzerModel: 01. 02. 03. 04. 05. 06. 07.
  • 43. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 43/52 Analyze @with_changed_uasts_and_contents def analyze(self, ptr_from: ReferencePointer, ptr_to: ReferencePointer, data_service: DataService, changes: Iterable[Change] ) -> [Comment]: 01. 02. 03. 04. 05. 06. 07.
  • 44. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 44/52 Behind the scenes gRPC servers and clients Pooling and threading Database of trained models Caches Logging Metrics • • • • • •
  • 45. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 45/52 Hands on
  • 46. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 46/52 Objective class Packfile: Review
  • 47. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 47/52 Objective def read_packfile(...): # ... class Packfile: Review 01. 02. 03. 04.
  • 48. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 48/52 Objective def read_packfile(...): # ... class Packfle: Review 01. 02. 03. 04.
  • 49. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 49/52 Steps Install lookout-sdk-ml and autocorrect Write typos.py Fork a repo, create a PR Generate a new GitHub Personal Access Token Run our analyzer 1. 2. 3. 4. 5.
  • 50. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 50/52 Summary
  • 51. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 51/52 Summary source{d} decided to build products for assisted code review Lookout is a great platform for assisted code review Writing new analyzers is easy and fun • • •
  • 52. 2/4/2019 Assisted Code Review with source{d} Lookout http://vmarkovtsev.github.io/mloncode-meetup-2019-webinar/ 52/52 Thank you  src-d/lookout  src-d/lookout-sdk-ml  blog.sourced.tech  medium.com/sourcedtech  go.sourced.tech/newsletter  sourcedtech  vadimlearning bit.ly/2H8U5ra