Commit Graph

2490 Commits

Author SHA1 Message Date
Kamil Trzciński 94c5ca71b7 Merge branch 'tm/feature/namespace-by-id-api' into 'master'
Add new API endpoint - get a namespace by ID

Closes #40254

See merge request gitlab-org/gitlab-ce!15442
2017-11-28 08:57:39 +00:00
George Andrinopoulos 7fb1bb01bd Create issue and merge request destroy services 2017-11-25 22:09:18 +02:00
Rémy Coutable b355ebc4c9 Merge branch 'jej/fix-protected-branch-validations-ce' into 'master'
Fix ProtectedBranch access level validations

See merge request gitlab-org/gitlab-ce!15586
2017-11-24 16:16:31 +00:00
James Edwards-Jones d6dd9d712a Fix ProtectedBranch access level validations
Before an access_level was required in EE even when an
it had been set for a user/group.
2017-11-24 13:20:56 +00:00
Tomasz Maczukin 97f966c445
Introduce :read_namespace access policy for namespace and group 2017-11-23 17:44:05 +01:00
Tomasz Maczukin dfbfd3c7d7
Allow request namespace by ID or path 2017-11-23 17:44:05 +01:00
Rémy Coutable 3026cb2047 Merge branch 'jej-rename-legacy-protected-branches-api-service' into 'master'
Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateService

See merge request gitlab-org/gitlab-ce!15575
2017-11-23 15:28:41 +00:00
Douwe Maan dbf97574dc Merge branch '39887-move-identical-check-to-merged-branches' into 'master'
Move identical merged branch check to merged_branch_names

Closes #39887

See merge request gitlab-org/gitlab-ce!15464
2017-11-23 15:16:37 +00:00
Douwe Maan ad70fb7bdc Merge branch 'use-merge-requests-diff-id-column' into 'master'
Use foreign key to get latest MR diff

Closes #37631

See merge request gitlab-org/gitlab-ce!15126
2017-11-23 15:01:30 +00:00
Tomasz Maczukin 392cc88709
Add new API endpoint - get a namespace by ID 2017-11-23 14:34:34 +01:00
Markus Koller 257fd57134 Allow password authentication to be disabled entirely 2017-11-23 13:16:14 +00:00
James Edwards-Jones fceffe4dca Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateService 2017-11-23 12:43:13 +00:00
Sean McGivern 991bf24ec8 Use latest_merge_request_diff association
Compared to the merge_request_diff association:

1. It's simpler to query. The query uses a foreign key to the
   merge_request_diffs table, so no ordering is necessary.
2. It's faster for preloading. The merge_request_diff association has to load
   every diff for the MRs in the set, then discard all but the most recent for
   each. This association means that Rails can just query for N diffs from N
   MRs.
3. It's more complicated to update. This is a bidirectional foreign key, so we
   need to update two tables when adding a diff record. This also means we need
   to handle this as a special case when importing a GitLab project.

There is some juggling with this association in the merge request model:

* `MergeRequest#latest_merge_request_diff` is _always_ the latest diff.
* `MergeRequest#merge_request_diff` reuses
  `MergeRequest#latest_merge_request_diff` unless:
    * Arguments are passed. These are typically to force-reload the association.
    * It doesn't exist. That means we might be trying to implicitly create a
      diff. This only seems to happen in specs.
    * The association is already loaded. This is important for the reasons
      explained in the comment, which I'll reiterate here: if we a) load a
      non-latest diff, then b) get its `merge_request`, then c) get that MR's
      `merge_request_diff`, we should get the diff we loaded in c), even though
      that's not the latest diff.

Basically, `MergeRequest#merge_request_diff` is the latest diff in most cases,
but not quite all.
2017-11-23 12:14:56 +00:00
Lin Jen-Shin 7df1cb528e Move identical merged branch check to merged_branch_names 2017-11-23 18:26:41 +08:00
Daniel Juarez 0b9e1e1662 Skip confirmation user api 2017-11-21 15:47:58 +00:00
Sean McGivern f562e69eab Merge branch '39461-notes-api-for-issues-no-longer-returns-label-additions-removals' into 'master'
Resolve "Notes API for issues no longer returns label additions/removals"

Closes #39461

See merge request gitlab-org/gitlab-ce!15080
2017-11-21 14:49:07 +00:00
micael.bergeron c900c21eef add `#with_metadata` scope to remove a N+1 from the notes' API 2017-11-21 08:31:23 -05:00
Rémy Coutable 4f09d099e9 Merge branch '18040-rubocop-line-break-after-guard-clause' into 'master'
Adds Rubocop rule for line break after guard clause

Closes #18040

