1. 20 Aug, 2016 13 commits
    • Timothy Andrew's avatar
    • Timothy Andrew's avatar
      Fix specs for `GitAccess` and `UserAccess`. · 096b46ca
      Timothy Andrew authored
      - As part of gitlab-org/gitlab-ce!5824, the `protected_branches` factory
        creates default `MASTER` access levels for merging and pushing.
      
      - Some specs rely on the condition that no pre-existing access levels
        exist when a protected branch is created, and these specs were
        failing.
      
      - Added a factory trait to remove the default access levels.
      096b46ca
    • Timothy Andrew's avatar
      Fix `AutocompleteController` spec. · bd9d17c8
      Timothy Andrew authored
      - Project needs to be loaded before `find_users` is called.
      bd9d17c8
    • Timothy Andrew's avatar
      Implement review feedback from @DouweM. · c4346dcd
      Timothy Andrew authored
      1. Check if a project is readable by the current user when fetching
         users for autocomplete.
      
      2. Remove duplication relating to gon variables in
         `ProtectedBranchesController`
      
      3. Remove unnecessary colons in view labels.
      
      4. Remove an explicit `false` check in the `branches` API.
      c4346dcd
    • Timothy Andrew's avatar
      Implement final round of review comments from @dbalexandre. · 06288cb2
      Timothy Andrew authored
      - Primarly whitespace and code style changes.
      
      - Improve feature spec dealing with removing a user from a protected
        branch. Previously, we were only asserting on a "Deleted" flash
        notice. Now the assertion looks at the database to make sure that the
        right access level was removed.
      06288cb2
    • Timothy Andrew's avatar
      Implement changes from @dbalexandre's review. · 3e88873f
      Timothy Andrew authored
      1. Set `gon.current_project_id` in a protected branches controller,
         since that's the only place this is used.
      
      2. Move flash notice to the redirect message.
      
      3. Rename the `js_access_levels` method to `access_levels_options`
      
      4. Scope a `find` while sending a branch protection email.
      
      5. Use scopes to simplify finding users with push/merge access for a
         project.
      
      6. Use `change_column_null`  to avoid an `ActiveRecord::IrreversibleMigration`
      3e88873f
    • Timothy Andrew's avatar
      Add migration downtime flags/notices. · f18bdbb1
      Timothy Andrew authored
      f18bdbb1
    • Timothy Andrew's avatar
      Only show users that have the `push_code` ability. · 4911f5af
      Timothy Andrew authored
      - While selecting user access for a protected branch.
      4911f5af
    • Timothy Andrew's avatar
      Update CHANGELOG · 683a0920
      Timothy Andrew authored
      683a0920
    • Timothy Andrew's avatar
      Remove branch permissions for users who have left the project. · 205581c5
      Timothy Andrew authored
      -  When a user leaves a project, any access levels that they were
         granted specifically are destroyed.
      
      -  When a user is removed from a project, any access levels that they
         were granted specifically are destroyed.
      205581c5
    • Timothy Andrew's avatar
      Fix protected branches feature spec. · 454c88ae
      Timothy Andrew authored
      To work with restricting access to a specific user.
      454c88ae
    • Timothy Andrew's avatar
      Implement frontend to allow specific people to access protected branches. · f7547d81
      Timothy Andrew authored
      1. While creating a protected branch, you can set a single user / role
        for each setting ("Allowed to Merge", "Allowed to Push").
      
      2. More users / roles can be set subsequently.
      
      3. Repurposed 'users_select.js.coffee` for the needs of this page.
      
      4. Move protected branch settings to the `show` page.
      
          - Too many settings on the single index page can be overwhelming. Also,
            if the number of users that can access a protected branch is large,
            the amount of space between protected branches in the table can be
            unwieldy.
      
          - This is the simplest design I can think of - we can use this
            until we have someone from the frontend/ux team take a look at
            this.
      
          - Move protected branches javascript under a `protected_branches`
            directory.
      
          - The dropdowns don't show access levels / users that have already been
            selected.
      
          - Allow deleting access levels using two new access level controllers.
      f7547d81
    • Timothy Andrew's avatar
      Implement model-level changes to allow branch protection for specific users. · d78ab154
      Timothy Andrew authored
      - A protected branch now `has_many` access levels (as opposed to
        `has_one`, which CE will continue to have). Each access level
        represents either a user or a role that is allowed to access the
        protected branch.
      
      - Update `git_access_spec` to test cases where a specific user is given
        access to a protected branch.
      
      - Remove the explicit `push_check` for protected branches. This is
        because a non-developer user (such as a reporter) should be able to
        push code if they are added to a protected branch specifically.
      
      - Fix specs (git_access_spec) that were implicitly depending on a
        master push access level being created (previously, a protected
        branch's default state was "masters can push + masters can merge").
        Since the current default is "none", the dependency needs to be
        explicitly declared.
      
      - Update `git_push_service` so default branch protection (for new repos)
        works as expected.
      d78ab154
  2. 19 Aug, 2016 1 commit
  3. 18 Aug, 2016 15 commits
  4. 17 Aug, 2016 11 commits