Commit Graph

44 Commits

Author SHA1 Message Date
GitLab Bot 6092dcc437 Add latest changes from gitlab-org/gitlab@master 2020-10-02 12:09:03 +00:00
GitLab Bot bdca097916 Add latest changes from gitlab-org/gitlab@master 2020-08-11 03:11:00 +00:00
GitLab Bot d6348d22dd Add latest changes from gitlab-org/gitlab@master 2020-06-24 09:08:32 +00:00
GitLab Bot e1f8f12bbe Add latest changes from gitlab-org/gitlab@master 2020-06-19 15:08:39 +00:00
GitLab Bot 47579e24f3 Add latest changes from gitlab-org/gitlab@master 2020-05-27 21:08:05 +00:00
GitLab Bot 1eeef229aa Add latest changes from gitlab-org/gitlab@master 2020-04-03 03:07:58 +00:00
GitLab Bot 154b9bae14 Add latest changes from gitlab-org/gitlab@master 2020-03-17 21:09:16 +00:00
GitLab Bot d8ccc7a00b Add latest changes from gitlab-org/gitlab@master 2019-11-07 18:06:21 +00:00
GitLab Bot 25989ab7ef Add latest changes from gitlab-org/gitlab@master 2019-10-18 11:11:44 +00:00
George Koltsov ba429a6e20 Apply code review feedback 2019-08-08 13:16:33 +01:00
George Koltsov 5711004467 Add bitbucket_import/importer_spec.rb spec
- Replace `username` field with `nickname` due to updates in
BitBucket Cloud API
- Add new imported spec validating addition of `authod_line`
2019-08-07 16:14:10 +01:00
David Wilkins 467a411e88 Convert RestClient to Gitlab::HTTP for Prometheus Monitor
- Closes #60024

- Change PrometheusClient.new to accept a base url instead of an
  already created RestClient

- Use Gitlab::HTTP in PrometheusClient instead of creating RestClient
  in PrometheusService

- Move http_options from PrometheusService to
  PrometheusClient (follow_redirects: false)

- ensure that base urls don't have the trailing slash

- Created a `PrometheusClient#url` method that might not be strictly
  required

- Change rescued exceptions from RestClient::* to
  HTTParty::ResponseError where possible and StandardError for the
  rest
2019-08-07 02:42:20 +00:00
Thong Kuah f540ffcef6 Add frozen_string_literal to spec/lib (part 1)
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-07-26 13:25:07 +12:00
Stan Hu 30f52b690f Avoid storing backtraces from Bitbucket Cloud imports in the database
We noticed in
https://gitlab.com/gitlab-com/gl-infra/production/issues/908 some
Bitbucket imports took over a second to load their projects row because
`import_error` was huge due to errors. To prevent this, we now:

1. Clean the backtraces
2. Log the details into importer.log
3. Omit the details from the database
2019-06-19 12:04:24 -07:00
GitLab Release Tools Bot 5dc6c8f2d0 Merge branch 'security-60039' into 'master'
Disallow invalid MR branch name

See merge request gitlab/gitlabhq!3052
2019-06-03 12:34:04 +00:00
Patrick Derichs b145d9b873 Refactor spec to reload existing_label right after creation
This will avoid timestamp comparison issues later within equality check
with attributes
2019-05-08 12:39:54 +00:00
Mark Chao d8bddb1662 Validate MR branch names
Prevents refspec as branch name, which would bypass branch protection
when used in conjunction with rebase.

HEAD seems to be a special case with lots of occurrence,
so it is considered valid for now.

Another special case is `refs/head/*`, which can be imported.
2019-05-03 03:02:58 +08:00
Francisco Javier López 150f7c1e9c Fix Bitbucket import
In ebf16ada85
we introduced a SHA validator, to ensure that the data provided in
merge request diffs, was legit. Nevertheless, the validator
assumed that the SHA should be 40 chars long.

When we import a project from BitBucket, the retrieved SHA is
shorter (12 chars long). Therefore, this validator prevented to
create a valid MergeRequestDiff for ever MergeRequest (triggering
an exception).
2019-03-14 10:05:17 +00:00
Stan Hu a9ab6dbc63 Refactor use of Shell.import_repository for Wikis
The previous behavior would pass in a list of parameters
to Shell, but we can improve this by using the WikiFormatter
and Project models to give us the same information.
2019-02-05 21:33:09 -08:00
Stan Hu 82b6e5378a Send project name with Gitaly repository requests
When hashed storage is in use, it's helpful to have the project
name associated with the request.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1394
2019-02-05 21:33:09 -08:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01: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
Bart Libert 4bfd54f3d2
Import bitbucket issues that are reported by an anonymous user
For these kind of issues, the "reporter" field is present but zero.
In such a case, "fetch" will not return the default value, but it will
return nil.
Hence, importing fails, because the "username" field of nil is referenced

Fixes issue #44381
2018-05-24 13:28:58 +02:00
Ahmad Sherif ddfc661f79 Use shard name in Git::GitlabProjects instead of shard path
Closes gitaly#1110
2018-04-03 16:22:13 +02:00
Nick Thomas f2977c63a8
Fix bitbucket wiki import with hashed storage enabled 2017-11-20 16:14:41 +00:00
Nick Thomas da5262f4e6 Backport changes in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE 2017-08-07 19:17:11 +01:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Rémy Coutable cddc5cacfb Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Douwe Maan 56de781a2c Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	lib/gitlab/ci/config/entry/global.rb
#	lib/gitlab/ci/config/entry/jobs.rb
#	spec/lib/gitlab/ci/config/entry/factory_spec.rb
#	spec/lib/gitlab/ci/config/entry/global_spec.rb
#	spec/lib/gitlab/ci/config/entry/job_spec.rb
#	spec/lib/gitlab/ci/status/build/factory_spec.rb
#	spec/lib/gitlab/incoming_email_spec.rb
2017-02-23 09:33:19 -06:00
Douwe Maan 1fe7501b49 Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
2017-02-23 09:33:05 -06:00
Douwe Maan e2bbbb1a9a Fix new offenses 2017-02-23 09:32:42 -06:00
Douwe Maan 206953a430 Prefer leading style for Style/DotPosition 2017-02-23 09:32:22 -06:00
Robert Speicher 80a6d2fda2 Use `:empty_project` where possible throughout spec/lib 2017-01-25 12:25:42 -05:00
Valery Sizov 5b0ebbe5b4 Add Wiki import to BB importer 2016-12-19 20:48:08 +02:00
Valery Sizov c756e62b08 BB importer: fix specs 2016-12-14 20:19:26 +02:00
Valery Sizov ff2193a3db Fix specs 2016-12-09 19:40:22 +02:00
Stan Hu 7a155137a4 Fix spec for Bitbucket importer 2016-11-21 22:06:09 -08:00
Stan Hu fc40c3f28a Fix Rubocop errors with Bitbucket Importer spec 2016-11-21 20:58:46 -08:00
Stan Hu 402cc95c1a Fix Bitbucket importer spec to pass with 2.0 API 2016-11-21 20:49:40 -08:00
Kamil Trzcinski 13d941e185 Make Omniauth providers specs to not modify global configuration 2016-06-08 16:50:05 +02:00
James Lopez 8aafe68583 first round of fixes and spec fixes 2016-03-22 17:53:53 +01:00
Iuri de Silvio 591bf92ce7 Fix bug where Bitbucket `closed` issues were imported as `opened` 2016-03-07 19:23:47 +01:00