See merge request gitlab-org/gitlab-ce!15188
2017-11-20 09:22:14 +00:00
Francisco Lopez 7f0317917a Changes after rebase 2017-11-17 10:09:56 +01:00
Francisco Lopez 1436598e49 Moved Exceptions to Gitlab::Auth 2017-11-17 10:02:11 +01:00
Francisco Lopez aa84ef1e1a Moving exceptions to UserAuthFinders 2017-11-17 10:02:11 +01:00
Francisco Lopez f189657523 Added some more comments 2017-11-17 10:02:11 +01:00
Francisco Lopez 21153a4f47 Homogenising the type of the request handled by UserAuthFinder. Also tests fixed 2017-11-17 10:02:11 +01:00
Francisco Lopez aecc3eb080 Applied some code review comments 2017-11-17 10:02:10 +01:00
Francisco Lopez 374179a970 Removing private token 2017-11-17 10:01:21 +01:00
Francisco Lopez 41ebd06ddc Some fixes after rebase 2017-11-17 10:01:20 +01:00
Francisco Lopez 470b5dc326 Updated refactor and pushing to see if test fails 2017-11-17 10:00:48 +01:00
Francisco Lopez d948e67913 First refactor 2017-11-17 10:00:08 +01:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Ahmad Sherif 52bfd06462 Use relative git object paths to construct absolute ones before setting Env 2017-11-14 20:26:39 +01:00
Kamil Trzciński 6b01821b0d Merge branch 'fix/sm/31771-do-not-allow-jobs-to-be-erased-new' into 'master'
Do not allow jobs to be erased

Closes #31771

See merge request gitlab-org/gitlab-ce!15216
2017-11-14 10:54:30 +00:00
Travis Miller 1162d89ac4 Add administrative endpoint to list all pages domains 2017-11-13 16:05:44 +00:00
Lin Jen-Shin (godfat) 258bf3e187 Add Gitlab::Utils::StrongMemoize 2017-11-13 15:27:30 +00:00
Winnie Hellmann 26b6dfaf6f Add /groups/:id/subgroups endpoint to API 2017-11-09 16:07:04 +00:00
Rémy Coutable ae434cccb2 Merge branch '39895-cant-set-mattermost-username-channel-from-api' into 'master'
Fix acceptance of username for Mattermost service update

Closes #39895

See merge request gitlab-org/gitlab-ce!15275
2017-11-09 13:19:27 +00:00
Douwe Maan 20ac30a705 Merge branch '36099-api-responses-missing-x-content-type-options-header' into '10-1-stable'
Include X-Content-Type-Options (XCTO) header into API responses

See merge request gitlab/gitlabhq!2211

(cherry picked from commit 6c818e77f2)

e087e075 Include X-Content-Type-Options (XCTO) header into API responses
2017-11-08 20:11:18 -08:00
Mark Fletcher 12d622eb99 Fix acceptance of username for Mattermost service update via API 2017-11-08 19:48:19 +00:00
Stan Hu 0c3877a488 Merge branch 'fix-issues-api-list-performance' into 'master'
Fail when issuable_meta_data is called on an unlimited collection

Closes #39845

See merge request gitlab-org/gitlab-ce!15249
2017-11-08 19:37:21 +00:00
Douwe Maan fec48c6e17 Use Commit#notes and Note.for_commit_id when possible to make sure we use all the indexes available to us 2017-11-08 12:22:11 +01:00
Sean McGivern 4d4ddb6004 Fail when issuable_meta_data is called on an unlimited collection
This method can be called with an array, or a relation:

1. Arrays always have a limited amount of values, so that's fine.
2. If the relation does not have a limit value applied, then we will load every
   single object in that collection, and prevent N+1 queries for the metadata
   for that. But that's wrong, because we should never call this without an
   explicit limit set. So we raise in that case, and this commit will see which
   specs fail.

The only failing specs here were the issues API specs, and the specs for
IssuableMetadata itself, and both have been addressed.
2017-11-07 16:26:55 +00:00
Shinya Maeda d89c18901b Merge branch 'master' into fix/sm/31771-do-not-allow-jobs-to-be-erased-new 2017-11-07 22:12:19 +09:00
Douwe Maan 8138d58d42 Merge branch '37442-api-branches-id-repository-branches-is-calling-gitaly-n-1-times-per-request' into 'master'
Fetch the merged branches at once in the `/projects/:id/repository/branches` endpoint

See merge request gitlab-org/gitlab-ce!15215
2017-11-07 11:09:00 +00:00
Rémy Coutable 31e3ef93e5 Merge branch 'feature/custom-attributes-on-projects-and-groups' into 'master'
Support custom attributes on groups and projects

See merge request gitlab-org/gitlab-ce!14593
2017-11-07 10:59:38 +00:00
Rémy Coutable 2ec5ae21b8 Merge branch 'add-changes-count-to-merge-requests-api' into 'master'
Add changes_count to the merge requests API

See merge request gitlab-org/gitlab-ce!15178
2017-11-07 10:58:03 +00:00
Shinya Maeda afef385337 Add doc. Fix spec. Add erase_build in protected_ref rule 2017-11-07 02:47:05 +09:00
Rémy Coutable e78c701aff
Pass the Gitlab::Git::Branch object to Repository#merged_to_root_ref?
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-11-06 16:29:50 +01:00
Shinya Maeda c8eb2a914b Fix spec. Revert update check. 2017-11-06 23:24:25 +09:00
Shinya Maeda 9b58b8e363 Do not allow jobs to be erased 2017-11-06 22:20:44 +09:00
Rémy Coutable b20984dea2
Improve performance of the /projects/:id/repository/branches API endpoint
Mitigate a N+1 requests to Gitaly problem. Still one left.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-11-06 13:31:23 +01:00
Markus Koller 1f773a8ef5
Support custom attributes on groups 2017-11-06 10:51:50 +01:00