{"id":5151,"date":"2018-08-19T19:14:00","date_gmt":"2018-08-19T19:14:00","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5151"},"modified":"2018-08-20T09:10:06","modified_gmt":"2018-08-20T09:10:06","slug":"how-gerrit-works","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-gerrit-works\/","title":{"rendered":"How Gerrit Works?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5178\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit.png\" alt=\"\" width=\"600\" height=\"315\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/08\/gerrit.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/08\/gerrit-300x158.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>When Gerrit is configured as the central source repository, all code changes are sent to Pending Changes for others to review and discuss. When enough reviewers have approved a code change, you can submit the change to the code base.<\/p>\n<p>In addition to the store of Pending Changes, Gerrit captures notes and comments made about each change. This enables you to review changes at your convenience or when a conversation about a change can\u2019t happen in person. In addition, notes and comments provide a history of each change (what was changed and why and who reviewed the change).<\/p>\n<p>Gerrit project is a workspace consisting of the following elements:<\/p>\n<ul>\n<li>Git repository: It is used to store the merged code base and the changes under review that have not being merged yet. Gerrit has the limitation of a single repository per project. There can also be projects without any code repository associated at all (that is, Security-only projects)<\/li>\n<li>Changes references under review: Git commit-id (expressed as SHA-1 Hexadecimal alphanumeric string) stored in the Gerrit DB and pointing to the corresponding changes stored in the Git repository. A Gerrit change is a Git commit object uploaded for review and associated to its comments and scores. It is stored in the project&#8217;s Git repository but it is not visible\/accessible from the normal Git graph of commits, even it does start from a point on the commits graph.<\/li>\n<li>Access Control Lists (ACLs): It contains the list of roles defined for the Gerrit project and the associated access permissions to the Git repository branches.<\/li>\n<li>Prolog rules: It is the set of rules that govern the Code Review process for the project. 0 Additional metadata: All the extra settings such as description, merge strategy, contributor agreements, and accessory metadata needed in order to manage the project.<\/li>\n<\/ul>\n<p><strong>We have to make and review a change through these stages in Gerrit:<\/strong><\/p>\n<ol>\n<li>Making the change.<\/li>\n<li>Creating the review.<\/li>\n<li>Reviewing the change.<\/li>\n<li>Reworking the change.<\/li>\n<li>Verifying the change.<\/li>\n<li>Submitting the change.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-architecture.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5152\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-architecture.png\" alt=\"\" width=\"1145\" height=\"553\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/08\/gerrit-architecture.png 1145w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/08\/gerrit-architecture-300x145.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/08\/gerrit-architecture-768x371.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/08\/gerrit-architecture-1024x495.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/08\/gerrit-architecture-660x319.png 660w\" sizes=\"auto, (max-width: 1145px) 100vw, 1145px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When Gerrit is configured as the central source repository, all code changes are sent to Pending Changes for others to review and discuss. When enough reviewers have approved a code&#8230; <\/p>\n","protected":false},"author":1,"featured_media":5178,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4994],"tags":[4922,945],"class_list":["post-5151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gerrit","tag-architecture","tag-gerrit"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=5151"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5151\/revisions"}],"predecessor-version":[{"id":5180,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5151\/revisions\/5180"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/5178"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=5151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=5151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=5151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}