1. 12 8月, 2016 4 次提交
    • K
      Use event `enqueue` instead of `queue` · ea4ac578
      Kamil Trzcinski 提交于
      ea4ac578
    • S
      Fix bug where destroying a namespace would not always destroy projects · cb8a425b
      Stan Hu 提交于
      There is a race condition in DestroyGroupService now that projects are deleted asynchronously:
      
      1. User attempts to delete group
      2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project
      3. DestroyGroupService destroys the Group, leaving all its projects without a namespace
      4. Projects::DestroyService runs later but the can?(current_user,
         :remove_project) is `false` because the user no longer has permission to
         destroy projects with no namespace.
      5. This leaves the project in pending_delete state with no namespace/group.
      
      Projects without a namespace or group also adds another problem: it's not possible to destroy the container
      registry tags, since container_registry_path_with_namespace is the wrong value.
      
      The fix is to destroy the group asynchronously and to run execute directly on Projects::DestroyService.
      
      Closes #17893
      cb8a425b
    • K
      Use state machine for pipeline event processing · 6a6a69f4
      Kamil Trzcinski 提交于
      6a6a69f4
    • S
      api for generating new merge request · 6109daf4
      Scott Le 提交于
      DRY code + fix rubocop
      
      Add more test cases
      
      Append to changelog
      
      DRY changes list
      
      find_url service for merge_requests
      
      use GET for getting merge request links
      
      remove files
      
      rename to get_url_service
      
      reduce loop
      
      add test case for cross project
      
      refactor tiny thing
      
      update changelog
      6109daf4
  2. 11 8月, 2016 3 次提交
    • K
      Pre-create all builds for Pipeline when a trigger is received · 39203f1a
      Kamil Trzcinski 提交于
      This change simplifies a Pipeline processing by introducing a special new status: created.
      This status is used for all builds that are created for a pipeline.
      We are then processing next stages and queueing some of the builds (created -> pending) or skipping them (created -> skipped).
      This makes it possible to simplify and solve a few ordering problems with how previously builds were scheduled.
      This also allows us to visualise a full pipeline (with created builds).
      
      This also removes an after_touch used for updating a pipeline state parameters.
      Right now in various places we explicitly call a reload_status! on pipeline to force it to be updated and saved.
      39203f1a
    • R
      New AccessRequests API endpoints for Group & Project · 29850364
      Rémy Coutable 提交于
      Also, mutualize AccessRequests and Members endpoints for Group &
      Project.
      New API documentation for the AccessRequests endpoints.
      Signed-off-by: NRémy Coutable <remy@rymai.me>
      29850364
    • S
      Clean up project destruction · 4955a47c
      Stan Hu 提交于
      Instead of redirecting from the project service to the service and back to the model,
      put all destruction code in the service. Also removes a possible source of failure
      where run_after_commit may not destroy the project.
      4955a47c
  3. 09 8月, 2016 1 次提交
  4. 05 8月, 2016 1 次提交
  5. 04 8月, 2016 1 次提交
  6. 03 8月, 2016 4 次提交
  7. 01 8月, 2016 1 次提交
  8. 30 7月, 2016 1 次提交
    • S
      Properly abort a merge when merge conflicts occur · 60529e02
      Stan Hu 提交于
      If somehow a user attempted to accept a merge request that had
      conflicts (e.g. the "Accept Merge Request" button or the MR itself was
      not updated), `MergeService` did not properly detect that a conflict
      occurred. It would assume that the MR went through without any issues
      and close the MR as though everything was fine. This could cause
      data loss if the source branch were removed.
      
      Closes #20425
      60529e02
  9. 29 7月, 2016 9 次提交
    • T
      Implement final review comments from @rymai. · cebcc417
      Timothy Andrew 提交于
      1. Instantiate `ProtectedBranchesAccessSelect` from `dispatcher`
      
      2. Use `can?(user, ...)` instead of `user.can?(...)`
      
      3. Add `DOWNTIME` notes to all migrations added in !5081.
      
      4. Add an explicit `down` method for migrations removing the
         `developers_can_push` and `developers_can_merge` columns, ensuring that
         the columns created (on rollback) have the appropriate defaults.
      
      5. Remove duplicate CHANGELOG entries.
      
      6. Blank lines after guard clauses.
      cebcc417
    • T
      Use `Gitlab::Access` to protected branch access levels. · 0a8aeb46
      Timothy Andrew 提交于
      1. It makes sense to reuse these constants since we had them duplicated
         in the previous enum implementation. This also simplifies our
         `check_access` implementation, because we can use
         `project.team.max_member_access` directly.
      
      2. Use `accepts_nested_attributes_for` to create push/merge access
         levels. This was a bit fiddly to set up, but this simplifies our code
         by quite a large amount. We can even get rid of
         `ProtectedBranches::BaseService`.
      
      3. Move API handling back into the API (previously in
         `ProtectedBranches::BaseService#translate_api_params`.
      
      4. The protected branch services now return a `ProtectedBranch` rather
         than `true/false`.
      
      5. Run `load_protected_branches` on-demand in the `create` action, to
         prevent it being called unneccessarily.
      
      6. "Masters" is pre-selected as the default option for "Allowed to Push"
         and "Allowed to Merge".
      
      7. These changes were based on a review from @rymai in !5081.
      0a8aeb46
    • T
      Authorize user before creating/updating a protected branch. · 6d841eaa
      Timothy Andrew 提交于
      1. This is a third line of defence (first in the view, second in the
         controller).
      
      2. Duplicate the `API::Helpers.to_boolean` method in `BaseService`. The
         other alternative is to `include API::Helpers`, but this brings with it
         a number of other methods that might cause conflicts.
      
      3. Return a 403 if authorization fails.
      6d841eaa
    • T
      Have the `branches` API work with the new protected branches data model. · 01d190a8
      Timothy Andrew 提交于
      1. The new data model moves from `developers_can_{push,merge}` to
         `allowed_to_{push,merge}`.
      
      2. The API interface has not been changed. It still accepts
         `developers_can_push` and `developers_can_merge` as options. These
         attributes are inferred from the new data model.
      
      3. Modify the protected branch create/update services to translate from
         the API interface to our current data model.
      01d190a8
    • T
      Implement review comments from @dbalexandre. · 7b2ad2d5
      Timothy Andrew 提交于
      1. Remove `master_or_greater?` and `developer_or_greater?` in favor of
         `max_member_access`, which is a lot nicer.
      
      2. Remove a number of instances of `include Gitlab::Database::MigrationHelpers`
         in migrations that don't need this module. Also remove comments where
         not necessary.
      
      3. Remove duplicate entry in CHANGELOG.
      
      4. Move `ProtectedBranchAccessSelect` from Coffeescript to ES6.
      
      5. Split the `set_access_levels!` method in two - one each for `merge` and
         `push` access levels.
      7b2ad2d5
    • T
      Fix default branch protection. · a9958ddc
      Timothy Andrew 提交于
      1. So it works with the new data model for protected branch access levels.
      a9958ddc
    • T
      Add "No One Can Push" to the protected branches UI. · ab6096c1
      Timothy Andrew 提交于
      1. Move to dropdowns instead of checkboxes. One each for "Allowed to
         Push" and "Allowed to Merge"
      
      2. Refactor the `ProtectedBranches` coffeescript class into
         `ProtectedBranchesAccessSelect`.
      
      3. Modify the backend to accept the new parameters.
      ab6096c1
    • T
      Use the `{Push,Merge}AccessLevel` models in the UI. · 134fe5af
      Timothy Andrew 提交于
      1. Improve error handling while creating protected branches.
      
      2. Modify coffeescript code so that the "Developers can *" checkboxes
         send a '1' or '0' even when using AJAX. This lets us keep the backend
         code simpler.
      
      3. Use services for both creating and updating protected branches.
         Destruction is taken care of with `dependent: :destroy`
      134fe5af
    • A
  10. 28 7月, 2016 2 次提交
  11. 27 7月, 2016 3 次提交
  12. 25 7月, 2016 1 次提交
  13. 22 7月, 2016 1 次提交
  14. 21 7月, 2016 2 次提交
  15. 20 7月, 2016 2 次提交
  16. 19 7月, 2016 4 次提交