summaryrefslogtreecommitdiff
path: root/lib/api
Commit message (Collapse)AuthorAgeFilesLines
* Move the circuitbreaker check out in a separate processbvl-circuitbreaker-processBob Van Landuyt2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Moving the check out of the general requests, makes sure we don't have any slowdown in the regular requests. To keep the process performing this checks small, the check is still performed inside a unicorn. But that is called from a process running on the same server. Because the checks are now done outside normal request, we can have a simpler failure strategy: The check is now performed in the background every `circuitbreaker_check_interval`. Failures are logged in redis. The failures are reset when the check succeeds. Per check we will try `circuitbreaker_access_retries` times within `circuitbreaker_storage_timeout` seconds. When the number of failures exceeds `circuitbreaker_failure_count_threshold`, we will block access to the storage. After `failure_reset_time` of no checks, we will clear the stored failures. This could happen when the process that performs the checks is not running.
* Use relative _path helper URLs in the GitLab UI40825-use-relative-path-urlsEric Eastwood2017-12-071-0/+3
| | | | Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/40825
* Merge branch 'jej/per-user-protected-branches-api-ce' into 'master'Sean McGivern2017-12-071-10/+8
|\ | | | | | | | | CE backport of "ProtectedBranches API handles per user/group granularity" See merge request gitlab-org/gitlab-ce!15747
| * CE backport of ProtectedBranches API changesJames Edwards-Jones2017-12-071-10/+8
| | | | | | | | | | In EE we now allow individual users/groups to be set on POST, which required some refactoring. See https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3516
* | The API isn't using the appropriate services for managing forksFrancisco Javier López2017-12-071-10/+11
| |
* | Merge branch 'zj-multiple-artifacts' into 'master'Grzegorz Bizon2017-12-052-9/+7
|\ \ | |/ |/| | | | | Multiple artifacts See merge request gitlab-org/gitlab-ce!14367
| * Store expire_at in ci_job_artifactsKamil Trzcinski2017-12-031-4/+5
| |
| * Rename Artifact to JobArtifact, split metadata outZeger-Jan van de Weg2017-12-032-9/+6
| | | | | | | | | | | | | | | | | | Two things at ones, as there was no clean way to seperate the commit and give me feedback from the tests. But the model Artifact is now JobArtifact, and the table does not have a type anymore, but the metadata is now its own model: Ci::JobArtifactMetadata.
| * Create Ci::ArtifactsZeger-Jan van de Weg2017-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To allow jobs/builds to have multiple artifacts, and to start seperating concerns from Ci::Build a new model is created: Ci::Artifact. Changes include the updating of the ArtifactUploader to adapt to a slightly different interface. The uploader expects to be initialized with a `Ci::Build`. Futher a migration with the minimal fields, the needed foreign keys and an index. Last, the way this works is by prepending a module to Ci::Build so we can basically override behaviour but if needed use `super` to get the original behaviour.
* | Merge branch 'sh-optimize-groups-api' into 'master'Douwe Maan2017-12-044-14/+98
|\ \ | | | | | | | | | | | | | | | | | | Optimize API /groups/:id/projects by preloading assocations Closes #40308 See merge request gitlab-org/gitlab-ce!15475
| * | Not forcing to redefine preload_relationFrancisco Lopez2017-12-011-1/+1
| | |
| * | Undoing the change to ForkNetworkMemberFrancisco Lopez2017-12-011-11/+7
| | |
| * | Fixed BasicProjectDetail parentFrancisco Lopez2017-12-011-1/+1
| | |
| * | Removed binding.pryFrancisco Lopez2017-12-011-1/+0
| | |
| * | Removing blank lineFrancisco Lopez2017-12-011-1/+0
| | |
| * | Changes after rebaseFrancisco Lopez2017-12-011-3/+14
| | |
| * | Undoing debugging changeFrancisco Lopez2017-12-011-2/+2
| | |
| * | Comments from code review applied. Also switched forked_from_project and ↵Francisco Lopez2017-12-013-43/+52
| | | | | | | | | | | | ForkedProjectLinks to ForkNetworkMember
| * | Refactored /projects and /user/:user_id/projects endpointsFrancisco Lopez2017-12-014-25/+77
| | |
| * | Code review comments appliedFrancisco Lopez2017-12-011-2/+2
| | |
| * | Small renamingFrancisco Lopez2017-12-011-4/+4
| | |
| * | More preloading improvement and added batch count servicesFrancisco Lopez2017-12-011-5/+20
| | |
| * | Preload project route to avoid N+1 queryStan Hu2017-12-011-1/+1
| | |
| * | Only serialize namespace essentials in group's projects API responseStan Hu2017-12-011-2/+4
| | |
| * | Omit the `all` call after Project#project_group_links to avoid unnecessary loadsStan Hu2017-12-011-1/+1
| | |
| * | Optimize API /groups/:id/projects by preloading associationsStan Hu2017-12-011-0/+1
| |/ | | | | | | Closes #40308
* | Added default order to UserFinderFrancisco Javier López2017-12-042-0/+12
|/
* support ordering of project notes in notes apihaseeb2017-11-291-1/+6
|
* Merge branch 'gitaly-ssh-upload-pack-opt-out' into 'master'Sean McGivern2017-11-291-4/+4
|\ | | | | | | | | | | | | SSHUploadPack over Gitaly is now OptOut Closes gitaly#730 See merge request gitlab-org/gitlab-ce!15623
| * SSHUploadPack over Gitaly is now OptOutgitaly-ssh-upload-pack-opt-outKim "BKC" Carlbäcker2017-11-291-4/+4
| | | | | | | | - Better gitaly-handling in /api/internal/allowed specs
* | Add timeouts for Gitaly callsAndrew Newdigate2017-11-291-0/+3
| |
* | Merge branch 'tm/feature/list-runners-jobs-api' into 'master'Kamil Trzciński2017-11-282-7/+42
|\ \ | | | | | | | | | | | | | | | | | | Add new API endpoint - list jobs of a specified runner Closes #39699 See merge request gitlab-org/gitlab-ce!15432
| * | Refactorize jobs finding logicTomasz Maczukin2017-11-281-6/+2
| | |
| * | Modify outputTomasz Maczukin2017-11-282-6/+9
| | |
| * | Allow filtering by 'status'Tomasz Maczukin2017-11-281-1/+8
| | |
| * | Add information about projectTomasz Maczukin2017-11-282-6/+17
| | |
| * | Add new API endpoint - list jobs of a specified runnerTomasz Maczukin2017-11-281-0/+18
| | |
* | | Merge branch 'tm/feature/namespace-by-id-api' into 'master'Kamil Trzciński2017-11-282-0/+32
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Add new API endpoint - get a namespace by ID Closes #40254 See merge request gitlab-org/gitlab-ce!15442
| * | Introduce :read_namespace access policy for namespace and groupTomasz Maczukin2017-11-231-1/+1
| | |
| * | Allow request namespace by ID or pathTomasz Maczukin2017-11-232-16/+24
| | |
| * | Add new API endpoint - get a namespace by IDTomasz Maczukin2017-11-231-0/+24
| | |
* | | Create issue and merge request destroy servicesGeorge Andrinopoulos2017-11-252-2/+6
| |/ |/|
* | Merge branch 'jej/fix-protected-branch-validations-ce' into 'master'Rémy Coutable2017-11-241-2/+2
|\ \ | | | | | | | | | | | | Fix ProtectedBranch access level validations See merge request gitlab-org/gitlab-ce!15586
| * | Fix ProtectedBranch access level validationsJames Edwards-Jones2017-11-241-2/+2
| | | | | | | | | | | | | | | Before an access_level was required in EE even when an it had been set for a user/group.
* | | Merge branch 'jej-rename-legacy-protected-branches-api-service' into 'master'Rémy Coutable2017-11-231-2/+2
|\ \ \ | | | | | | | | | | | | | | | | Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateService See merge request gitlab-org/gitlab-ce!15575
| * | | Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateServicejej-rename-legacy-protected-branches-api-serviceJames Edwards-Jones2017-11-231-2/+2
| |/ /
* | | Merge branch '39887-move-identical-check-to-merged-branches' into 'master'Douwe Maan2017-11-231-1/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Move identical merged branch check to merged_branch_names Closes #39887 See merge request gitlab-org/gitlab-ce!15464
| * | | Move identical merged branch check to merged_branch_namesLin Jen-Shin2017-11-231-1/+5
| |/ /
* | | Merge branch 'use-merge-requests-diff-id-column' into 'master'Douwe Maan2017-11-231-1/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Use foreign key to get latest MR diff Closes #37631 See merge request gitlab-org/gitlab-ce!15126
| * | Use latest_merge_request_diff associationSean McGivern2017-11-231-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.