Commit Graph

4816 Commits

Author SHA1 Message Date
Kamil Trzciński bdb06db0f6 Improve MetricGroup specs 2018-09-05 17:27:07 +02:00
Kamil Trzciński db467ad66d Improve MetricGroup test 2018-09-05 17:26:55 +02:00
Kamil Trzciński 1f19647c0e Fix safe_model_attributes 2018-09-04 14:58:12 +02:00
Kamil Trzciński bf84b2a3f0 Fix `additional_metrics_parser_spec.rb` 2018-09-04 12:19:23 +02:00
Kamil Trzciński 19854160bc Fix import/export 2018-09-04 12:19:23 +02:00
Kamil Trzciński e6d2465d97 Add `# frozen_string_literal: true` 2018-09-04 12:19:23 +02:00
Kamil Trzciński 0a9d771bcb Import common metrics into database.
This MR backports PrometheusMetric model to CE
and adds: common, identifier to figure out what kind of metric is used.
2018-09-04 12:19:22 +02:00
Douwe Maan c0625e5de1 Merge branch '6417-extract-ee-specific-files-lines-for-lib-gitlab-email-handler-rb' into 'master'
Extract EE-specific lines from Gitlab::Email::Handler

See merge request gitlab-org/gitlab-ce!21358
2018-09-03 12:59:52 +00:00
Sean McGivern 55465747aa Add frozen_string_literal: true to email handlers 2018-09-03 10:33:48 +01:00
Sean McGivern 74616ece28 Extract EE-specific lines from Gitlab::Email::Handler 2018-09-03 10:33:48 +01:00
Douwe Maan 472f2d5666 Merge branch '47765-group-visibility-error-due-to-string-conversion' into 'master'
Changes update_column to update_attributes in ProjectTreeRestorer#restore_project by using timeless to maintain the current timestamps

Closes #47765

See merge request gitlab-org/gitlab-ce!21242
2018-08-31 13:11:36 +00:00
Stan Hu 038be9fffa Fix Error 500s due to encoding issues when Wiki hooks fire
Saved Wiki content goes through the GitalyClient::WikiService, which calls
StringIO#set_encoding on the input stream. The problem is that this call
mutates the encoding of the given string object to ASCII-88BIT, which
causes problems for models expecting the data to still be in UTF-8.

Freezing the input disables this behavior:
https://github.com/ruby/ruby/blob/v2_4_4/ext/stringio/stringio.c#L1583

Closes #50590
2018-08-29 09:46:46 -07:00
Sean McGivern 8ba1f6aea4 Include rich_text in diff cache keys
Previously, this wasn't needed: text was normally set to the highlighted
contents anyway. Now, it is: we store different things in text and rich_text.

This caused https://gitlab.com/gitlab-com/production/issues/439.
2018-08-28 16:36:25 -05:00
Chantal Rollison beb8354b34 Escaped html characters 2018-08-28 16:36:25 -05:00
Michael Kozono b44ccb283f Resolve "Orphaned upload files are accessible via project exports" 2018-08-28 16:36:25 -05:00
Stan Hu 4ef1447c4f Block link-local addresses in URLBlocker
Closes https://gitlab.com/gitlab-com/migration/issues/766
2018-08-28 16:36:25 -05:00
Filipa Lacerda ec40b36905 Removes <br> sent from backend on tooltips in jobs
When backend sends HTML it requires frontend to append it to the DOM causing
XSS vulnerabilities. By removing the `<br>` we avoid those vulnerabilities
2018-08-28 16:36:25 -05:00
Tiago Botelho 6dfab42236 Changes update_column to update_attributes in ProjectTreeRestorer#restore_project by using timeless to maintain the current timestamps 2018-08-28 15:29:31 +02:00
Jasper Maes 83739b8b43 Rails5: fix can't quote ActiveSupport::HashWithIndifferentAccess 2018-08-27 20:08:02 +02:00
Stan Hu 09cdd7dca0 Bitbucket Server importer: Eliminate most idle-in-transaction issues
Just like with the GitHub importer, the Bitbucket Server importer can hit the
default 60 s idle-in-transaction timeouts if it takes too long to create the
merge request. We solve this by using the same approach as the GitHub importer:

1. Bypass all validation and hooks in creating a merge request
2. Insert the Git data in a separate transaction

Part of #50021
2018-08-26 07:13:36 -07:00
Stan Hu 0377c015cf Refactor GitHub Importer database helpers into helper methods
This in preparation for addressing idle-in-transaction timeouts for other importers.

Part of #50021
2018-08-24 05:34:38 -07:00
Douglas Barbosa Alexandre 5894dfabc5
Backport LDAP changes to CE 2018-08-23 15:46:45 +02:00
Sean McGivern f062489ee7 Merge branch 'ccr/48800/ping_for_boards' into 'master'
Added count for label, assignee, and milestone lists

Closes #48800

See merge request gitlab-org/gitlab-ce!21208
2018-08-23 08:54:00 +00:00
Kamil Trzciński 1d71d5046b Merge branch 'jprovazn-fix-form-uploads' into 'master'
Add public/uploads/tmp to allowed upload paths

Closes #49585

See merge request gitlab-org/gitlab-ce!20942
2018-08-23 06:53:50 +00:00
Stan Hu 7486d424b9 Fix broken Git over HTTP clones with LDAP users
Due to a regression in !20608, the LDAP authenticator was not being used
unless OmniAuth was enabled. This change allows the LDAP provider to be used
if it is configured regardless of the OmniAuth setting.

