1. 08 12月, 2018 1 次提交
    • Z
      Allow public forks to be deduplicated · 896c0bdb
      Zeger-Jan van de Weg 提交于
      When a project is forked, the new repository used to be a deep copy of everything
      stored on disk by leveraging `git clone`. This works well, and makes isolation
      between repository easy. However, the clone is at the start 100% the same as the
      origin repository. And in the case of the objects in the object directory, this
      is almost always going to be a lot of duplication.
      
      Object Pools are a way to create a third repository that essentially only exists
      for its 'objects' subdirectory. This third repository's object directory will be
      set as alternate location for objects. This means that in the case an object is
      missing in the local repository, git will look in another location. This other
      location is the object pool repository.
      
      When Git performs garbage collection, it's smart enough to check the
      alternate location. When objects are duplicated, it will allow git to
      throw one copy away. This copy is on the local repository, where to pool
      remains as is.
      
      These pools have an origin location, which for now will always be a
      repository that itself is not a fork. When the root of a fork network is
      forked by a user, the fork still clones the full repository. Async, the
      pool repository will be created.
      
      Either one of these processes can be done earlier than the other. To
      handle this race condition, the Join ObjectPool operation is
      idempotent. Given its idempotent, we can schedule it twice, with the
      same effect.
      
      To accommodate the holding of state two migrations have been added.
      1. Added a state column to the pool_repositories column. This column is
      managed by the state machine, allowing for hooks on transitions.
      2. pool_repositories now has a source_project_id. This column in
      convenient to have for multiple reasons: it has a unique index allowing
      the database to handle race conditions when creating a new record. Also,
      it's nice to know who the host is. As that's a short link to the fork
      networks root.
      
      Object pools are only available for public project, which use hashed
      storage and when forking from the root of the fork network. (That is,
      the project being forked from itself isn't a fork)
      
      In this commit message I use both ObjectPool and Pool repositories,
      which are alike, but different from each other. ObjectPool refers to
      whatever is on the disk stored and managed by Gitaly. PoolRepository is
      the record in the database.
      896c0bdb
  2. 19 10月, 2018 1 次提交
    • B
      Remove the `ForkedProjectLink` model · f3fba178
      Bob Van Landuyt 提交于
      This removes the `ForkedProjectLink` model that has been replaced by
      the `ForkNetworkMember` and `ForkNetwork` combination. All existing
      relations have been adjusted to use these new models.
      
      The `forked_project_link` table has been dropped.
      
      The "Forks" count on the admin dashboard has been updated to count all
      `ForkNetworkMember` rows and deduct the number of `ForkNetwork`
      rows. This is because now the "root-project" of a fork network also
      has a `ForkNetworkMember` row. This count could become inaccurate when
      the root of a fork network is deleted.
      f3fba178
  3. 20 8月, 2018 1 次提交
  4. 09 7月, 2018 1 次提交
  5. 07 6月, 2018 1 次提交
  6. 25 4月, 2018 1 次提交
  7. 22 3月, 2018 1 次提交
  8. 14 3月, 2018 1 次提交
    • Z
      Change Gitlab::Shell#add_namespace to #create_namespace · 77f0906e
      Zeger-Jan van de Weg 提交于
      Prior to this change, this method was called add_namespace, which broke
      the CRUD convention and made it harder to grep for what I was looking
      for. Given the change was a find and replace kind of fix, this was
      changed without opening an issue and on another feature branch.
      
      If more dynamic calls are made to add_namespace, these could've been
      missed which might lead to incorrect bahaviour. However, going through
      the commit log it seems thats not the case.
      77f0906e
  9. 29 12月, 2017 1 次提交
  10. 07 12月, 2017 1 次提交
  11. 07 10月, 2017 2 次提交
  12. 30 9月, 2017 1 次提交
  13. 26 8月, 2017 1 次提交
  14. 15 8月, 2017 1 次提交
    • Y
      Cache the number of forks of a project · aef9f1eb
      Yorick Peterse 提交于
      The number of forks of a project doesn't change very frequently and
      running a COUNT(*) every time this information is requested can be quite
      expensive. We also end up running such a COUNT(*) query at least twice
      on the homepage of a project.
      
      By caching this data and refreshing it when necessary we can reduce
      project homepage loading times by around 60 milliseconds (based on the
      timings of https://gitlab.com/gitlab-org/gitlab-ce).
      aef9f1eb
  15. 27 7月, 2017 1 次提交
  16. 06 6月, 2017 1 次提交
  17. 28 3月, 2017 1 次提交
  18. 25 3月, 2017 1 次提交
  19. 03 1月, 2017 1 次提交
  20. 27 9月, 2016 1 次提交
    • N
      Enforce the fork_project permission in Projects::CreateService · 3ed80a01
      Nick Thomas 提交于
      Projects::ForkService delegates to this service almost entirely, but needed
      one small change so it would propagate create errors correctly.
      
      CreateService#execute needs significant refactoring; it is now right at the
      complexity limit set by Rubocop. I avoided doing so in this commit to keep the
      diff as small as possible.
      
      Several tests depend on the insecure behaviour of ForkService, so fi them up at
      the same time.
      3ed80a01
  21. 09 8月, 2016 1 次提交
  22. 03 6月, 2016 2 次提交
  23. 25 5月, 2016 1 次提交
  24. 09 12月, 2015 1 次提交
  25. 18 11月, 2015 1 次提交
  26. 13 11月, 2015 1 次提交
  27. 02 10月, 2015 2 次提交
  28. 19 9月, 2015 1 次提交
  29. 11 9月, 2015 1 次提交
  30. 30 7月, 2015 1 次提交
  31. 23 6月, 2015 1 次提交
  32. 25 4月, 2015 1 次提交
  33. 07 4月, 2015 1 次提交
  34. 13 2月, 2015 1 次提交
  35. 03 10月, 2014 1 次提交
  36. 25 8月, 2014 1 次提交
  37. 17 1月, 2014 1 次提交