1. 18 6月, 2019 1 次提交
  2. 26 1月, 2019 1 次提交
  3. 22 1月, 2019 2 次提交
    • G
      Refactored AfterRenameService to reduce coupling · d391dfb4
      Gabriel Mazetto 提交于
      We still rely on the Dirty API for project rename (before/after) values,
      but we don't access the dirty api from the service class anymore.
      
      The previous value is now part of the initialization, which makes it
      easier to test and the behavior is clearer.
      
      The same was done with the `rename_repo` on the Storage classes, we now
      provide before and after values as part of the method signature.
      d391dfb4
    • G
      Fixed legacy storage renaming code · 7a7948e6
      Gabriel Mazetto 提交于
      During a previous refactor on project model, code related to the
      hashed storage was extracted into AfterRenameService, see
      4b9c17f1.
      
      The "path_before" was changed from using `previous_changes['path']` to
      `path_was`. They are not equivalent. `path_was` exists reliably only
      *before* persisting to the database. After database persistence is
      confirmed, the value is moved to `previous_changes[:attribute_name]`.
      
      Because the repository/attachments rename or storage upgrade happens
      after it was persisted to the database, we were in fact not informing
      the right parameters (and therefore not doing what it was supposed to).
      7a7948e6
  4. 22 12月, 2018 1 次提交
  5. 22 10月, 2018 1 次提交
    • Y
      Move Project#rename_repo to a service class · 4b9c17f1
      Yorick Peterse 提交于
      This moves the logic of Project#rename_repo and all methods _only_ used
      by this method into a new service class: Projects::AfterRenameService.
      By moving this code into a separate service class we can more easily
      refactor it, and we also get rid of some RuboCop "disable" statements
      automatically.
      
      During the refactoring of this code, I removed most of the explicit
      logging using Gitlab::AppLogger. The data that was logged would not be
      useful when debugging renaming issues, as it does not add any value on
      top of data provided by users.
      
      I also removed a variety of comments that either mentioned something the
      code does in literal form, or contained various grammatical errors.
      Instead we now resort to more clearly named methods, removing the need
      for code comments.
      
      This method was chosen based on analysis in
      https://gitlab.com/gitlab-org/release/framework/issues/28. In this issue
      we determined this method has seen a total of 293 lines being changed in
      it. We also noticed that RuboCop determined the ABC size
      (https://www.softwarerenovation.com/ABCMetric.pdf) was too great.
      4b9c17f1