SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Gerrit
                                        Daegeun Kim
                              (dani.kim@geekple.com)




                              1
Thursday,	 October	 20,
Gerrit



                       • A Code Review System based on JGit
                       • Open source (Apache 2 License)



                                          2
Thursday,	 October	 20,
Review
                                          개발            디버그




                  Pre-commit Review



                                      0        25        50   75   100



                                                    3
Thursday,	 October	 20,
Review
                                          개발            디버그




                  Pre-commit Review



                                      0        25        50   75   100



                                                    4
Thursday,	 October	 20,
Review
                                          개발            디버그




                  Pre-commit Review



                                      0        25        50   75   100



                                                    5
Thursday,	 October	 20,
Review
                                          개발            디버그




                  Pre-commit Review



                                      0        25        50   75   100



                                                    6
Thursday,	 October	 20,
Git standalone


                                                            pull/push
                            Working   commit
                             Tree


                                               Local Repo               Remote Repo




                                                  7
Thursday,	 October	 20,
Git and Gerrit
                                                                                      Remote Repo




                                                                           tch
                                                                p   ull/fe

                            Working    commit
                             Tree                                                             merge
                                                             pus
                                                                h fo
                                                Local Repo             r re
                                                                               view




                                                                                        Gerrit




                                                      8
Thursday,	 October	 20,
Git, Gerrit and CI
                                                                                     Remote Repo




                                                                          t  ch
                                                               p   ull/fe

                            Working   commit
                             Tree                                                            merge
                                                            pus
                                                               h fo
                                               Local Repo             r re
                                                                              view

                                                                         h
                                                                    fetc




                                                                         fy
                                                                    veri               Gerrit




                                                     9
Thursday,	 October	 20,
Request for Review
                                                                                     Remote Repo




                                                                               tch
                                                                    p   ull/fe


         •       Implementing a new feature                                                  merge
                                                               pus
                                                                  h fo
         •       Committing them to the repo
                                                    Local Repo         r re
                                                                            view


         •       Uploading changes to Gerrit



                                                                                       Gerrit




                                               10
Thursday,	 October	 20,
Uploading changes
                                 (Simple)

                    $ git init
                    $ git clone ssh://[user]@hostname:port/[project]
                    ...
                    $ git push origin HEAD:refs/for/master
                    ...




                                              11
