Commit Graph

4708 Commits

Author SHA1 Message Date
Imre Farkas d4d6528c86
Expire correct method caches after HEAD changed 2018-06-29 17:41:57 +02:00
Grzegorz Bizon 90a99ff3aa Add pipeline stages position clean-up migration 2018-06-29 13:57:52 +00:00
Sean McGivern 2c2422d54e Fix MR diffs created with gitaly_diff_between enabled
When we save merge request diffs to the database, we need to expand the diff
before doing so. That's so that we can expand diffs (within the normal limits)
without hitting the repository, but just by going to the database.

This is done implicitly - diffs are expanded unless we say otherwise. However,
we have another option we can pass, that lets us enforce diff size limits, that
defaults to true.

Prior to this commit:

- The Rugged code path defaulted to setting `expanded: true` and
  `enforce_limits: true`.
- The Gitaly code path defaulted to setting `expanded: false` and
  `enforce_limits: true`.

This was introduced by eb36fa17a6, which
implemented the initial feature. Since then, if the `gitaly_diff_between`
feature flag was enabled, MRs would have diffs that could not be expanded in
some cases, with no fix other than to disable the feature flag and force push to
the MR to refresh the diff in the database.
2018-06-29 14:25:35 +01:00
Sean McGivern 2dfddddd7b Merge branch 'dm-favicon-asset-host' into 'master'
Always serve favicon from main GitLab domain so that CI badge can be drawn over it

Closes #47802

See merge request gitlab-org/gitlab-ce!20263
2018-06-29 09:51:09 +00:00
Rémy Coutable 3223771beb Merge branch 'rails5-fix-48430' into 'master'
Rails5 fix MySQL milliseconds problem in specs

Closes #48430

See merge request gitlab-org/gitlab-ce!20221
2018-06-29 09:37:29 +00:00
Douwe Maan f83f1db4bd
Read asset host from ActionController::Base instead of application config 2018-06-29 11:22:51 +02:00
Sean McGivern 7c6d7accff Merge branch 'osw-delete-non-latest-mr-diff-files-migration' into 'master'
Schedule workers to delete non-latest diffs in post-migration

See merge request gitlab-org/gitlab-ce!20013
2018-06-29 06:25:15 +00:00
Jan Provaznik 26a8472d6d Don't add bottom 'match' line for deleted files
If a file is deleted, its new_pos is 0 (less than
total_blob_lines), but there is no reason to add the
bottom 'match' line in this case because there is not
extra content which could be expanded.
2018-06-28 22:53:35 +02:00
Oswaldo Ferreira 31d8464f67 Schedule workers to delete non-latest diffs in post-migration 2018-06-28 10:58:32 -03:00
Douwe Maan e28896ce0d Merge branch 'zj-find-all-commits' into 'master'
FindAllCommits mandatory

Closes gitaly#326

See merge request gitlab-org/gitlab-ce!20242
2018-06-28 13:11:00 +00:00
Douwe Maan 37b1922237 Merge branch 'zj-commits-between-mandatory' into 'master'
Commits between in Gitaly only

Closes gitaly#315

See merge request gitlab-org/gitlab-ce!20239
2018-06-28 13:10:07 +00:00
Zeger-Jan van de Weg ec78d29a6e
FindAllCommits mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/326
2018-06-28 13:42:10 +02:00
Zeger-Jan van de Weg f369da063f
Commits between in Gitaly only
Prior to this change, most the commits counted were done through Gitaly.
This removes the last point where this wasn't the case.

This makes the `rugged_count_commits` method obsolete, with its tests.

Closes https://gitlab.com/gitlab-org/gitaly/issues/315
2018-06-28 12:09:20 +02:00
Marin Jankovski 080cbda585
Drop the spec in YamlProcessor that reads current .gitlab-ci.yaml. If the .yaml file is not valid, specs would not run in CI. 2018-06-28 12:01:16 +02:00
Douwe Maan e38db19659 Merge branch 'gitaly-mandatory-20180627-jv-2' into 'master'
Make Gitaly signature RPC's mandatory

Closes gitaly#745, gitaly#1044, and gitaly#876

See merge request gitlab-org/gitlab-ce!20212
2018-06-28 07:45:31 +00:00
Toon Claes 48901bdecf Bring Gitlab::ShardHealthCache to CE
It already existed in EE in the Geo namespace. This change brings it
to CE.
2018-06-27 21:43:23 +02:00
Jasper Maes f0eaf22553 Rails5 fix MySQL milliseconds problem in specs 2018-06-27 18:49:22 +02:00
Jacob Vosmaer f4d6834786 Make Gitaly signature RPC's mandatory 2018-06-27 14:32:09 +02:00
Jan Provaznik 249c24891a Updated multipart to support workhorse direct uploads 2018-06-27 12:54:46 +02:00
James Lopez 4eebd231b8
update code based on feedback 2018-06-27 11:53:51 +02:00
Zeger-Jan van de Weg 65840591cd
Gitaly metrics check for read/writeability
Prior to this change, health checks checked for writeability of the NFS
shards. Given we're moving away from that, this patch extends the checks
for Gitaly to check for read and writeability.

