1. 06 Mar, 2017 4 commits
  2. 03 Mar, 2017 2 commits
  3. 02 Mar, 2017 6 commits
  4. 01 Mar, 2017 7 commits
  5. 28 Feb, 2017 4 commits
  6. 27 Feb, 2017 1 commit
  7. 24 Feb, 2017 13 commits
    • Douwe Maan's avatar
      Fix spec · 40f546fa9da0
      Douwe Maan authored
    • Douwe Maan's avatar
      Add newline · 2275030a0c53
      Douwe Maan authored
    • Sean McGivern's avatar
      Only create unmergeable todos once · 18d882330379
      Sean McGivern authored
      Previously, we created an unmergeable todo when a merge request:
      1. Had merge when pipeline succeeds set.
      2. Became unmergeable.
      However, when merge when pipeline succeeds fails due to unmergeability,
      the flag isn't actually removed. And a merge request can become
      unmergeable multiple times, as every time the target branch is updated
      we need to re-check the mergeable status. This means that if the todo
      was marked done, and the MR was checked again, a new todo would be
      created for the same event.
      Instead of checking this, we should create the todo from the service
      responsible for merging when the pipeline succeeds. That way the todo is
      guaranteed to only be created when we care about it.
    • Douwe Maan's avatar
      Raise error when no content is provided · cfc12c70487f
      Douwe Maan authored
    • Douwe Maan's avatar
      Address review · fd1643ec3d0b
      Douwe Maan authored
    • Douwe Maan's avatar
    • Douwe Maan's avatar
    • Timothy Andrew's avatar
      Don't allow deleting a ghost user. · 5bd05d6328c4
      Timothy Andrew authored
      - Add a `destroy_user` ability. This didn't exist before, and was implicit in
        other abilities (only admins could access the admin area, so only they could
        destroy all users; a user can only access their own account page, and so can
        destroy only themselves).
      - Grant this ability to admins, and when the current user is trying to destroy
        themselves. Disallow destroying ghost users in all cases.
      - Modify the `Users::DestroyService` to check this ability. Also check it in
        views to decide whether or not to show the "Delete User" button.
      - Add a short summary of the Ghost User to the bio.
    • Timothy Andrew's avatar
      Implement final review comments from @DouweM and @rymai · 3bd3d6c6cc82
      Timothy Andrew authored
      - Have `Uniquify` take a block instead of a Proc/function. This is more
        idiomatic than passing around a function in Ruby.
      - Block a user before moving their issues to the ghost user. This avoids a data
        race where an issue is created after the issues are migrated to the ghost user,
        and before the destroy takes place.
      - No need to migrate issues (to the ghost user) in a transaction, because
        we're using `update_all`
      - Other minor changes
    • Timothy Andrew's avatar
      Use a `ghost` boolean to track ghost users. · 47947705eb3a
      Timothy Andrew authored
      Rather than using a separate `ghost` state. This lets us have the benefits of
      both ghost and blocked users (ghost: true, state: blocked) without having to
      rewrite a number of queries to include cases for `state: ghost`.
    • Timothy Andrew's avatar
      Implement review comments from @DouweM and @nick.thomas. · af0962be35a6
      Timothy Andrew authored
      1. Use an advisory lock to guarantee the absence of concurrency in `User.ghost`,
      to prevent data races from creating more than one ghost, or preventing the
      creation of ghost users by causing validation errors.
      2. Use `update_all` instead of updating issues one-by-one.
    • Timothy Andrew's avatar
      Deleting a user shouldn't delete associated issues. · fa29d2385819
      Timothy Andrew authored
      - "Associated" issues are issues the user has created + issues that the
        user is assigned to.
      - Issues that a user owns are transferred to a "Ghost User" (just a
        regular user with `state = 'ghost'` that is created when
        `User.ghost` is called).
      - Issues that a user is assigned to are moved to the "Unassigned" state.
      - Fix a spec failure in `profile_spec` — a spec was asserting that when a user
        is deleted, `User.count` decreases by 1. After this change, deleting a user
        creates (potentially) a ghost user, causing `User.count` not to change. The
        spec has been updated to look for the relevant user in the assertion.
    • Timothy Andrew's avatar
      Don't send notifications to ghost users. · 291c16485b10
      Timothy Andrew authored
      We already skip sending notifications to blocked users. Simply add ghost users
      to this list.
  8. 23 Feb, 2017 3 commits
    • Douwe Maan's avatar
      Revert "Enable Style/DotPosition" · 364126012167
      Douwe Maan authored
      This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.
      # Conflicts:
      #	.rubocop.yml
      #	.rubocop_todo.yml
      #	lib/gitlab/ci/config/entry/global.rb
      #	lib/gitlab/ci/config/entry/jobs.rb
      #	spec/lib/gitlab/ci/config/entry/factory_spec.rb
      #	spec/lib/gitlab/ci/config/entry/global_spec.rb
      #	spec/lib/gitlab/ci/config/entry/job_spec.rb
      #	spec/lib/gitlab/ci/status/build/factory_spec.rb
      #	spec/lib/gitlab/incoming_email_spec.rb
    • Douwe Maan's avatar
      Revert "Prefer leading style for Style/DotPosition" · 879f3a6d6920
      Douwe Maan authored
      This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
    • Douwe Maan's avatar
      Enable Rails/Delegate · bf62aec5708f
      Douwe Maan authored