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
Tomasz Maczukin
a9212e0f07
Add some unit tests for lib/api/helpers.rb
2017-11-27 23:06:42 +01:00
Sean McGivern
89c9d2ad6b
Merge branch 'dm-fix-registry-with-sudo-token' into 'master'
...
Fix pulling and pushing using a personal access token with the sudo scope
Closes #40466
See merge request gitlab-org/gitlab-ce!15571
2017-11-24 09:09:38 +00:00
Douwe Maan
fad4ab7d56
Merge branch 'pawel/update_prometheus_gem_to_well_tested_version' into 'master'
...
Update Prometheus Gem version and disable Prometheus method call instrumentation by default.
Closes gitlab-ee#4139 and #40457
See merge request gitlab-org/gitlab-ce!15558
2017-11-24 09:01:12 +00:00
Pawel Chojnacki
46cd2d93bb
Use feature flag instead of application settigns to control if method calls should be instrumented
2017-11-23 23:39:10 +01:00
Pawel Chojnacki
0051b5fbcc
Use only real duration to measure method call performance via Prometheus
2017-11-23 23:33:01 +01:00
Pawel Chojnacki
efe4cab92b
check method timing threshold when observing method performance
2017-11-23 23:33:01 +01:00
James Lopez
fdd7a4cb1b
Fix hashed storage for attachments bugs
2017-11-23 17:04:35 +00:00
Sean McGivern
dd11f0e053
Merge branch 'dm-cleanup-fetch-and-mirror-methods' into 'master'
...
Clean up repository fetch and mirror methods
See merge request gitlab-org/gitlab-ce!15424
2017-11-23 17:01:47 +00:00
Douwe Maan
7a1e93d35b
Rename fetch_refs to refmap
2017-11-23 16:59:58 +01:00
Douwe Maan
0e6beaf50c
Clean up repository fetch and mirror methods
2017-11-23 16:59:50 +01:00
Douwe Maan
453b178093
Fix pulling and pushing using a personal access token with the sudo scope
2017-11-23 16:32:08 +01: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
Sean McGivern
038f5a412d
Merge branch 'jk-group-mentions-fix' into 'master'
...
Fix link text from group context
Closes gitlab-ee#4100
See merge request gitlab-org/gitlab-ce!15565
2017-11-23 14:04:42 +00:00
Markus Koller
257fd57134
Allow password authentication to be disabled entirely
2017-11-23 13:16:14 +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
Jarka Kadlecova
e826c5d091
Fix link text from group context
2017-11-23 12:59:14 +01:00
Jacob Vosmaer (GitLab)
4cfcc97544
Fix encoding bugs in Gitlab::Git::User
2017-11-23 10:48:57 +00:00
Lin Jen-Shin
5951320075
Make sure repository is restored
2017-11-23 18:26:41 +08:00
Lin Jen-Shin
7df1cb528e
Move identical merged branch check to merged_branch_names
2017-11-23 18:26:41 +08:00
Sean McGivern
e548c61334
Merge branch '39720-group-milestone-sorting' into 'master'
...
Add Group Milestone sorting
Closes #39720
See merge request gitlab-org/gitlab-ce!15230
2017-11-22 11:40:52 +00:00
Phil Hughes
d7527d73b1
Merge branch 'feature_add_mermaid' into 'master'
...
Add support of Mermaid
Closes #3711
See merge request gitlab-org/gitlab-ce!15107
2017-11-22 11:00:12 +00:00
Vitaliy @blackst0ne Klachkov
131e74d10d
Add support of Mermaid
2017-11-22 14:12:04 +11:00
Douwe Maan
6c33981654
Merge branch 'sh-optimize-read-only-check' into 'master'
...
Optimize read-only middleware so that it does not consume as much CPU
Closes #40185 and gitlab-com/infrastructure#3240
See merge request gitlab-org/gitlab-ce!15504
2017-11-21 16:10:47 +00:00
Zeger-Jan van de Weg
f9565e3039
Batchload blobs for diff generation
...
After installing a new gem, batch-loader, a construct can be used to
queue data to be fetched in bulk. The gem was also introduced in both
gitlab-org/gitlab-ce!14680 and gitlab-org/gitlab-ce!14846 , but those mrs
are not merged yet.
For the generation of diffs, both the old blob and the new blob need to
be loaded. This for every file in the diff, too. Now we collect all
these so we do 1 fetch. Three `.allow_n_plus_1_calls` have been removed,
which I expect to be valid, but this needs to be confirmed by a full CI
run.
Possibly closes:
- https://gitlab.com/gitlab-org/gitlab-ce/issues/37445
- https://gitlab.com/gitlab-org/gitlab-ce/issues/37599
- https://gitlab.com/gitlab-org/gitlab-ce/issues/37431
2017-11-21 13:53:26 +01:00
digitalMoksha
cba68d338b
use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers`
...
since `Rails.application.routes.url_helpers` creates a new anonymous module every time it's called
2017-11-21 13:29:57 +01:00
Stan Hu
3c52e2f06e
Optimize read-only middleware so that it does not consume as much CPU
...
In !15082 , we changed the behavior of the middleware to call
`Rails.application.routes.recognize_path` whenever a new route arrived.
However, this can be a CPU-intensive task because Rails needs to allocate
memory and compile 850+ different regular expressions, which are complicated
in GitLab.
As a short-term fix, we can do a lightweight string match before
we do the heavier comparison.
Closes #40185 , gitlab-com/infrastructure#3240
2017-11-20 15:27:52 -08:00
Douwe Maan
c043ba67c2
Merge branch '40292-bitbucket-import-hashed-storage' into 'master'
...
Fix bitbucket wiki import with hashed storage enabled
Closes #40292
See merge request gitlab-org/gitlab-ce!15490
2017-11-20 18:08:36 +00:00
Nick Thomas
f2977c63a8
Fix bitbucket wiki import with hashed storage enabled
2017-11-20 16:14:41 +00:00
Douwe Maan
4b78f70fc4
Merge branch 'gitaly-delete-refs' into 'master'
...
Incorporate Gitaly's RefService.DeleteRefs RPC
Closes gitaly#740
See merge request gitlab-org/gitlab-ce!15460
2017-11-20 15:20:40 +00:00
Douwe Maan
bd026b6a28
Merge branch 'bvl-dont-move-projects-using-hashed-storage' into 'master'
...
Don't move project repository/attachments when using hashed storage
Closes #40289
See merge request gitlab-org/gitlab-ce!15479
2017-11-20 13:48:20 +00:00
Bob Van Landuyt
fa39e8a09c
Don't move project repository/attachments when using hashed storage
...
When a project is using hashed storage, the repositories and
attachments wouldn't be saved on disk using the `full_path`. So the
migration would not do anything.
However: best to just skip moving when hashed storage is enabled.
2017-11-20 13:46:53 +01:00
Yorick Peterse
936e9e8950
Clean up schema of the "merge_requests" table
...
This adds various foreign keys and indexes to the "merge_requests" table
as outlined in https://gitlab.com/gitlab-org/gitlab-ce/issues/31825 .
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/31825
2017-11-20 12:45:33 +01:00
Douwe Maan
202ab62874
Merge branch 'fix-conflict-highlighting' into 'master'
...
Fix conflict highlighting
See merge request gitlab-org/gitlab-ce!15463
2017-11-20 10:17:43 +00: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
Alejandro Rodríguez
3f0c9e9708
Fix Gitlab::Git::Repository#remote_tags using unexisting variable
2017-11-20 09:08:09 +00:00
Alejandro Rodríguez
38730a2d07
Incorporate Gitaly's RefService.DeleteRefs RPC
2017-11-17 18:08:50 -03:00
Sean McGivern
64a9e53bd1
Fix conflict highlighting
...
Conflicts used to take a `Repository` and pass that to
`Gitlab::Highlight.highlight`, which would call `#gitattribute` on the
repository. Now they use a `Gitlab::Git::Repository`, which didn't have that
method defined - but defining it on `Gitlab::Git::Repository` does make it
available on `Repository` through `method_missing`, so we can do that and both
cases will work.
2017-11-17 17:57:48 +00:00
Douwe Maan
371180a47d
Merge branch 'mk-add-user-rate-limits' into 'master'
...
Add request rate limits
Closes #30053
See merge request gitlab-org/gitlab-ce!14708
2017-11-17 16:11:22 +00:00
Francisco Javier López
c7cf68bd6f
Changing OAuth lookup to be case insensitive
2017-11-17 14:24:25 +00:00
Sean McGivern
69dd59aec9
Merge branch 'dm-go-get-blank-enabled-protocol' into 'master'
...
Fix go-import meta data when enabled_git_access_protocol is a blank string
Closes #40256
See merge request gitlab-org/gitlab-ce!15448
2017-11-17 12:35:05 +00:00
Francisco Lopez
4188c10c07
Renaming AuthenticationException to AuthenticationError
2017-11-17 13:33:21 +01:00
Douwe Maan
f767dd4a4d
Fix go-import meta data when enabled_git_access_protocol is a blank string
2017-11-17 12:17:16 +01:00
Stan Hu
5cecff893d
Convert migration to populate latest merge request ID into a background migration
...
This is to smear updates over a few hours to avoid causing excessive
replication lag as seen in https://gitlab.com/gitlab-com/infrastructure/issues/3235 .
2017-11-17 10:23:48 +00: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
130a9933fe
Added UserAuthFinders spec
2017-11-17 10:02:11 +01:00
Francisco Lopez
8e57cc7e41
Added RequestAuthenticator spec
2017-11-17 10:02:11 +01:00