Commit Graph

3428 Commits

Author SHA1 Message Date
Stan Hu ff4cc94413 Merge branch 'patch-31' into 'master'
Add missing provider_unauthorized method to import_github.rb

Closes #60347

See merge request gitlab-org/gitlab-ce!27218
2019-04-11 16:16:20 +00:00
Ben e925dddea7 Return a `401` error code 2019-04-11 06:43:09 +00:00
Ben 0984637faf Fix trailing white space 2019-04-10 21:37:05 +00:00
Ben 6b546551b6 Add missing provider_unauthroized method to import_github.rb 2019-04-10 12:48:53 +00:00
Sean McGivern cd9ae6bb82 Revert "Remove HipChat integration from GitLab"
This reverts commit a5378665a1.
2019-04-10 12:58:18 +01:00
Imre Farkas 9bc5ed14fe Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-09 15:38:58 +00:00
Nick Thomas a6218f1bcd Merge branch 'osw-multi-assignees-merge-requests' into 'master'
[Backport] Support multiple assignees for merge requests

See merge request gitlab-org/gitlab-ce!27089
2019-04-09 15:19:36 +00:00
Agustin Henze 20093f9de0 Add new permission model `read-pipeline-variable`
Used to get the variables via the API endpoint
`/projects/:id/pipelines/:pipeline_id/variables`

Signed-off-by: Agustin Henze <tin@redhat.com>
2019-04-09 14:53:44 +00:00
Nick Thomas d95889b8a4 Merge branch '43263-git-push-option-to-create-mr' into 'master'
Git push options to create a merge request, set target_branch and set merge when pipeline succeeds

Closes #53198 and #43263

See merge request gitlab-org/gitlab-ce!26752
2019-04-09 12:53:07 +00:00
Krasimir Angelov 724f19ba0a Add new API endpoint to expose single environment
This is resolving https://gitlab.com/gitlab-org/gitlab-ce/issues/30157.

Implement new API endpoint `/projects/:id/environments/:environment_id`
to expose single environment. Include information for environment's last
deployment if there is one.
2019-04-09 09:16:57 +00:00
Luke Duncalfe 3c40c98e26 Feature flag for merge requestion push options
https://gitlab.com/gitlab-org/gitlab-ce/issues/43263
https://gitlab.com/gitlab-org/gitlab-ce/issues/53198
2019-04-09 10:57:04 +12:00
Luke Duncalfe e73f537cb5 Refactor PushOptionsHandlerService from review
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.
2019-04-09 10:57:01 +12:00
Luke Duncalfe 1883e320ea Use Gitlab::PushOptions for `ci.skip` push option
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.
2019-04-09 10:03:26 +12:00
Oswaldo Ferreira ca884980ee [CE] Support multiple assignees for merge requests
Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161
(code out of ee/ folder).
2019-04-08 18:40:00 -03:00
Luke Duncalfe aa352a95df Support merge request create with push options
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
2019-04-09 09:36:42 +12:00
Sean McGivern 4317a2a3a2 Fix `updated_at` doesn't apply to `state_event` updates of issues via API 2019-04-08 15:33:30 +00:00
Michael Kozono d793d4a7c3 Merge branch 'duplicate-related-mrs' into 'master'
Remove duplicates from issue related merge requests

See merge request gitlab-org/gitlab-ce!27067
2019-04-05 20:07:05 +00:00
Alexandru Croitor c56970e3f7 Remove duplicates from issue related merge requests
Remove duplicates returned by Issues#related_merge_requests API that
relies on ReferencedMergeRequestsService which returns 2 arrays one of
related MRs and one of related MRs that close the issue(i.e. a subset
of first one). We only need related MRs in this case so just pick the
first array.
2019-04-05 22:17:07 +03:00
Gosia Ksionek 64858317ad Add part of needed code
Add columns to store project creation settings

Add project creation level column in groups
 and default project creation column in application settings

Remove obsolete line from schema

Update migration with project_creation_level column existence check

Rename migrations to avoid conflicts

Update migration methods

Update migration method
2019-04-05 18:49:46 +00:00
Andreas Brandl 46b1b9c1d6 Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request !26823
2019-04-05 13:02:56 +00:00
Imre Farkas d9d7237d2e Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-05 11:45:47 +00:00
Paul Slaughter 59ac0924da Fix IDE detecting MR from fork branch
**Why?**
Currently the IDE loads a merge request based on only the
`source_branch` name. This means it loads MR's from
forks that have the same branch name (not good).

- This required updating the BE API to accept `source_project_id`
2019-04-05 07:29:53 +00:00
Douglas Barbosa Alexandre b54228ad3d Merge branch '9217-warn-on-git-fetch-over-ssh-if-the-secondary-is-lagging-the-primary' into 'master'
Display console messages, if available

See merge request gitlab-org/gitlab-ce!26692
2019-04-05 00:19:37 +00:00
Douwe Maan c115ac4fa5 Merge branch '3314-add-on-runner-minutes-for-gitlab-com-ce' into 'master'
Backport some changes from gitlab-ee!9815

Closes #3314

See merge request gitlab-org/gitlab-ce!25908
2019-04-04 09:23:39 +00:00
Alexandru Croitor f4adb50ef2 Expose head pipeline in the related merge requests
Expose head pipeline for the MR in the api when requesting
related merge requests for an issue and show a detailed
status for the pipeline, which would include:
details_path, favicon, group, icon, label, text, tooltip.

