Skip to content
Snippets Groups Projects
  1. Apr 16, 2019
    • Luke Duncalfe's avatar
      Fix logic in Api::Internal test · 37492c5d
      Luke Duncalfe authored
      The intention of this test is to ensure that the service class
      MergeRequests::PushOptionsHandlerService does not run when the
      :mr_push_options feature flag is disabled.
      
      This test was passing, however was not testing what it was supposed to
      be!
      
      For one, setting Feature.disable(:feature) in the test does not disable
      the feature, as rspec config in spec_helper stubs Feature to make all
      features enabled:
      
      https://gitlab.com/gitlab-org/gitlab-ce/commit/3ee48e422defaedd69946c607bd8d3672e510375
      
      So the feature was still enabled in the test.
      
      But this test wasn't failing because unfortunately I had put:
      
      ```
      expect(MergeRequests::PushOptionsHandlerService).to receive(:new)
      ```
      
      instead of not_to!
      
      This meant that the `.new` method was being stubbed, so the service
      class did not create a MergeRequest, which satisfied the second
      expectation.
      
      ```
      expect(MergeRequests::PushOptionsHandlerService).to receive(:new)
      ```
      37492c5d
  2. Apr 08, 2019
    • Luke Duncalfe's avatar
    • Luke Duncalfe's avatar
      Refactor PushOptionsHandlerService from review · e73f537c
      Luke Duncalfe authored
      Exceptions are no longer raised, instead all errors encountered are
      added to the errors property.
      
      MergeRequests::BuildService is used to generate attributes of a new
      merge request.
      
      Code moved from Api::Internal to Api::Helpers::InternalHelpers.
      e73f537c
    • Luke Duncalfe's avatar
      Use Gitlab::PushOptions for `ci.skip` push option · 1883e320
      Luke Duncalfe authored
      Previously the raw push option Array was sent to Pipeline::Chain::Skip.
      
      This commit updates this class (and the chain of classes that pass the
      push option parameters from the API internal `post_receive` endpoint to
      that class) to treat push options as a Hash of options parsed by
      GitLab::PushOptions.
      
      The GitLab::PushOptions class takes options like this:
      
          -o ci.skip -o merge_request.create -o merge_request.target=branch
      
      and turns them into a Hash like this:
      
          {
            ci: {
              skip: true
            },
            merge_request: {
              create: true,
              target: 'branch'
            }
          }
      
      This now how Pipeline::Chain::Skip is determining if the `ci.skip` push
      option was used.
      1883e320
    • Luke Duncalfe's avatar
      867ac4d1
    • Luke Duncalfe's avatar
      Support merge request create with push options · aa352a95
      Luke Duncalfe authored
      To create a new merge request:
      
        git push -u origin -o merge_request.create
      
      To create a new merge request setting target branch:
      
        git push -u origin -o merge_request.create \
          -o merge_request.target=123
      
      To update an existing merge request with a new target branch:
      
        git push -u origin -o merge_request.target=123
      
      A new Gitlab::PushOptions class handles parsing and validating the push
      options array. This can be the start of the standard of GitLab accepting
      push options that follow namespacing rules. Rules are discussed in issue
      https://gitlab.com/gitlab-org/gitlab-ce/issues/43263.
      
      E.g. these push options:
      
        -o merge_request.create -o merge_request.target=123
      
      Become parsed as:
      
        {
          merge_request: {
            create: true,
            target: '123',
          }
        }
      
      And are fetched with the class via:
      
        push_options.get(:merge_request)
        push_options.get(:merge_request, :create)
        push_options.get(:merge_request, :target)
      
      A new MergeRequests::PushOptionsHandlerService takes the `merge_request`
      namespaced push options and handles creating and updating
      merge requests.
      
      Any errors encountered are passed to the existing `output` Hash in
      Api::Internal's `post_receive` endpoint, and passed to gitlab-shell
      where they're output to the user.
      
      Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/43263
      aa352a95
  3. Apr 05, 2019
    • Bob Van Landuyt :neckbeard:'s avatar
      Fall back to project repository type by default · 2fdda744
      Bob Van Landuyt :neckbeard: authored and Douwe Maan's avatar Douwe Maan committed
      This makes sure that we always have a repository type when trying to
      parse a repository from a path.
      
      This is needed because sometimes we want to perform access checks as
      if the project already existed, for example when creating a project on
      push.
      
      Before this we were only doing that when accessing git over http, this
      makes sure it also works correctly when accessing git over SSH
      2fdda744
  4. Apr 04, 2019
  5. Mar 26, 2019
    • Bob Van Landuyt's avatar
      Allow multiple repositories per project · d36415b7
      Bob Van Landuyt authored
      This changes the repository type from a binary `wiki?` to a type. So
      we can have more than 2 repository types.
      
      Now everywhere we called `.wiki?` and expected a boolean, we check
      that type.
      d36415b7
  6. Mar 12, 2019
  7. Mar 11, 2019
  8. Feb 16, 2019
  9. Feb 14, 2019
  10. Jan 24, 2019
  11. Dec 31, 2018
    • Jonathon Reinhart's avatar
      Add support for Git push options, specifically ci.skip · ba781484
      Jonathon Reinhart authored
      gitlab-org/gitlab-shell!166 added support for collecting push options
      from the environment, and passing them along to the
      /internal/post_receive API endpoint.
      
      This change handles the new push_options JSON element in the payload,
      and passes them on through to the GitPushService and GitTagPushService
      services.
      
      Futhermore, it adds support for the first push option, ci.skip.  With
      this change, one can use 'git push -o ci.skip' to skip CI pipe
      execution. Note that the pipeline is still created, but in the "skipped"
      state, just like with the 'ci skip' commit message text.
      
      Implements #18667
      ba781484
  12. Dec 18, 2018
    • blackst0ne's avatar
      Update specs to rails5 format · b44a2c80
      blackst0ne authored
      Updates specs to use new rails5 format.
      
      The old format:
      `get :show, { some: params }, { some: headers }`
      
      The new format:
      `get :show, params: { some: params }, headers: { some: headers }`
      b44a2c80
  13. Dec 17, 2018
  14. Dec 16, 2018
  15. Dec 05, 2018
  16. Nov 07, 2018
  17. Oct 25, 2018
  18. Oct 23, 2018
  19. Sep 07, 2018
  20. Sep 06, 2018
  21. Aug 03, 2018
  22. Aug 01, 2018
    • Ævar Arnfjörð Bjarmason's avatar
      Add support for SSH certificate authentication · e00a7fab
      Ævar Arnfjörð Bjarmason authored
      Why and how to enable this is covered in the docs being changed
      here. This requires gitlab-org/gitlab-shell@2e8b670 ("Add support for
      SSH certificate authentication", 2018-06-14) which has been merged in
      and tagged as 8.0.0, so GITLAB_SHELL_VERSION needs to be bumped.
      
      Merging this closes gitlab-org/gitlab-ce#34572 see
      gitlab-org/gitlab-shell!207 for the gitlab-shell MR.
      
      Implementation notes:
      
       - The APIs being changed here are all internal, and their sole
         consumer is gitlab-shell.
      
       - Most of the changed code is a MR to gitlab-shell, see the
         gitlab-org/gitlab-shell!207 MR. That change covers why only some of
         the internal methods get a new "username" parameter, and why some
         others only get a "user_id".
      e00a7fab
  23. Jul 18, 2018
  24. Jun 14, 2018
  25. Jun 06, 2018
  26. May 25, 2018
  27. May 17, 2018
  28. Mar 30, 2018
  29. Mar 21, 2018
  30. Mar 06, 2018
  31. Feb 22, 2018
  32. Feb 07, 2018
  33. Feb 06, 2018
Loading