Potentially some dashboards will break, as over time these metrics will
no longer appear as Prometheus doesn't get the data anymore.
Observability in the circuit breaker will be reduced, but its not
expected to be turned on and the circuit breaker is being removed soon
too.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1218
2018-06-27 08:56:19 +02:00
Sean McGivern d3d9077830 Add a helper to rename a column using a background migration
This works the same way as change_column_type_using_background_migration, but
for renaming a column. It takes a table, not a relation, to match its concurrent
counterpart.

Also, generalise the cleanup migrations to reduce code duplication.
2018-06-26 13:54:52 +01:00
Roger Rüttimann 2efe27ba18 Honor saml assurance level to allow 2FA bypassing 2018-06-25 15:32:03 +00:00
Douwe Maan 77fe416681 Merge branch 'zj-create-from-bundle-mandatory' into 'master'
Moves CreateFromBundle RPC to mandatory

Closes gitaly#944

See merge request gitlab-org/gitlab-ce!20144
2018-06-25 15:29:57 +00:00
Douwe Maan 246ce5b5f9 Merge branch 'zj-write-config' into 'master'
Write Config is mandatory

Closes gitaly#879

See merge request gitlab-org/gitlab-ce!20146
2018-06-25 15:27:41 +00:00
Douwe Maan c73ecd3295 Merge branch 'zj-tree-entry-mandatory' into 'master'
Gitaly tree entry is mandatory

Closes gitaly#310

See merge request gitlab-org/gitlab-ce!20099
2018-06-25 15:22:57 +00:00
Zeger-Jan van de Weg 29b4d657be
Moves another RPC to mandatory
This specific one isn't used on most machines, therefor low risk.

Closes https://gitlab.com/gitlab-org/gitaly/issues/944
2018-06-25 15:55:22 +02:00
Grzegorz Bizon 7a99a8c2ce Merge branch 'enforce-variable-value-to-be-a-string' into 'master'
Enforce setting string as value of the CI/CD variable

Closes #48210

See merge request gitlab-org/gitlab-ce!20061
2018-06-25 13:14:35 +00:00
Zeger-Jan van de Weg 0855478726
Write Config is mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/879
2018-06-25 15:08:20 +02:00
Tomasz Maczukin 156339569d
Enforce setting string as value of the CI/CD variable 2018-06-25 14:48:34 +02:00
Zeger-Jan van de Weg e91b2b5dff
Gitaly tree entry is mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/310
2018-06-25 13:48:28 +02:00
Ben Kochie 78a9991543
Cleanup ruby sampler metrics
* Use a simple counter for sampler duration instead of a histogram.
* Use a counter to collect GC time.
* Remove unused objects metric.
* Cleanup metric names to match Prometheus conventions.
* Prefix generic GC stats with `gc_stat`.
* Include worker label on memory and file descriptor metrics.
2018-06-22 14:12:22 +02:00
James Lopez d8252efea9
fix spec 2018-06-22 09:55:16 +02:00
James Lopez fb5ca695c4
fix spec 2018-06-22 09:54:44 +02:00
James Lopez 35d69ccf95
add more specs and refactor more relation factory code 2018-06-22 09:48:44 +02:00
James Lopez 3d3e441c91
refactor code based on feedback 2018-06-22 09:00:10 +02:00
Robert Speicher e446e8712c Merge branch 'ce-6436-6149-unify-project_creator_spec' into 'master'
CE: Resolve "Extract EE specific files/lines for project_creator_spec"

See merge request gitlab-org/gitlab-ce!19850
2018-06-21 14:57:58 +00:00
Yorick Peterse 9e29408ee6
Don't expose project names in various counters
Various counters would expose either project names, or full project
paths (e.g. "gitlab-org/gitlab-ce"). This commit changes various places
where we use "add_event" so we no longer expose (potentially) private
information.
2018-06-21 16:56:40 +02:00
Sean McGivern 60f51cd20a Merge branch 'da-usage-ping' into 'master'
Add enabled prefix to feature keys to be consistent with other keys

See merge request gitlab-org/gitlab-ce!20043
2018-06-21 09:41:27 +00:00
Lin Jen-Shin 562f357ba5 Implement `expect_next_instance_of` and use it
We need this because `expect_any_instance_of` doesn't work on
prepended models. Now we could use the same code between CE/EE
2018-06-21 16:32:07 +08:00
Zeger-Jan van de Weg 2ac672280b
Raw changes calculation is Gitaly only now
Closes https://gitlab.com/gitlab-org/gitaly/issues/1138
2018-06-21 10:12:51 +02:00
Michael Kozono 7d91984ced Avoid N+1 queries while processing uploads 2018-06-20 10:38:17 -07:00
Douglas Barbosa Alexandre 727bba8ef5
Add enabled prefix to feature keys to be consistent with other keys 2018-06-20 14:16:14 -03:00
Stan Hu 88ceef87e3 Merge branch 'limit-metrics-content-type' into 'master'
Limit the action suffixes in transaction metrics

See merge request gitlab-org/gitlab-ce!20032
2018-06-20 16:34:42 +00:00
Stan Hu c9eb56d511 Merge branch 'remove-allocations-gem' into 'master'
Remove remaining traces of the Allocations Gem