Thursday,	 October	 20,
Uploading changes
                                  (Advanced)
                    $ git push [alias] HEAD:refs/for/[branch]
                    $ git push 
                            ssh://[user]@hostname:port/[project] 
                            HEAD:refs/for/[branch]
                    $ git push [alias] HEAD~1:refs/for/[branch]
                    $ git push [alias] [MD5]:refs/for/[branch]
                    or
                    $ git config remote.[alias].push refs/head/*:refs/for/*
                    $ git push [alias]


                                                12
Thursday,	 October	 20,
Adding Reviewers




                                               Add Reviewer




                                   13
Thursday,	 October	 20,
Uploading/Adding Reviewers
                                    (Advanced)

                    $ git push [alias] --receive-pack=‘git receive-pack 
                           --reviewer [email 1] --reviewer [email 2] 
                             --cc [email 3] --cc [email 4]‘ 
                             HEAD:refs/for/[branch]
                    or
                    $ git config remote.[alias].receivepack 
                             ‘git receive-pack --reviewer [email 1] 
                              --cc [email 2]’
                    $ git push [alias] HEAD:refs/for/[branch]


                                                 14
Thursday,	 October	 20,
Review and Verify
                                                                Remote Repo




                                              a. 1
                                                     fetc
                                                          h
                                                                        merge

                                              a.2
                                  Reviewers         revi
                                                           ew

                                                          h
                                                  .1 fetc
                                              b



                                                          fy
                                                     veri
                                              b   .2              Gerrit




                                        15
Thursday,	 October	 20,
Review
                                                                             Remote Repo




                                                           a. 1
                                                                  fetc
                                                                       h
                                                                                     merge

         •       Fetching the changes
                                                           a.2
                                                                 revi
                                               Reviewers                ew

         •       Code review!




                                                                               Gerrit




                                          16
Thursday,	 October	 20,
Fetching the changes

                                                   copy




                                     17
Thursday,	 October	 20,
Fetching the changes

                    $ git fetch http://hostname:port/p/[project] 
                         refs/changes/[last two numbers of change id]/
                         [change id]/[patch id]
                    $ git checkout FETCH_HEAD
                    $ git show HEAD


                  ex)
                   $ git fetch http://reviews.geekple.com/p/memcached 
                            refs/changes/40/40/2


                                                18
Thursday,	 October	 20,
Review
                                    (Advanced)


                    $ ssh -p [port] [user]@[hostname] gerrit review 
                           --code-review=+1 
                            --project=[project] 
                            [commit or change,patch]




                                              19
Thursday,	 October	 20,
Verify
                                                                      Remote Repo




                                                                              merge

         •       -1 when the build fails.


         •       +1 when it passes.
                                                            fetc
                                                                 h
                                                     b   .1




                                                                 fy
                                                            veri
                                                     b   .2             Gerrit




                                              20
Thursday,	 October	 20,
Verify
                                    (Advanced)


                    $ ssh -p [port] [user]@[hostname] gerrit review 
                           --verified=+1 
                            --project=[project] 
                            [commit or change,patch]




                                              21
Thursday,	 October	 20,
Q&A


                             22
Thursday,	 October	 20,

Contenu connexe

En vedette

BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 

En vedette (7)

Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
Kubernetes on GCP
Kubernetes on GCPKubernetes on GCP
Kubernetes on GCP
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
Gerrit Code Review
Gerrit Code ReviewGerrit Code Review
Gerrit Code Review
 

Dernier

Dernier (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Gerrit

  • 1. Gerrit Daegeun Kim (dani.kim@geekple.com) 1 Thursday, October 20,
  • 2. Gerrit • A Code Review System based on JGit • Open source (Apache 2 License) 2 Thursday, October 20,
  • 3. Review 개발 디버그 Pre-commit Review 0 25 50 75 100 3 Thursday, October 20,
  • 4. Review 개발 디버그 Pre-commit Review 0 25 50 75 100 4 Thursday, October 20,
  • 5. Review 개발 디버그 Pre-commit Review 0 25 50 75 100 5 Thursday, October 20,
  • 6. Review 개발 디버그 Pre-commit Review 0 25 50 75 100 6 Thursday, October 20,
  • 7. Git standalone pull/push Working commit Tree Local Repo Remote Repo 7 Thursday, October 20,
  • 8. Git and Gerrit Remote Repo tch p ull/fe Working commit Tree merge pus h fo Local Repo r re view Gerrit 8 Thursday, October 20,
  • 9. Git, Gerrit and CI Remote Repo t ch p ull/fe Working commit Tree merge pus h fo Local Repo r re view h fetc fy veri Gerrit 9 Thursday, October 20,
  • 10. Request for Review Remote Repo tch p ull/fe • Implementing a new feature merge pus h fo • Committing them to the repo Local Repo r re view • Uploading changes to Gerrit Gerrit 10 Thursday, October 20,
  • 11. Uploading changes (Simple) $ git init $ git clone ssh://[user]@hostname:port/[project] ... $ git push origin HEAD:refs/for/master ... 11 Thursday, October 20,
  • 12. Uploading changes (Advanced) $ git push [alias] HEAD:refs/for/[branch] $ git push ssh://[user]@hostname:port/[project] HEAD:refs/for/[branch] $ git push [alias] HEAD~1:refs/for/[branch] $ git push [alias] [MD5]:refs/for/[branch] or $ git config remote.[alias].push refs/head/*:refs/for/* $ git push [alias] 12 Thursday, October 20,
  • 13. Adding Reviewers Add Reviewer 13 Thursday, October 20,
  • 14. Uploading/Adding Reviewers (Advanced) $ git push [alias] --receive-pack=‘git receive-pack --reviewer [email 1] --reviewer [email 2] --cc [email 3] --cc [email 4]‘ HEAD:refs/for/[branch] or $ git config remote.[alias].receivepack ‘git receive-pack --reviewer [email 1] --cc [email 2]’ $ git push [alias] HEAD:refs/for/[branch] 14 Thursday, October 20,
  • 15. Review and Verify Remote Repo a. 1 fetc h merge a.2 Reviewers revi ew h .1 fetc b fy veri b .2 Gerrit 15 Thursday, October 20,
  • 16. Review Remote Repo a. 1 fetc h merge • Fetching the changes a.2 revi Reviewers ew • Code review! Gerrit 16 Thursday, October 20,
  • 17. Fetching the changes copy 17 Thursday, October 20,
  • 18. Fetching the changes $ git fetch http://hostname:port/p/[project] refs/changes/[last two numbers of change id]/ [change id]/[patch id] $ git checkout FETCH_HEAD $ git show HEAD ex) $ git fetch http://reviews.geekple.com/p/memcached refs/changes/40/40/2 18 Thursday, October 20,
  • 19. Review (Advanced) $ ssh -p [port] [user]@[hostname] gerrit review --code-review=+1 --project=[project] [commit or change,patch] 19 Thursday, October 20,
  • 20. Verify Remote Repo merge • -1 when the build fails. • +1 when it passes. fetc h b .1 fy veri b .2 Gerrit 20 Thursday, October 20,
  • 21. Verify (Advanced) $ ssh -p [port] [user]@[hostname] gerrit review --verified=+1 --project=[project] [commit or change,patch] 21 Thursday, October 20,
  • 22. Q&A 22 Thursday, October 20,