Closes #50579
2018-08-22 13:07:14 -07:00
Jan Provaznik 4ca9f3b417 Add public/uploads/tmp to allowed upload paths
When direct_upload is enabled and a for file is being uploaded,
then workhorse uses `public/uploads/tmp` path. If `uploads.storage_path`
i sset to a different directory, then upload fails because
`public/uploads/tmp` is not in allowed paths.
2018-08-21 17:39:46 +02:00
Chantal Rollison e9c1f184bc Added count for label, assignee, and milestone lists 2018-08-21 08:21:01 -07:00
Gilbert Roulot 4d7d4a0c16 Remove Gemnasium service 2018-08-20 18:09:57 +00:00
Maciej Sokolowski e2118d831f Test for failure_reason in job webhook 2018-08-20 12:54:46 +02:00
Sean McGivern 0a73c1c583 Merge branch '49907-commits-and-merge-requests-does-not-list-all-files-when-one-file-exceeds-size-limits' into 'master'
Resolve "Commits and Merge Requests does not list all files when one file exceeds size limits"

Closes #49907

See merge request gitlab-org/gitlab-ce!21125
2018-08-20 09:56:20 +00:00
Michael Kozono 51dc249f44 Fix typo 2018-08-18 00:18:58 -07:00
Robert Speicher 120ce02e5e Merge branch 'blacklist-destroy-all' into 'master'
Blacklist the use of destroy_all

See merge request gitlab-org/gitlab-ce!21250
2018-08-17 17:10:12 +00:00
Alejandro Rodríguez 4b87d80499 Fix merge requests not showing any diff files for big patches 2018-08-17 13:22:38 -03:00
Yorick Peterse a58d0a0182 Merge branch 'ab-49754-gh-importer-internal-ids' into 'master'
GitHub importer: Keep track of internal_ids

Closes #49754

See merge request gitlab-org/gitlab-ce!20926
2018-08-17 14:33:27 +00:00
Gabriel Mazetto 696a5fce68 Refactor Rainbow usage in specs
We don't test any specific string generated by it yet, so there is no
point in keeping it enabled when we are disabling it everywhere we test its output.
2018-08-16 21:31:19 +02:00
Yorick Peterse 9606dbbb03
Whitelist existing destroy_all offenses
This whitelists all existing places where we use "destroy_all".
2018-08-16 17:29:37 +02:00
Andreas Brandl fb98496f49
Trigger iid logic from GitHub importer for merge requests. 2018-08-16 10:01:02 +02:00
Andreas Brandl 358675d09f
Trigger iid logic from GitHub importer for milestones. 2018-08-16 10:01:02 +02:00
Andreas Brandl b78a69b06c
Trigger iid logic from GitHub importer for issues. 2018-08-16 10:01:02 +02:00
Robert Speicher 085ed2862c Merge branch 'backport-5986-license-templates' into 'master'
Core backports from the Premium license templates feature

See merge request gitlab-org/gitlab-ce!21212
2018-08-15 16:47:34 +00:00
Nick Thomas ffd164d27f
Fix bugs in Gitlab::Template::Finders preventing instances from BaseTemplate.all from loading content 2018-08-14 22:28:46 +01:00
Valery Sizov 581a946f5a Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6860 2018-08-14 19:21:48 +03:00
Douwe Maan 2bb79b8eef Merge branch '48967-disable-statement-timeout' into 'master'
`disable_statement_timeout` will no longer leak to other migrations

Closes #48967

See merge request gitlab-org/gitlab-ce!20503
2018-08-14 08:56:28 +00:00
Bob Van Landuyt 7466df872c Get the `merge-base` of 2 refs trough the API
This adds an endpoint to get the common ancestor of 2 refs from the API.
2018-08-13 11:58:54 +02:00
Gabriel Mazetto f21e655b61 disable_statement_timeout doesn't require any argument anymore
it will decide the method for disable statement_timeout upon
per transaction or per session, based on how it's called.

When calling with a block, block will be executed and it will use
session based statement_timeout, otherwise will default to existing
behavior.
2018-08-11 04:15:59 +02:00
Gabriel Mazetto f6d47d0dee Fix migration_helpers_spec 2018-08-10 20:40:00 +02:00
Gabriel Mazetto 09e7c75d1b MigrationHelper `disable_statement_timeout` accepts `transaction: false`
By default statement_timeout will only be enabled during transaction
lifetime, therefore not leaking outside of it.

With `transaction: false` it will set for entire session, but requires
a block to passed. It yields control and cleans up session after block
finishes, also preventing leaking outside of it.
2018-08-10 20:40:00 +02:00
Robert Speicher be1ef711ed Merge branch 'sh-fix-bitbucket-cloud-importer-replies' into 'master'
Fix Bitbucket Cloud importer omitting replies

Closes #50052

See merge request gitlab-org/gitlab-ce!21076
2018-08-08 19:36:20 +00:00
Stan Hu 8c467b9175 Fix Bitbucket Cloud importer omitting replies
Inline diff comments did not have the proper position, so even though
they had line codes the merge request validation would fail. Now
we cache the line position for each parent comment and use that.

Closes #50052
2018-08-07 14:34:25 -07:00
Jarka Kadlecová 8338f9b89b Remove todos of users without access to targets migration 2018-08-07 17:34:59 +02:00