See merge request gitlab-org/gitlab-ce!20029
2018-06-20 16:33:22 +00:00
James Lopez b0ddc55dc7
refactor code once again to fix IID issues 2018-06-20 16:18:40 +02:00
Alexis Reigel b612670cc0 Fix: Serve favicon image always from the main GitLab domain to avoid issues with CORS 2018-06-20 14:00:13 +00:00
James Lopez 8522173e0a
refactor code once again to fix IID issues 2018-06-20 15:45:15 +02:00
Sean McGivern 6e4d67e099 Fix hook data specs 2018-06-20 14:13:24 +01:00
Satish Perala 9170aab92e Passing absolute image urls in the markdown content in the webhooks 2018-06-20 14:13:23 +01:00
Yorick Peterse d527b46802
Remove remaining traces of the Allocations Gem
In MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15834 we
removed use of the data produced by the Allocations Gem. However, we
never removed the code that just enables tracking of allocations. In
this commit we remove all remaining traces of this Gem.
2018-06-20 15:11:10 +02:00
Yorick Peterse d73e68deb5
Limit the action suffixes in transaction metrics
There seem to be a lot of cases where the suffix of an action (e.g.
".html") is set to bogus data, such as "*/*" or entire URLs. This can
increase cardinality of our metrics, and isn't very useful for
monitoring and filtering. To work around this, we enforce a whitelist
containing a few suffixes we actually care about. Suffixes not supported
will be grouped under the action without a suffix. This means that a
request to "FooController#bar.jpeg" will be assigned to
"FooController#bar".
2018-06-20 14:35:04 +02:00
Mayra Cabrera 5841e92390 Resolve "Unable to install Prometheus on Clusters: 'Error: Chart incompatible with Tiller v2.7.0'" 2018-06-20 12:10:14 +00:00
James Lopez cc061cd1c6
fix some more edge cases 2018-06-20 11:57:22 +02:00
Sean McGivern 329b00672d Merge branch 'ce-5024-filename-search' into 'master'
Implement filtering by filename on code search

Closes #43627

See merge request gitlab-org/gitlab-ce!19509
2018-06-20 09:20:27 +00:00
Douwe Maan c67d8c2478 Merge branch 'zj-lfs-pointers' into 'master'
LFS changes are detected by Gitaly

Closes gitaly#935

See merge request gitlab-org/gitlab-ce!19995
2018-06-20 08:29:47 +00:00
Mario de la Ossa 7357209f91
Implement filtering by filename on code search 2018-06-19 09:30:09 -06:00
James Lopez 825c68e2ed
fix some edge cases 2018-06-19 17:08:02 +02:00
Douwe Maan c0f0ccf222 Merge branch 'zj-force-push-opt-out' into 'master'
Force push is handled by Gitaly now

Closes gitaly#348

See merge request gitlab-org/gitlab-ce!19992
2018-06-19 14:19:18 +00:00
Douwe Maan 38edd5c33e Merge branch 'zj-fork-mandatory' into 'master'
Move forking to Gitaly

Closes gitaly#817 and gitaly#1236

See merge request gitlab-org/gitlab-ce!19990
2018-06-19 14:00:22 +00:00
Zeger-Jan van de Weg 64cda7746c
LFS changes are detected by Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/935
2018-06-19 15:59:27 +02:00
Zeger-Jan van de Weg c2cdefd441
Force push is handled by Gitaly now
Closes gitlab-org/gitaly#348
2018-06-19 15:35:17 +02:00
Douwe Maan b0fadeee83 Merge branch 'zj-counting-commits' into 'master'
Counting commits is done by Gitaly

Closes gitaly#382

See merge request gitlab-org/gitlab-ce!19983
2018-06-19 12:45:49 +00:00
Sean McGivern d6c57146c5 Merge branch 'sh-optimize-locks-check-ce' into 'master'
Eliminate N+1 queries in LFS file lock checks during a push

See merge request gitlab-org/gitlab-ce!19978
2018-06-19 11:40:52 +00:00
Zeger-Jan van de Weg 1dc0332726
Move forking to Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/817

Closes https://gitlab.com/gitlab-org/gitaly/issues/1236
2018-06-19 13:30:54 +02:00
Douwe Maan f70c581d1f Merge branch 'zj-linguist-gitaly-mandatory' into 'master'
Move language detection to mandatory

Closes gitaly#732 and gitaly#360

See merge request gitlab-org/gitlab-ce!19985
2018-06-19 09:56:45 +00:00
Douwe Maan 7a42d86581 Merge branch 'zj-gitaly-license-detection' into 'master'
License detection happens solely through Gitaly now

Closes gitaly#1026

See merge request gitlab-org/gitlab-ce!19986
2018-06-19 09:55:13 +00:00
James Lopez fe56d29d30
update spec 2018-06-19 11:25:58 +02:00
Zeger-Jan van de Weg c24e39ab88
Counting commits is done by Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/382
2018-06-19 10:37:51 +02:00
James Lopez b99bc6d380
add group finder spec and logic 2018-06-19 09:54:47 +02:00
Rémy Coutable 41d01281ce Merge branch 'rs-spec-lib-gitlab-ci-parity' into 'master'
Extract EE specific files/lines for spec/lib/gitlab/ci

See merge request gitlab-org/gitlab-ce!19971
2018-06-19 07:37:28 +00:00
Zeger-Jan van de Weg da8419a1ba
License detection happens soley through Gitaly now
Migration: https://gitlab.com/gitlab-org/gitaly/issues/1026

Conflicts:
	lib/gitlab/git/repository.rb
