Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GitLab, Journey In Time

GitLab, Journey In Time

Small retrospective of GitLab development and some conclusions why it still successful. The talk was given during Rails Girls Tamale Ghana event on May 22 2021.

tetiana chupryna

May 22, 2021
Tweet

More Decks by tetiana chupryna

Other Decks in Programming

Transcript

  1. GITLAB, JOURNEY IN TIME HOW GITLAB CHANGED OVER 10 YEARS

    AND WHAT WE CAN LEARN FROM IT Tetiana Chupryna Rails Girls Tamale Ghana 22 May 2021
  2. OVER 2 YEARS We grow from 1 team to whole

    department We have multiple teams in 2 product categories So far we developed a lot of cool features
  3. OUR TIME MACHINE GIT Distributed version control system Helps people

    to collaborate on software Essential software development instrument
  4. 2011 GITLAB Monolith Rails app Open source git-repository hosting service

    Alternative to GitHub that doesn’t have free private repos Team: 2+ people
  5. 2021 GITLAB Monolith Rails app DevOps lifecycle tool, with open

    core Provides features not only for hosting but also for CI/CD, security, project management, code review, packaging and more. Team: 1330+ people and 311+ their pets in 68 countries
  6. 09/10/2011 FIRST COMMIT `init commit` Rails 3.1, sqlite Simple rails

    structure MVC App folder - 168 f iles Frontend - haml, JQuery
  7. class MergeRequest < ActiveRecord::Bas e belongs_to :projec t belongs_to :author,

    :class_name => "User " belongs_to :assignee, :class_name => "User " has_many :notes, :as => :noteable, :dependent => :destro y attr_protected :author, :author_id, :project, :project_i d validates_presence_of :project_i d validates_presence_of :assignee_i d validates_presence_of :author_i d validates_presence_of :source_branc h validates_presence_of :target_branc h delegate :name , :email , :to => :author , :prefix => tru e delegate :name , :email , :to => :assignee , :prefix => tru e validates :title , :presence => true , :length => { :within => 0..255 } scope :opened, where(:closed => false ) scope :closed, where(:closed => true ) scope :assigned, lambda { |u| where(:assignee_id => u.id) } def new ? today? && created_at == updated_a t en d def diff s commits = project.repo.commits_between(target_branch, source_branch).map {|c| Commit.new(c) } diffs = project.repo.diff(commits.first.prev_commit.id, commits.last.id) rescue [ ] en d def last_commi t project.commit(source_branch ) en d en d
  8. APPLICATION GROWING Re f ined project structure Workers - for

    background jobs Services - tasks extracted from models that violates single responsibility principle Contexts - extraction of logic from controllers (outdated) Observers - extraction of callback logic (outdated)
  9. YEAR 2016 MergeRequest model - 874 lines app folder -

    2222 f iles Policies - check permissions Finders - heavy database searches Validators - model validations
  10. 22/05/2021 VERSION 13.12 Rails monolith running on Rails 6.0.3.6 Some

    operations are extracted to separate Go services New entities: enums, presenters, replicators, serialisers, uploads
  11. 13.12 NOW Code separated by enterprise and core versions All

    entities are namespace MergeRequest model - 1959 lines app folder - 13183 f iles
  12. DOG - FOODING GitLab is hosted on GitLab.com We scan

    it with our security features We use CI/CD We create issues on GitLab.com We store our containers with our features