https://gitlab.com/gitlab-org/gitlab-ce/issues/57662#note_152023412
2019-04-04 09:01:09 +00:00
Ash McKenzie 6b7a9b7498
Allow console messages be sent to gitlab-shell
Currently a no-op for CE
2019-04-04 14:20:11 +11:00
Francisco Javier López 6ee1d8cf77 Add port section to CI Image object
In order to implement https://gitlab.com/gitlab-org/gitlab-ee/issues/10179
we need several modifications on the CI config file. We are
adding a new ports section in the default Image object.

Each of these ports will accept: number, protocol and name.

By default this new configuration will be only enabled in
the Web IDE config file.
2019-04-03 09:50:54 +00:00
Rubén Dávila e8da6255d9 Backport some changes from EE
MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9815
2019-04-02 23:20:43 -05:00
John Jarvis 69b65a6b74 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into jarv/dev-to-gitlab-2019-04-02 2019-04-02 10:12:32 +02:00
GitLab Release Tools Bot b122be5ed5 Merge branch 'security-id-potential-denial-languages' into 'master'
Return cached languages if they've been detected before

See merge request gitlab/gitlabhq!2998
2019-04-02 07:48:28 +00:00
Mayra Cabrera b5e09a26de Include cluster domain into Project Cluster API
Domain was introduced on 11.8 and was not included on the
Project Cluster API. With this change user will be able to include
domain when adding and updating a cluster. Domain will also be included
on the GET calls.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59441
2019-04-01 16:29:05 +00:00
Stan Hu cedbb3366b Fix API /project/:id/branches not returning correct merge status
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24034 introduced
a regression where only the first 20 branches were used to determine
whether a branch has been merged because the pagination was applied
incorrectly. Requesting the second page of branches via the API would
always have the wrong merge status. We fix this by properly paginating
the branches before requesting their merge status.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56250
2019-03-30 05:20:29 -07:00
Andreas Brandl f5ba7ac357 Merge branch 'osw-multi-line-suggestions-creation-strategy' into 'master'
Prepares suggestion implementation for multi-line support

See merge request gitlab-org/gitlab-ce!26057
2019-03-27 16:57:25 +00:00
Oswaldo Ferreira 03e0604d5d Prepare suggestion implementation for multi-line
Adds the groundwork needed in order to persist multi-line suggestions,
while providing the parsing strategy which will be reused for the
**Preview** as well.
2019-03-27 12:26:53 -03:00
Fabio Busatto 035c8af12e Resolve "Get milestone by title via API" 2019-03-27 09:01:07 +00:00
James Lopez 82da4b1fd4 Merge branch 'bvl-allow-more-repos-per-resource-ce' into 'master'
Allow multiple repositories per project

See merge request gitlab-org/gitlab-ce!26539
2019-03-27 07:37:06 +00:00
Robert Speicher 2b3f072485 Merge branch 'backport-api-parameters' into 'master'
Backport EE API parameters in lib/api

See merge request gitlab-org/gitlab-ce!26369
2019-03-26 17:30:46 +00:00
Yorick Peterse cbe21d78bf
Backport parameters for API::Parameters
This backports the EE specific parameters for API::Parameters, wrapping
them in a conditional.
2019-03-26 14:18:29 +01:00
Yorick Peterse 449d2bb0d8
Backport parameters for API::Users
This backports the EE specific parameters for API::Users, and wraps them
in a conditional.
2019-03-26 14:18:29 +01:00
Yorick Peterse 30fb9fffec
Backport API parameters for API::Settings
This backports the API parameters from API::Settings that were added in
EE, wrapping them in a conditional.
2019-03-26 14:18:29 +01:00
Yorick Peterse 05534daa1c
Backport changes to API::ProtectedBranches
This backports EE specific parameters EE adds to API::ProtectedBranches,
and wraps them in a conditional.
2019-03-26 14:18:29 +01:00
Yorick Peterse be49d9c1ba
Backport parameters from API::Projects
This backports various parameter changes EE makes to API::Projects,
along with moving some code around to make it easier to extend in EE.
2019-03-26 14:18:29 +01:00
Yorick Peterse 71046be7d5
Backport API::Issues parameters from EE
This backports the parameters that EE adds to API::Issues, and wraps
them in conditionals so they are only used in EE.
2019-03-26 14:18:29 +01:00
Yorick Peterse b5623d3fd9
Backport API::Helpers::ProjectsHelpers from EE
This backports all changes made to this module in EE to CE, and wraps EE
specific code in a conditional.
2019-03-26 14:18:28 +01:00
Yorick Peterse c3b24826d1
Backport EE API parameters for API::Groups
This backports the API parameters for API::Groups from EE to CE,
ensuring both implementations use the same code. EE specific parameters
are wrapped in an `if` statement for two reasons:

1. It allows us to completely disable the parameters in CE.

2. It removes the need for adding a source comment to signal that the
   parameters are EE only.
2019-03-26 14:18:28 +01:00
Bob Van Landuyt d36415b754 Allow multiple repositories per project
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.
2019-03-26 13:21:03 +01:00
Peter Marko 12adb2a4bc Show statistics also when repository is disabled 2019-03-23 12:06:50 +01:00
Thiago Presa 538741f230 Add highest_role method to User 2019-03-22 09:54:03 +00:00
Igor Drozdov 732f892db3 Return cached languages if they've been detected before 2019-03-20 20:33:49 +03:00
Alexis Reigel 27ac48c394
Apply suggestion to lib/api/search.rb 2019-03-15 21:03:49 +01:00