2018-06-19 09:35:15 +02:00
Zeger-Jan van de Weg 9ae8b57467
Move language detection to mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/732
Closes https://gitlab.com/gitlab-org/gitaly/issues/360
2018-06-19 09:29:54 +02:00
Rémy Coutable 0f18d4896c Merge branch 'rails5-nil-formats' into 'master'
Fix nil formats test

Closes #47833

See merge request gitlab-org/gitlab-ce!19941
2018-06-19 07:27:01 +00:00
Stan Hu 4f9068dfc0 Eliminate N+1 queries in LFS file locks checks during a push
This significantly improves performance when a user pushes many references.

project.path_locks.any? doesn't cache the output and runs `SELECT 1 AS one
FROM "path_locks" WHERE project_id = N` each time. When there are thousands
of refs being pushed, this can time out the unicorn worker.

CE port for https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6159.
2018-06-18 16:42:20 -07:00
Robert Speicher 6a684432ee
Correct CE-EE parity in two CI-related specs 2018-06-18 15:22:04 -05:00
Robert Speicher 557f4e6a43
CE-EE parity to spec/lib/gitlab/ci/config_spec.rb 2018-06-18 14:25:28 -05:00
Robert Speicher 9c48089190
CE-EE parity to spec/lib/gitlab/ci/yaml_processor_spec.rb 2018-06-18 14:22:38 -05:00
Robert Speicher 5679beb228
CE-EE parity for spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb 2018-06-18 14:21:37 -05:00
Rémy Coutable 52dea971e9 Merge branch 'bvl-i18n-validation' into 'master'
Updates to `.po` & `.pot` linting

Closes #46096 et #39292

See merge request gitlab-org/gitlab-ce!18779
2018-06-18 17:10:26 +00:00
James Lopez ac66547370
add spec replicating both label and milestone duplicated title issues 2018-06-18 15:17:03 +02:00
James Lopez f5e4adc9bf
add spec replicating both label and milestone duplicated title issues 2018-06-18 15:14:20 +02:00
Rémy Coutable 2a82179e10 Merge branch 'expose-clean-backtrace-method-from-profiler' into 'master'
Expose a clean_backtrace method from Gitlab::Profiler

See merge request gitlab-org/gitlab-ce!19894
2018-06-18 09:02:42 +00:00
Jacob Vosmaer (GitLab) 14000a561b Make Gitaly wiki RPC's mandatory 2018-06-18 08:19:11 +00:00
Jan Provaznik 20adfb5369 Fix nil formats test
One of the spec files sets `nil` value for env varialbe
`action_dispatch.request.formats`. Rather than setting `nil` value,
we can delete the `action_dispatch.request.formats` key from `env`
(which should be closer to real use case anyway). The reason is that
in Rails 5, `formats` method does not set default array of formats
if the env key is already set (even if set to `nil`).
2018-06-16 21:20:58 +02:00
Bob Van Landuyt 17fc178cb5 Correctly translate all forms in tests 2018-06-15 14:58:47 +02:00
Bob Van Landuyt 3b5ce6945d Validate PO-variable usage in message ids
That way we can detect incorrect usage before the strings are added to
Crowdin for translation
2018-06-15 14:58:46 +02:00
Bob Van Landuyt ca065e493e Forbids combining named and unnamed variables in `gitlab.pot`
This would break with an argument error when interpolating using
`sprintf` in ruby.
2018-06-15 14:58:46 +02:00
Sean McGivern d304f88352 Expose a clean_backtrace method from Gitlab::Profiler
This method makes it easier for other parts of the app to get clean backtraces,
as well as console users.
2018-06-15 13:29:55 +01:00
Douwe Maan 5fc3b8a08d
Remove FaviconUploader favicon_main version
See https://gitlab.com/gitlab-org/gitlab-ce/issues/47677 for more information
2018-06-15 12:28:23 +02:00
Sean McGivern 17335a42ae Merge branch 'rails5-database' into 'master'
Fix table_exists? to be Rails5 compatible

Closes #45107

See merge request gitlab-org/gitlab-ce!19418
2018-06-14 13:12:37 +00:00
Sean McGivern beba4a1d1c Merge branch 'zj-mandatory-batch' into 'master'
Move Gitaly RPCs to mandatory

Closes gitaly#217, gitaly#389, gitaly#390, gitaly#220, gitaly#376, and gitaly#354

See merge request gitlab-org/gitlab-ce!19759
2018-06-14 12:16:05 +00:00
Jacob Vosmaer (GitLab) 5cf5680f9c Deny repository disk access in development and test 2018-06-14 11:18:25 +00:00
Zeger-Jan van de Weg 3ed4a1b3aa
HasLocalBranches check is done by Gitaly only
Closes https://gitlab.com/gitlab-org/gitaly/issues/217
2018-06-14 10:31:24 +02:00
Zeger-Jan van de Weg 89ab32c6b2
Branches are fully migrated to Gitaly
Closes: https://gitlab.com/gitlab-org/gitaly/issues/389
2018-06-14 10:25:28 +02:00
Zeger-Jan van de Weg 4fc4600747
Default branch detection happens through Gitaly
Migration: https://gitlab.com/gitlab-org/gitaly/issues/220
2018-06-14 09:56:16 +02:00
Jarka Kadlecová fa36101a7f Use data_source_exists? instead of table_exists?
Use data_source_exists? where possible instead of table_exists? in order to be Rails5 compatible
2018-06-14 08:39:43 +02:00
Michael Kozono 2f40fb456b Add support for verifying remote uploads, artifacts, and LFS objects in check rake tasks 2018-06-13 17:11:43 +00:00
Zeger-Jan van de Weg f195a7436d
RawBlame only called through Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/376
2018-06-13 16:44:59 +02:00
Zeger-Jan van de Weg e4a9b0771a
ListCommitByOid isn't called with an empty batch
Batching commits for performance improvements, might lead to empty
batches being used. This isn't the case yet, but to guard against this
in future cases, a guard clause is added.
2018-06-13 15:23:34 +02:00
Jan 1721bbcb01 Resolve "Quick actions are case sensitive" 2018-06-13 10:23:57 +00:00
Mario de la Ossa 379a6a709a
Sidebar Milestone - Fix wrong URL when selecting a parent group milestone 2018-06-12 17:22:12 -06:00
Nick Thomas 893c824ed3 Merge branch 'pr-importer-io-extra-error-handling' into 'master'
Ensure MR diffs always exist in the PR importer

Closes #47312

See merge request gitlab-org/gitlab-ce!19704
2018-06-12 14:08:51 +00:00
Douwe Maan 8b0d2283d7 Merge branch 'gitaly-disk-access-3' into 'master'
Find and mark more Git disk access locations, part 2

See merge request gitlab-org/gitlab-ce!19437
2018-06-12 13:32:46 +00:00
Jacob Vosmaer f376347f24 Find and mark more Git disk access locations, part 2 2018-06-12 14:33:37 +02:00
Francisco Javier López ab93f7cc79 Bumping gitlab-gollum-lib and gitlab-gollum-rugged_adapter 2018-06-12 12:31:10 +00:00
Yorick Peterse e4612df0e2
Ensure MR diffs always exist in the PR importer
In rare cases it could happen that an MR was created, but creating the
MR diffs somehow failed (e.g. due to an error). This commit adds an
additional check to make sure MR diffs are always present when importing
GitHub pull requests.
2018-06-12 13:30:41 +02:00
Yorick Peterse 450b9f6e30 Merge branch 'da-port-cte-to-ce' into 'master'
Add Gitlab::SQL:CTE for easily building CTE statements

See merge request gitlab-org/gitlab-ce!19652
2018-06-12 10:46:31 +00:00
Mayra Cabrera 421957cf8c Merge branch 'sh-expire-content-cache-after-import' into 'master'
Expire Wiki content cache after importing a repository

Closes #47546

See merge request gitlab-org/gitlab-ce!19617
2018-06-11 17:35:39 +00:00
Douglas Barbosa Alexandre fe8261fdb2
Add Gitlab::SQL:CTE for easily building CTE statements 2018-06-11 12:44:08 -03:00
Stan Hu 6defeb0a7d Expire Wiki content cache after importing a repository
The cache state for Wikis that were imported via GitHub or Bitbucket does
not appear to have been flushed after a successful import.

Closes #47546
2018-06-11 08:33:06 -07:00
Sean McGivern 75797ac3d2 Merge branch '47684-uploads-specs-are-failing-on-master' into 'master'
Resolve "Uploads specs are failing on master"

Closes #47684

See merge request gitlab-org/gitlab-ce!19638
2018-06-11 15:01:45 +00:00
Francisco Javier López 1418afc2d6 Avoid checking the user format in every url validation 2018-06-11 13:29:37 +00:00
Rémy Coutable 0f90c1fd73
Don't use Rails.root.join for upload fixture paths
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-06-11 13:54:25 +02:00
Jacob Vosmaer (GitLab) ea8dc10772 Don't use Gitlab::Utils.nlbr in Gitlab::Git 2018-06-11 10:42:09 +00:00
Rémy Coutable 7d3bbeeb31 Merge branch 'rs-update-rspec' into 'master'
Update rspec to 3.7

See merge request gitlab-org/gitlab-ce!19449
2018-06-11 09:59:25 +00:00
Mark Chao 68cb1c2651 Revert rename allow collaboration column 2018-06-08 13:12:51 +00:00
Kamil Trzciński b780efab26 Merge remote-tracking branch 'origin/master' into 38542-application-control-panel-in-settings-page 2018-06-07 20:27:30 +02:00
Douwe Maan 290ca339ad Merge branch 'feature/customizable-favicon' into 'master'
Customizable favicon

Closes #15661

See merge request gitlab-org/gitlab-ce!14497
2018-06-07 16:54:41 +00:00
Douwe Maan 7b562c9727 Merge branch 'sh-fix-schema-migrations-seq-scans' into 'master'
Avoid sequential scans loading schema_migrations table when loading application settings

See merge request gitlab-org/gitlab-ce!19541
2018-06-07 16:53:56 +00:00
Gabriel Mazetto 36c3376475 Resolve "Hashed Storage: Make possible to migrate single project" 2018-06-07 15:40:44 +00:00
Rémy Coutable 6afe6fa6bc
Make Gitlab::CurrentSettings.current_application_settings return cached settings early if they exist without issuing any DB query
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-06-07 17:23:49 +02:00
Balasankar C 9f76632d80 Add installation type to usage ping data 2018-06-07 15:01:20 +00:00
Robert Speicher 6d165c740c Make all uses of `fixture_file_upload` use relative paths 2018-06-07 09:54:41 -05:00
George Tsiolis 93c7976ae2 Restore navigation theme order 2018-06-07 12:24:57 +00:00
Douwe Maan 543459794a Merge branch 'fj-move-rev-list-option' into 'master'
Moving rev-list lfs options to LfsChanges

See merge request gitlab-org/gitlab-ce!19497
2018-06-07 08:18:50 +00:00
Annabel Gray 164dbc6b77 Resolve "Introduce new navigation themes in GitLab 11.0" 2018-06-07 07:37:02 +00:00
Francisco Javier López 86d39016a2
Moving rev-list lfs options to Lfschanges 2018-06-06 21:55:32 +02:00
Matija Čupić 9efb1875b7
Merge branch 'master' into 38542-application-control-panel-in-settings-page 2018-06-06 21:29:12 +02:00
Francisco Javier López e8f49b4bee Support LFS objects when creating a project by import 2018-06-06 16:42:18 +00:00
Sean McGivern e9ad837cf0 Merge branch '42751-rename-master-to-maintainer' into 'master'
Resolve "Rename the `Master` role to `Maintainer`"

Closes #42751

See merge request gitlab-org/gitlab-ce!19080
2018-06-06 15:00:24 +00:00
Kamil Trzciński 96747556e7 Merge branch 'live-trace-v2-persist-data' into 'master'
Live trace: Rescue stale live trace

See merge request gitlab-org/gitlab-ce!18680
2018-06-06 12:45:41 +00:00
Mark Chao a6c15c5b97 change wording 2018-06-06 21:01:44 +09:00
Yorick Peterse 4083ea1c74 Merge branch 'rails5-fix-47376' into 'master'
Rails 5 fix glob spec

Closes #47376

See merge request gitlab-org/gitlab-ce!19469
2018-06-06 11:10:22 +00:00
Douwe Maan 45444c8e30 Merge branch '47189-github_import_visibility' into 'master'
Use Github repo visibility during import while respecting restricted visibility levels

Closes #47189

See merge request gitlab-org/gitlab-ce!19450
2018-06-06 10:54:43 +00:00
Douwe Maan af9cc234f2 Merge branch 'bvl-graphql-start-34754' into 'master'
GraphQL setup: Basic Project and Merge request endpoint

Closes #34754

See merge request gitlab-org/gitlab-ce!19008
2018-06-06 10:03:34 +00:00
Imre Farkas c5e44dc5d1
Use Github repo visibility during import while respecting restricted visibility levels 2018-06-06 12:00:15 +02:00
Shinya Maeda 32f825c648 Add tests for each new code 2018-06-06 17:49:48 +09:00
Jasper Maes 2d1faddbcb Rails 5 fix glob spec 2018-06-06 08:50:11 +02:00
Robert Speicher a34666e655 Merge branch 'sh-reject-non-utf8-gpg' into 'master'
Reject GPG keys that have e-mail or names with non-valid UTF-8 encodings

Closes #47280

See merge request gitlab-org/gitlab-ce!19455
2018-06-05 22:07:35 +00:00
Stan Hu 36a8f1a677 Reject GPG keys that have e-mail or names with non-valid UTF-8 encodings
These were causing 500 Errors when accessing GPG keys for some users.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/47280
2018-06-05 14:39:44 -07:00
Nick Thomas 65dbead796
Fix repository archive generation when hashed storage is enabled 2018-06-05 20:44:07 +01:00
Nick Thomas 9c6c17cbcd Add a minimal GraphQL API 2018-06-05 20:47:42 +02:00
Kamil Trzciński ced0b4453e Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
# Conflicts:
#   db/schema.rb
2018-06-05 16:46:43 +00:00
Jacob Vosmaer (GitLab) a0808df0b6 Find and mark more Git disk access locations 2018-06-05 15:51:14 +00:00
Robert Speicher 6ced2f1243 Merge branch '42751-rename-mr-maintainer-push' into 'master'
Rephrase Merge Request Maintainer Edit

See merge request gitlab-org/gitlab-ce!19061
2018-06-05 15:04:18 +00:00
Alexis Reigel 949c30d42b
remove all .ico favicon variations, use png always
the ci status icons are generated client side, wo we don't need the
static files anymore.
2018-06-05 16:20:22 +02:00
Alexis Reigel 9e14f437b6
create favicon overlay on the client
the initial reason for this change was that graphicsmagick does not
support writing to ico files. this fact lead to a chain of changes:

1. use png instead of ico (browser support is good enough)
2. render the overlays on the client using the canvas API. this way we
   only need to store the original favion and generate the overlay versions
   dynamically.
   this change also enables (next step) to simplify the handling of the
   stock favicons as well, as we don't need to generate all the versions
   upfront.
2018-06-05 16:20:21 +02:00
Alexis Reigel 67fe0a17d8
call Gitlab::Favicon.status in serializer
this ways we can keep the `lib/gitlab/ci/status/*` classes to return the
bare favicon name as it was before.

also the favicon uploader versions are now have the same names as the
stock favicons (+ `favicon_` prefix), which makes working with the
status names easier.
2018-06-05 16:20:21 +02:00
Alexis Reigel 40ffa8401b
add request store caching to favicon 2018-06-05 16:20:21 +02:00
Alexis Reigel 822023c64c
Add a '?' to the custom favicon's urls
Without the '?' at the end of the favicon url the custom favicon (i.e.
the favicons that are served through `UploadController`) are not shown
in the browser. It may have something to do with how `#send_file` /
`#send_data` set http headers. When serving the same icon file from the
public directory everything is fine.
2018-06-05 16:20:20 +02:00
Alexis Reigel 44d7b15833
use custom favicon for ci build status favicons 2018-06-05 16:20:19 +02:00
Alexis Reigel a6f3f6b8cd
extract favicon logic to lib class 2018-06-05 16:20:19 +02:00
Grzegorz Bizon da246582db Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
# Conflicts:
#   db/schema.rb
2018-06-05 13:51:31 +00:00
Jacob Vosmaer (GitLab) 3a4ecfd0c9 Prevent Gitaly WriteConfig log noise 2018-06-05 12:55:41 +00:00
Kamil Trzciński 40dc82f862 Merge branch 'add-background-migrations-for-not-archived-traces' into 'master'
Add background migrations to archive legacy job traces

Closes #46642

See merge request gitlab-org/gitlab-ce!19194
2018-06-05 12:35:21 +00:00
Nick Thomas 049519e718 Merge branch 'override-consider-extend' into 'master'
Also verify if extending would override a class method

See merge request gitlab-org/gitlab-ce!19377
2018-06-05 12:11:58 +00:00
Nick Thomas 9ca8d88b07 Merge branch 'gh-importer-transactions' into 'master'
Perform pull request IO work outside a transaction

See merge request gitlab-org/gitlab-ce!19372
2018-06-05 11:11:36 +00:00
Grzegorz Bizon 809a50fcbf Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
Conflicts:
   app/models/ci/pipeline.rb
2018-06-05 07:39:59 +00:00
Lin Jen-Shin f71fc9328c Also verify if extending would override a class method
Since extending a class means including on the singleton class of the
class, this should now complain this:

``` ruby
module M
  extend Gitlab::Utils::Override

  override :f
  def f
    super.succ
  end
end

class C
  extend M

  def self.f
    0
  end
end
```

It should complain because `C.f` wasn't calling `M#f`.
This should pass verification:

``` ruby
module M
  extend Gitlab::Utils::Override

  override :f
  def f
    super.succ
  end
end

class B
  def self.f
    0
  end
end

class C < B
  extend M
end
```

Because `C.f` would now call `M#f`, and `M#f` does override something.
2018-06-05 13:40:52 +08:00
Oswaldo Ferreira f46739191a Adjust insufficient diff hunks being persisted on NoteDiffFile
This currently causes 500's errors when loading the MR page
(Discussion) in a few scenarios.

We were not considering detailed diff headers such as
"--- a/doc/update/mysql_to_postgresql.md\n+++ b/doc/update/mysql_to_postgresql.md"
to crop the diff. In order to address it, we're now using
Gitlab::Diff::Parser, clean the diffs and builds Gitlab::Diff::Line objects
we can iterate and filter on.
2018-06-05 01:02:30 -03:00
Yorick Peterse 71ed7987d3
Perform pull request IO work outside a transaction
When importing a GitHub pull request we would perform all work in a
single database transaction. This is less than ideal, because we perform
various slow Git operations when creating a merge request. This in turn
can lead to many DB connections being used, while just waiting for an IO
operation to complete.

To work around this, we now move most of the heavy lifting out of the
database transaction. Some extra error handling is added to ensure we
can resume importing a partially imported pull request, instead of just
throwing an error.

This commit also changes the specs for IssueImporter so they don't rely
on deprecated RSpec methods.
2018-06-04 18:33:56 +02:00
Francisco Javier López 7350eb1fa8 Add ability to search wiki titles 2018-06-04 11:41:37 +00:00
Douwe Maan 8c7bffa437 Merge branch 'sh-fix-issue-43981' into 'master'
Fix intermittent failing spec in spec/support/helpers/cycle_analytics_helpers.rb

Closes #43981

See merge request gitlab-org/gitlab-ce!19338
2018-06-04 08:45:40 +00:00
Shinya Maeda 8f1f73d4e3 Fix typo in spec. Add a test for the case of when trace is stored in database 2018-06-04 14:28:21 +09:00
Shinya Maeda bcd664f53a Fix specs. Rename migration file name which was conflicted with background migration's. 2018-06-04 14:14:20 +09:00
Shinya Maeda 0d00d02e84 Directly refer application code from migration code 2018-06-04 14:14:20 +09:00
Shinya Maeda 89b4304f12 Add background migrations to arhive legacy traces 2018-06-04 14:14:20 +09:00
Shinya Maeda eb05d475b7 Fix wording in spec. Add PIPELINE_IID in examples of debugged variables in documants. 2018-06-04 12:12:02 +09:00
Stan Hu d65cdd4416 Fix intermittent failing spec in spec/support/helpers/cycle_analytics_helpers.rb
There was a race condition in the spec where if the commit is created on disk
within a second of the frozen `Timecop` time, the test fails.

Closes #43981
2018-06-02 15:10:35 -07:00
Matija Čupić 5403a4a07e
Add deploy_strategy to safe model attributes 2018-06-02 11:46:55 +02:00
Shinya Maeda e8ecae7e0b Reveert build_relations and simply add a line for creating iid 2018-06-02 11:55:42 +09:00
Shinya Maeda b02b2602c1 Merge branch 'master' into per-project-pipeline-iid 2018-06-02 11:15:53 +09:00
Jacob Vosmaer (GitLab) edb9db37ed Add "deny disk access" Gitaly feature (tripswitch) 2018-06-01 11:56:29 +00:00
Francisco Javier López 840f80d48b Add validation to webhook and service URLs to ensure they are not blocked because of SSRF 2018-06-01 11:43:53 +00:00
Shinya Maeda c89e57842e Use shared examples for populate spec 2018-06-01 15:46:15 +09:00
Shinya Maeda c418d68765 Remove unneccesary spec 2018-06-01 15:41:33 +09:00
Shinya Maeda f7f60ab54a Add spec for variables expressions with pipeline iid 2018-06-01 14:53:00 +09:00
Shinya Maeda 4beeb60255 Fix populate_spec 2018-06-01 14:36:52 +09:00
Mark Chao 0d44f4d50e Rephrase "maintainer" to more precise "members who can merge to the target branch"
"Maintainer" will be freed to be used for #42751
2018-06-01 14:33:12 +09:00
Shinya Maeda 272b8dca80 Merge branch 'master' into per-project-pipeline-iid 2018-06-01 14:32:40 +09:00
Grzegorz Bizon 68ef6ae2da Merge branch '41587-osw-mr-metrics-migration-take-two' into 'master'
Take two for MR metrics population background migration

See merge request gitlab-org/gitlab-ce!19097
2018-05-31 15:08:50 +00:00
Imre Farkas 20dfe25c15 Export assigned issues in iCalendar feed 2018-05-31 14:01:04 +00:00
Douwe Maan 711ba61a78 Merge branch '46445-fix-gitaly-tree-entry-encoding' into 'master'
Fix encoding bug in Gitaly::Commit::TreeEntry

Closes #46445 and gitaly#1208

See merge request gitlab-org/gitlab-ce!19243
2018-05-31 09:55:05 +00:00
Francisco Javier López 4d3f7ae1ef
Removed API endpoint and specs 2018-05-30 18:23:07 +02:00
Kim "BKC" Carlbäcker 0db994fedc Fix encoding error in Gitaly::Commit::TreeEntry 2018-05-30 17:33:17 +02:00
Oswaldo Ferreira 54ad5fb8a2 Take two for MR metrics population background migration 2018-05-30 11:51:29 -03:00
Douwe Maan 62d96d8854 Merge branch 'fix/bitbucket_import_anonymous' into 'master'
Import bitbucket issues that are reported by an anonymous user

Closes #44381

See merge request gitlab-org/gitlab-ce!18199
2018-05-30 09:52:58 +00:00
Shinya Maeda 0e22b50df8 Add spec for variables expression 2018-05-30 16:42:55 +09:00
Phil Hughes fd79df64c5 Merge branch 'blackst0ne-squash-and-merge-in-gitlab-core-ce' into 'master'
Resolve "Squash and merge in GitLab Core (CE)"

Closes #34591

See merge request gitlab-org/gitlab-ce!18956
2018-05-30 07:38:31 +00:00
Shinya Maeda 09122f93c3 Merge branch 'master' into per-project-pipeline-iid 2018-05-30 14:50:09 +09:00
Mayra Cabrera 4aae86f6f7 Merge remote-tracking branch 'dev/master' 2018-05-29 13:51:31 -05:00
Mayra Cabrera 0033e57269 Merge branch 'security-fj-import-export-assignment' into 'master'
[master] Arbitrary assignment of Project fields using "Import project" from a Gitlab tar.gz

Closes #2678

See merge request gitlab/gitlabhq!2378
2018-05-29 18:43:04 +00:00
Grzegorz Bizon a2f6aa96a9 Merge branch 'master' into backstage/gb/use-persisted-stages-to-improve-pipelines-table
* master: (583 commits)
2018-05-29 17:24:50 +02:00
blackst0ne 4cff66a6c4 Add 'squash and rebase' feature to CE 2018-05-29 20:51:43 +11:00
Stan Hu 16e04e006c Log queue duration for Grape API calls
This mimics the same thing the RailsQueueDuration does for Rails controller
requests and will help diagnose issues with API delays.

Closes #46601
2018-05-28 13:56:42 -07:00
Shinya Maeda 1d20679e9c Merge branch 'master' into per-project-pipeline-iid 2018-05-28 20:01:56 +09:00
Yorick Peterse 265b1fafe6 Merge branch 'sh-fix-admin-page-counts-take-2' into 'master'
Fix fast admin counters not working when PostgreSQL has secondaries

Closes #46742

See merge request gitlab-org/gitlab-ce!19154
2018-05-28 10:36:26 +00:00
Douwe Maan a45b9fc96c Merge branch 'bvl-add-username-to-terms-message' into 'master'
Add username to terms message in git and API calls

Closes #46649

See merge request gitlab-org/gitlab-ce!19126
2018-05-28 09:53:58 +00:00
Stan Hu b6125f7045 Fix fast admin counters not working when PostgreSQL has secondaries
This commit does a number of things:

1. Reduces the number of queries needed by perform a single query to get all
the tuples for the relevant rows.

2. Uses a transaction to query the tuple counts to ensure that the data
is retrieved from the primary.

Closes #46742
2018-05-25 22:58:43 -07:00