Commit Graph

5576 Commits

Author SHA1 Message Date
Gabriel Mazetto c2c34eba62 Prepare rake task for storage rollback
We are keeping compatibility with existing scheduled jobs.
2019-01-25 20:26:35 +01:00
Nick Thomas 2b8f19435b Merge branch 'elasticsearch-via-gitaly-ee' into 'master'
Add connection_data method to Gitaly client

See merge request gitlab-org/gitlab-ce!24669
2019-01-25 16:06:55 +00:00
Douwe Maan 5ab285490a Merge branch 'feature/gb/cross-project-pipeline-trigger' into 'master'
Cross-project pipeline triggers /CE

See merge request gitlab-org/gitlab-ce!24664
2019-01-25 12:31:49 +00:00
Valery Sizov e3cacb95a8 Add connection_data method to Gitaly client
Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7434
2019-01-25 14:16:42 +02:00
Kamil Trzciński 53b8e6e389 Merge branch '54250-upstream-kubeclient-redirect-patch' into 'master'
Use http_max_redirects opt to replace monkeypatch

Closes #54250

See merge request gitlab-org/gitlab-ce!24284
2019-01-25 11:00:54 +00:00
Grzegorz Bizon 552f803283 Merge branch '40997-gitlab-pages-deploy-jobs-have-a-null-status' into 'master'
Fix empty labels for `pages:deploy` job

Closes #40997

See merge request gitlab-org/gitlab-ce!24451
2019-01-25 10:51:47 +00:00
Kamil Trzciński ca52a1254e Merge branch 'an-opentracing-active-record-tracing' into 'master'
Adds tracing support for ActiveRecord notifications

See merge request gitlab-org/gitlab-ce!24604
2019-01-25 10:48:50 +00:00
Grzegorz Bizon 3508948dfe Add a new relation between a stage and related bridges 2019-01-25 10:39:26 +01:00
Grzegorz Bizon cfbcc191f0 Add new pipeline relation to import/export specs 2019-01-25 10:39:11 +01:00
Grzegorz Bizon 4967fe9454 Do not assigne unused attributes to CI/CD builds 2019-01-25 10:33:53 +01:00
Grzegorz Bizon 3a8b9aad69 Refactor pipeline specs and remove raise_error warning 2019-01-25 10:33:18 +01:00
Grzegorz Bizon 5d85a04927 Make it possible to fabricate CI/CD bridge jobs 2019-01-25 10:32:40 +01:00
Thong Kuah f234aef994 Use http_max_redirects opt to replace monkeypatch
http_max_redirects was introduced in 4.2.2, so upgrade kubeclient.

The monkey-patch was global so we will have to check that all instances
of Kubeclient::Client are handled.

Spec all methods of KubeClient

This should provide better confidence that we are indeed disallowing
redirection in all cases
2019-01-25 16:48:37 +13:00
Lin Jen-Shin 61c51d3b6e Merge branch '56392-enable-the-layout-extraspacing-cop' into 'master'
Enable the Layout/ExtraSpacing cop

Closes #56392

See merge request gitlab-org/gitlab-ce!24423
2019-01-24 15:09:52 +00: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
Shinya Maeda 3cc3650dfe Remove expired artifacts periodically
Rename

Introduce Destroy expired job artifacts service

Revert a bit

Add changelog

Use expired

Improve

Fix spec

Fix spec

Use bang for destroy

Introduce iteration limit

Update comment

Simplify more

Refacor

Remove unnecessary thing

Fix comments

Fix coding offence

Make loop helper exception free
2019-01-24 20:50:42 +09:00
Andrew Newdigate 1b90ffc573 Adds tracing support for ActiveRecord notifications
This change will publish distributed tracing spans related to
SQL ActiveRecord queries. These queries are unbound, so will still
contain parameter substitution strings in place of actual parameter
values.

This ensures that the SQL strings do not need to be scrubbed, since the
values are not included in the SQL.

More details of rails instrumentation can be found here:
https://guides.rubyonrails.org/active_support_instrumentation.html
2019-01-24 13:11:09 +02:00
Robert Speicher de3af288ce Merge branch 'sh-remove-bitbucket-mirror-constant' into 'master'
Fix import handling errors in Bitbucket Server importer

See merge request gitlab-org/gitlab-ce!24499
2019-01-23 23:49:42 +00:00
Kamil Trzciński e8f73aaee6 Merge branch '56417-update-helm-to-2-12-2' into 'master'
Update Helm to 2.12.2 to address Helm client vulnerability

Closes #56417

See merge request gitlab-org/gitlab-ce!24418
2019-01-23 12:30:06 +00:00
Kamil Trzciński ae2166188d Merge branch 'an-opentracing-propagation' into 'master'
Adds inter-service OpenTracing propagation

See merge request gitlab-org/gitlab-ce!24239
2019-01-22 17:45:44 +00:00
Kamil Trzciński 037fddad52 Merge branch 'fixes-populate-cluster-kubernetes-namespace-table-spec' into 'master'
Removes factories on Cluster background migration

See merge request gitlab-org/gitlab-ce!24536
2019-01-22 17:28:57 +00:00
Andrew Newdigate ca464b6033 Adds inter-service OpenTracing propagation
This change allows the GitLab rails and sidekiq components to receive
tracing spans from upstream services such as Workhorse and pass these
spans on to downstream services including Gitaly and Sidekiq.

This change will also emit traces for incoming and outgoing requests
using the propagated trace information. This will allow operators and
engineers to view traces across the Workhorse, GitLab Rails, Sidekiq and
Gitaly components.

Additional intra-service instrumentation will be added in future
changes.
2019-01-22 18:15:30 +02:00
Grzegorz Bizon f02be29e52 Merge branch '55966-when-ref-is-ambiguous-createpipelineservice-raises-an-error' into 'master'
Resolve "When ref is ambiguous, `CreatePipelineService` raises an error"

Closes #55966

See merge request gitlab-org/gitlab-ce!24437
2019-01-22 15:36:48 +00:00
Mayra Cabrera 70e5d0ad1b Removes factories on Cluster background migration
'Populate cluster kubernetes namespace' was using factories for their
specs. According to our documentation (see spec/migrations/readme.md),
we should use table helper to create a temproary ActiveRecord::Base
derived model for a table.
2019-01-22 09:18:07 -06:00
Vladimir Shushlin 7f6e0c84f8 Treat "" as nil for external commit status description 2019-01-22 15:17:30 +03:00
Sean McGivern 9d2be75674 Limit Sidekiq args logging to 10 KB of JSON
When logging arguments from Sidekiq to JSON, restrict the size of `args`
to 10 KB (when converted to JSON). This is to avoid blowing up with
excessively large job payloads.
2019-01-22 10:54:12 +00:00
Matija Čupić a2477ec2e3
Assign pipeline protected attribute in Populate
This removes the Protect pipeline chain step and assigns the protected
attribute in the Populate step instead.
2019-01-21 16:26:09 +01:00
Vladimir Shushlin ffc9fe49a1 Fix empty labels for `pages:deploy` job
Use description of GenericCommitStatus as label if provided
Fallback to core status labels if not
2019-01-21 17:16:22 +03:00
Stan Hu 100b050b99 Fix import handling errors in Bitbucket Server importer
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20724 removed
`Gitlab::Git::RepositoryMirroring::RemoteError`, but this was still
being handled in the Bitbucket Server importer and only encountered if
some exception other than `Gitlab::Shell::Error` were thrown.
2019-01-18 15:54:24 -08:00
Matija Čupić 673b809775
Move assignment to protected to separate step
This moves setting the protected attribute of a pipeline to a separate
pipeline chain step in order to perform the assignment after validation.
2019-01-18 19:34:22 +01:00
Andrew Newdigate 625bdc5ade Avoid overwriting default jaeger values with nil
During the review process for adding opentracing factories, a bug was
introduced which caused Jaeger to initialize an invalid tracer. The
bug was due to use sending nil through as a kwarg when the Jaeger
initializer used a non-nil default value.

This is fairly insidious as, the tracer looks like a tracer, but, when
methods are invoked, it throws `NoMethodError` errors. To ensure that
this issue does not happen in future, the tests have been changed to
ensure that the tracer works as expected. This could avoid problems
in future when upgrading to newer versions of Jaeger.
2019-01-18 13:05:15 +02:00
Takuya Noguchi db237d8431 Update Helm to 2.12.2 to address Helm client vulnerability
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-01-18 09:21:47 +09:00
Andrew Newdigate 57a8859a11 Conditionally initialize the global opentracing tracer
This change will instantiate an OpenTracing tracer and configure it
as the global tracer when the GITLAB_TRACING environment variable is
configured. GITLAB_TRACING takes a "connection string"-like value,
encapsulating the driver (eg jaeger, etc) and options for the driver.

Since each service, whether it's written in Ruby or Golang, uses the
same connection-string, it should be very easy to configure all
services in a cluster, or even a single development machine to be
setup to use tracing.

Note that this change does not include instrumentation or propagation
changes as this is a way of breaking a previous larger change into
components. The instrumentation and propagation changes will follow
in separate changes.
2019-01-17 12:32:44 +02:00
Matija Čupić 09d8c77ab2
Prevent checking protected_ref? for ambiguous refs 2019-01-16 21:38:17 +01:00
Stan Hu dbe11b9ca5 Merge branch '56309-read-only-controller-doesn-t-account-for-relative-paths-for-admin-sidekiq-route' into 'master'
Allow sidekiq admin requests, regardless of root

Closes #56309

See merge request gitlab-org/gitlab-ce!24352
2019-01-16 20:12:54 +00:00
Robert Speicher 1ffc123d79
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-01-16 11:40:08 -06:00
Yorick Peterse cdaef30e47 Merge branch 'security-2770-verify-bundle-import-files' into 'master'
[master] Validate bundle files before unpacking them

Closes #2770

See merge request gitlab/gitlabhq!2772
2019-01-16 17:29:21 +00:00
Rémy Coutable c8e3261729 Merge branch 'bvl-dont-use-factories-in-bg-migration-specs-ce' into 'master'
Enable FactoriesInMigration cop for background migrations

See merge request gitlab-org/gitlab-ce!24425
2019-01-16 16:59:03 +00:00
Nick Thomas 824c6b03e7 Merge branch 'refactor-after-create-default-branch' into 'master'
Refactor Project#after_create_default_branch

See merge request gitlab-org/gitlab-ce!24329
2019-01-16 16:56:30 +00:00
Yorick Peterse 52eeb56bf0
Refactor code for protecting default branches
This refactors some of the logic used for protecting default branches,
in particular Project#after_create_default_branch. The logic for this
method is moved into a separate service class. Ideally we'd get rid of
Project#after_create_default_branch entirely, but unfortunately
Project#after_import depends on it. This means it has to stick around
until we also refactor Project#after_import.

For branch protection levels we introduce
Gitlab::Access::BranchProtection, which provides a small wrapper around
Integer based branch protection levels. Using this class removes the
need for having to constantly refer to Gitlab::Access::PROTECTION_*
constants.
2019-01-16 14:25:14 +01:00
Bob Van Landuyt c905130ef0 Ignore existing offenses of FactoriesInMigration 2019-01-16 13:15:33 +01:00
Ash McKenzie c0a5b628c8
Allow sidekiq admin requests, regardless of root 2019-01-16 19:14:46 +11:00
Douwe Maan ace4a88aa3 Merge branch 'sh-fix-backfill-project-repo-migration' into 'master'
Fix duplicate project disk path in BackfillLegacyProjectRepositories

Closes #56061

See merge request gitlab-org/gitlab-ce!24213
2019-01-15 16:22:46 +00:00
Kamil Trzciński 8b4b7caefa Merge branch 'backstage/gb/refactor-only-except-policies-config' into 'master'
Refactor only/except configuration policies

See merge request gitlab-org/gitlab-ce!24359
2019-01-15 11:26:17 +00:00
Grzegorz Bizon 3c5846cdaa Simplify code related to setting default config values 2019-01-15 11:23:32 +01:00
Grzegorz Bizon 7b712d3598 Make default config entry value configurable
Introduce `default:` configuration entry setting that makes it possible
to configure a default value of an entry, what overrides class-level
`def self.default` value.
2019-01-15 11:18:14 +01:00
Rémy Coutable 8285205815 Merge branch 'sh-fix-gon-helper-avatar' into 'master'
Fix no avatar not showing in user selection box

Closes #56268

See merge request gitlab-org/gitlab-ce!24346
2019-01-14 16:42:36 +00:00
Brandon Labuschagne cc281afb27 Resolve "Add "What's new" menu item in top navigation" 2019-01-14 16:10:19 +00:00
Grzegorz Bizon 0cba9bef8a Fix specs related to emtpy `except` policy config 2019-01-14 14:50:12 +01:00
Grzegorz Bizon 0ea8c236c1 Add more specs for only/except policy config entry 2019-01-14 14:41:12 +01:00
Stan Hu 2265ce34af Fix no avatar not showing in user selection box
After upgrading to Ruby 2.5.3, we switched `URI.join` in favor of
`Gitlab::Utils.append_path`. However,
ActionController::Base.helpers.image_path can return a full URL if a CDN
host is present.

Rails provides a way to generate the full URL using the asset path, but
that doesn't appear to work because `request` is nil`.

Revert to the previous behavior to handle CDNs and relative URLs.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56268
2019-01-13 08:02:02 -08:00
Toon Claes 082cc12225 Fix failing spec with orphaned namespace 2019-01-11 15:36:57 +01:00
Stan Hu 618875c58c Fix duplicate disk path in Backfill ProjectRepos
On GitLab.com, we saw numerous duplicate disk entry inserts because
the migration was not taking the routes table into account. We now
implement this in the migration to be consistent.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56061
2019-01-11 15:36:51 +01:00
Nick Thomas 067dc6540c
Validate bundle files before unpacking them 2019-01-10 21:33:36 +00:00
Toon Claes b87dcc238a Remove backfill migration for legacy projects
We've found some problems with the backgroung migration:
BackfillLegacyProjectRepositories

See https://gitlab.com/gitlab-org/gitlab-ce/issues/56061

The migration was disabled to run on production:
https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5906

So to overcome it's not being run anywhere, just remove it.

Whenever all problems in BackfillLegacyProjectRepositories are fixed
we'll create a new migration (with a different timestamp) to have it
run.
2019-01-10 16:45:14 +01:00
Matija Čupić ebdf9fada7
Add specs for both parallel and regular job deps 2019-01-09 16:57:11 +01:00
Robert Speicher 0986039896 Merge branch 'sh-switch-rack-request-to-actionpack' into 'master'
Switch use of Rack::Request to ActionDispatch::Request

See merge request gitlab-org/gitlab-ce!24199
2019-01-09 02:01:39 +00:00
Stan Hu e884795e6c Revert "Merge branch '3062-improve-project-cache' into 'master'"
This reverts commit e65e184269, reversing
changes made to 646ba2418b.
2019-01-08 13:14:06 -08:00
Douglas Barbosa Alexandre 22ab2d040d Merge branch 'osw-fix-bottom-expansion-diff-comment' into 'master'
Adjusts duplicated line when commenting on unfolded diff lines (in the bottom)

Closes #56051

See merge request gitlab-org/gitlab-ce!24201
2019-01-08 15:48:08 +00:00
Oswaldo Ferreira 8303eb8a9e Adjusts duplicated line when commenting on unfolded diff lines 2019-01-08 12:45:19 -02:00
Mark Chao 3ab5af14a2 Check if specific type of background migration are done
Useful for checking progress.
2019-01-08 15:19:45 +08:00
Douglas Barbosa Alexandre 31f2c7b00e Merge branch '53966-hashed-storage-read-only' into 'master'
Hashed Storage: Only set as `read_only` when starting the per-project migration

See merge request gitlab-org/gitlab-ce!24128
2019-01-08 00:07:02 +00:00
Gabriel Mazetto ee4af0c64c Only set as `read_only` when starting the per-project migration
In the previous code, we locked the project during the migration
scheduling step, which works fine for small setups, but can be
problematic in really big installations.

We now moved the logic to inside the worker, so we minimize the time a
project will be read-only. We also make sure we only do that if
reference counter is `0` (no current operation is in progress).
2019-01-07 23:53:06 +01:00
Reuben Pereira f40b5860d7 Add table and model for error tracking settings 2019-01-07 17:55:21 +00:00
Grzegorz Bizon 604073ffc3 Merge branch 'include-project' into 'master'
Allow to include another project files

Closes #53903

See merge request gitlab-org/gitlab-ce!24101
2019-01-07 09:19:36 +00:00
Kamil Trzciński c4d615c9dc Allow to include files from another projects
This adds `project:, file:, ref:` specification support.
2019-01-07 09:38:05 +01:00
Stan Hu aff2b6e4eb Switch use of Rack::Request to ActionDispatch::Request
As mentioned in
https://gitlab.com/gitlab-org/gitlab-ee/issues/9035#note_129093444,
Rails 5 switched ActionDispatch::Request so that it no longer inherits
Rack::Request directly. A middleware that uses Rack::Request to
read the environment may see stale request parameters if
another middleware modifies the environment via ActionDispatch::Request.
To be safe, we should be using ActionDispatch::Request everywhere.
2019-01-07 00:35:53 -08:00
Grzegorz Bizon 1aa2ac13b9 Merge branch 'kamil-refactor-ci-builds-v5' into 'master'
Use BuildMetadata to store build configuration in JSONB form

See merge request gitlab-org/gitlab-ce!21499
2019-01-06 09:47:29 +00:00
Stan Hu 7d28e39f58 Fix multipart attachments not uploading
Mixing and matching the use of Rack::Request and ActionDispatch::Request
in Rails 5 is bad, particularly if you have middleware that
manipulates or accesses environment variables.

`Gitlab::Middleware::Multipart` attempts to rewrite request parameters
to the proper values (e.g. replacing `data_file` with
`UploadedFile`). It does this by calling `Rack::Request#update_params`,
which essentially updates `env['rack.request.form_hash']`.

By changing to `ActionDispatch::Request`, the Go middleware was causing
the request parameters to be stored inside
`env['action_dispatch.request.request_parameters']`. Later calls to
`Rack::Request#update_params` would not have any effect because it would
attempt to update `env['rack.request.form_has']` instead of
`env['action_dispatch.request.request_parameters']`. As a result, the
controller still saw the old parameters.

Since the Go middleware appears to be using `ActionDispatch::Request`
for authorization methods, we can switch the multipart middleware to
use it too.

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/9035
2019-01-05 01:56:47 -08:00
Kamil Trzciński b97b85c37e Merge branch 'include-templates' into 'master'
Include templates

Closes #53445

See merge request gitlab-org/gitlab-ce!23495
2019-01-04 15:42:53 +00:00
Kamil Trzciński 0103d5be96 Add config_options|variables to BuildMetadata
These are data columns that store runtime configuration
of build needed to execute it on runner and within pipeline.

The definition of this data is that once used, and when no longer
needed (due to retry capability) they can be freely removed.

They use `jsonb` on PostgreSQL, and `text` on MySQL (due to lacking
support for json datatype on old enough version).
2019-01-04 16:38:17 +01:00
Kamil Trzciński a8c5096026 Allow to include templates
This rewrites a syntax to allow include of templates.
This also normalises the syntax used by include: feature
2019-01-04 15:22:41 +01:00
Shinya Maeda 8a75453ea0 Update safe model attributes for import/export 2019-01-04 22:17:02 +09:00
Shinya Maeda 66755c9ed5 Support CURD operation for release asset links
- Add Releases::Links model
- Expose it in release API
- Add integration tests
2019-01-04 22:17:02 +09:00
Sean McGivern 8600043bc7 Merge branch '29951-issue-creation-by-email-without-subaddressing' into 'master'
Support new issue creation by email without subaddressing

Closes #29951

See merge request gitlab-org/gitlab-ce!23523
2019-01-04 08:58:55 +00:00
Sean McGivern 626f3d0367 Merge branch 'dm-git-access-any-ce' into 'master'
[CE] Don't run checks for changed refs when specific changes are unknown

See merge request gitlab-org/gitlab-ce!23990
2019-01-04 08:42:20 +00:00
Brett Walker a4f2de7964 Refactoring and review comments
including verifying the project_slug
2019-01-03 14:37:35 -06:00
Brett Walker 2e51431403 Use new issue email address format
We now use `-issue` in order to support catch all email addresses
2019-01-03 14:37:35 -06:00
Brett Walker 34dd6196e3 Use new merge request email address format
We now use `-merge-request` instead of `+merge-request+`
in order to support catch all email addresses
2019-01-03 14:37:35 -06:00
Brett Walker 23d5f4c991 Use new unsubscribe link
We now use `-unsubscribe` instead of `+unsubscribe`
in order to support catch all email addresses
2019-01-03 14:37:35 -06:00
mortyccp 0e061adfcb Fix lint errors 2019-01-03 20:28:02 +08:00
mortyccp 3a62f15657 Remove authentication via warden and PRIVATE_TOKEN header 2019-01-03 20:28:02 +08:00
mortyccp b7e0a09de2 Fix rspec error in rails 4 2019-01-03 20:28:02 +08:00
mortyccp d1fea99deb Allow basic authentication on go get middleware 2019-01-03 20:28:02 +08:00
Douwe Maan 3a0ae96c0e
Don't run single change checks when changes are unknown
When the `changes` passed to `GitAccess` are the literal string `_any`,
which indicates that this is a pre-authorization check, we now check
whether the user can push to any branch in the project in question,
instead of running the per-change check with `oldrev` `_any`, `newrev`
`nil`, and `ref` `nil`.
2019-01-02 15:31:32 +01:00
Douwe Maan bc7a1affe3
Extract any-branch-allows-collaboration logic into dedicated method 2019-01-02 15:31:32 +01:00
Douwe Maan 55723c223f
Move magic '_any' string to constant 2019-01-02 15:31:31 +01:00
John Jarvis 191f461b88 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-01-02 12:00:52 +01:00
Kamil Trzciński f93f09e735 Merge branch 's3-directories-get' into 'master'
Use directories.new when getting S3 directory

Closes gitlab-com/gl-infra/infrastructure#5807

See merge request gitlab-org/gitlab-ce!23981
2019-01-02 10:08:31 +00:00
John Jarvis a74700178d Merge branch 'security-master-secret-ci-variables-exposed' into 'master'
[master] Secret CI variables can exposed by creating a tag with the same name as an existing protected branch

See merge request gitlab/gitlabhq!2596
2019-01-02 09:33:23 +00:00
Takuya Noguchi 1b87f8d763 Remove gem install bundler from Docker-based Ruby environments
bundler gem has been included in the Docker official Ruby image since 2.1.

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-01-01 19:27:19 +09:00
Shinya Maeda 8f1e96c89b Add spec for Release API
Add spec for all release API - GET, POST, PUT, DELETE.
Also, fixes some minior bugs.
2018-12-31 14:35:57 +09:00
Francisco Javier López e9b5b10a45 Skip per-commit validations which have already passed on another change/branch 2018-12-28 10:44:25 +00:00
Kamil Trzciński cf200b64d8 Merge branch '51970-correct-ordering-of-metrics' into 'master'
Correct the ordering of metrics on performance dashboard

Closes #51970

See merge request gitlab-org/gitlab-ce!23630
2018-12-28 10:42:54 +00:00
Francisco Javier López 5a3e6fdff9
Fixing image lfs bug and also displaying text lfs
This commit, introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812,
fixes a problem creating a displaying image diff notes when the image
is stored in LFS. The main problem was that `Gitlab::Diff::File` was
returning an invalid valid in `text?` for this kind of files.

It also fixes a rendering problem with other LFS files, like text
ones. They LFS pointer shouldn't be shown when LFS is enabled
for the project, but they were.
2018-12-27 16:51:07 +01:00
Douwe Maan 5fabc1fd3b Merge branch 'osw-cache-discussions-diff-highlighting' into 'master'
Considerably improve the loading time on merge request's discussion page

Closes #52950

See merge request gitlab-org/gitlab-ce!23857
2018-12-27 10:18:21 +00:00
Jan Provaznik 2bfc317492 Use directories.new when getting S3 directory
Calling `Fog::Storage::AWS::Directories#get` requires the
ListAllMyBuckets permission, but we can avoid that extra query and
permission by initializing the directory with a specific bucket:
https://stackoverflow.com/a/12288581/1992201
2018-12-27 11:06:06 +01:00
Lin Jen-Shin 82bf55c8db Merge remote-tracking branch 'upstream/master' into 54953-error-500-viewing-merge-request-due-to-nil-commit_email_hostname
* upstream/master: (115 commits)
  [CE] Speed up login page usage
  Add new line and comments
  Fix the seeder 24_forks.rb cannot find public project
  Milestones on community contribution issues
  Removed Gitlab Upgrader found in /lib/gitlab/upgrader.rb
  Fix and move specs into admin_disables_git_access_protocol_spec.rb
  Fix HTTP/SSH clone panel for mobile
  Add spec for HTTP/SSH clone panel
  Fix missing Git clone button when protocol restriction setting enabled
  Fix deprecation: Using positional arguments in integration tests
  Extend override check to also check arity
  Update tm cli version
  Bump Gitaly version to v1.12.0
  Add @dbalexandre to CODEOWNERS
  Update verbiage for clarity
  Change group-cluster beta to regular note
  Change alpha states to use note instead of warning
  Update registry section. Update serverless.yaml formatting
  Clarify obtaining application URL
  Add @godfat to CODEOWNERS
  ...
2018-12-26 18:03:21 +08:00
Lin Jen-Shin 145079b354 Merge branch '42125-extend-override-check-to-also-check-arity' into 'master'
Resolve "Extend `override` check to also check arity"

Closes #42125

See merge request gitlab-org/gitlab-ce!23498
2018-12-26 09:58:08 +00:00
Jacob Wolen bd3c2f3aba Removed Gitlab Upgrader found in /lib/gitlab/upgrader.rb 2018-12-24 14:48:31 +00:00
Jacopo d2851f41ba Extend override check to also check arity
Override now cares about parents method arity: if parents arity
doesn't match raises an error.
2018-12-22 14:10:43 +01:00
Lin Jen-Shin 02878551b5 Merge branch 'support-gitaly-tls' into 'master'
Support tls communication in gitaly

See merge request gitlab-org/gitlab-ce!22602
2018-12-21 19:01:58 +00:00
Oswaldo Ferreira 7cf4947792 Cache diff highlight in discussions
This commit handles note diffs caching, which considerably improves
the performance on merge requests with lots of comments.
Important to note that the caching approach taken here is different
from `Gitlab::Diff::HighlightCache`. We do not reset the whole cache
when a new push is sent or anything else. That's because discussions
diffs are persisted and do not change.
2018-12-21 16:59:21 -02:00
Ahmad Hassan 907f0ce8a2 More tls gitaly docs 2018-12-21 18:06:46 +02:00
rpereira2 2cd7b78391 Correct ordering of metrics
Correct the ordering of metrics on performance dashboard. Before common
metrics were moved into the DB, metric groups were ordered by the
priority defined in the common_metrics.yml file.
This commit adds a priority to each metric group in the PrometheusMetric
model.
It also combines title, priority and required_metrics into one frozen
GROUP_DETAILS hash so that the code is clearer.
This can be done since there is a fixed set of groups which are not
configurable.
2018-12-21 16:41:58 +05:30
John Jarvis fbd4319a82 Merge branch 'security-import-symlink' into 'master'
[master] Persistent Symlink in Project Import

See merge request gitlab/gitlabhq!2673
2018-12-21 08:09:22 +00:00
Ahmad Hassan d975074e1f Log certificate loading errors into sentry 2018-12-20 18:24:53 +02:00
Dmitriy Zaporozhets 24c9e1e2a8 Merge branch 'ce-8333-add-related-epics-support' into 'master'
CE port: Rename GroupHierarchy into ObjectHierarchy

See merge request gitlab-org/gitlab-ce!23923
2018-12-20 12:49:25 +00:00
Mike Greiling 9f0983a4b1 Resolve "Hide cluster features that don't work yet with Group Clusters" 2018-12-20 09:39:09 +00:00
Douglas Barbosa Alexandre 156788bae9
Port Gitlab::JsonCache to CE 2018-12-19 15:15:05 -02:00
Jarka Košanová b1c3955385 Rename GroupHierarchy into ObjectHierarchy
- we now use the hierarchy class also for epics
- also rename supports_nested_groups? into supports_nested_objects?
  - move it to a concern
2018-12-19 15:24:29 +01:00
Ahmad Hassan 32c4f70aa5 Followups on review 2018-12-19 15:19:43 +02:00
Rémy Coutable cc06bb2c6e
Simplify spec/lib/gitlab/current_settings_spec.rb a bit
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-12-19 11:24:55 +01:00
Lin Jen-Shin 0ff27ce059
Method `create_from_defaults` will never give nil 2018-12-19 11:24:54 +01:00
Rémy Coutable 71672dfa6a
Return an ApplicationSetting in CurrentSettings
This replaces the use of fake_application_settings with
`::ApplicationSetting.build`_from_defaults. The reason is that
`fake_application_settings` doesn't have the custom accessors that
`ApplicationSetting` has, e.g. `#commit_email_hostname`, thus this
can lead to unexpected `nil` values which comes from the database
column instead of `.default_commit_email_hostname` returned by
`ApplicationSetting#commit_email_hostname`.

Using `::ApplicationSetting.build_from_defaults` should be safe as it
doesn't try to `INSERT` a DB record, in contrary to
`::ApplicationSetting.create_from_defaults` which we used to use, and
which created issues that the introduction of
`fake_application_settings` tried to resolve (575dced5).

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-12-19 11:24:53 +01:00
Douglas Barbosa Alexandre 4a132952db
Extract a shared example for legacy and hashed storage migrations tests 2018-12-18 21:35:14 -02:00
Douglas Barbosa Alexandre 754f66113e
Backfill project_repositories for legacy storage projects
Adds a background migration that will ensure all projects that
are on legacy storage have a row in `project_repositories`.
2018-12-18 21:13:38 -02:00
Douwe Maan aa7c927e1e Merge branch 'zj-upgrade-gitaly-version' into 'master'
Upgrade Gitaly to 1.9.0

See merge request gitlab-org/gitlab-ce!23865
2018-12-18 13:50:24 +00:00
Rémy Coutable aa343d546c Merge branch 'blackst0ne-improve-encoding-helper-spec' into 'master'
Update specs to exclude possible false positive pass

Closes #55403

See merge request gitlab-org/gitlab-ce!23893
2018-12-18 08:59:21 +00:00
blackst0ne 236876f278 Update specs to exclude possible false positive pass 2018-12-18 10:21:30 +11:00
Douglas Barbosa Alexandre 279be8aaa2
Change SafeRequestStore#write to accept an options hash
This change the write to accept an options hash to make
it compatible with ActiveSupport::Cache::Store#write method.

The options hash are not passed to the underlying cache
implementation because RequestStore#write accepts only
a key, and value params.
2018-12-17 19:57:03 -02:00
James Lopez 43cc0d5a4a
Fix persistent symlink in project import
- Fix permissions after untar is done
- Refactor command line util
2018-12-17 16:14:35 +01:00
Douwe Maan 0ab50681da Merge branch '55230-remove-project-cleanup-feature-flag' into 'master'
Remove the project_cleanup feature flag

Closes #55230

See merge request gitlab-org/gitlab-ce!23814
2018-12-17 13:25:09 +00:00
Rémy Coutable 368198d8cc Merge branch 'deprecated-actiondispatch-paramsparser' into 'master'
Remove deprecated ActionDispatch::ParamsParser

See merge request gitlab-org/gitlab-ce!23848
2018-12-17 12:33:52 +00:00
Yorick Peterse e8374cb6f4 Merge branch '55433-un-revert-https-gitlab-com-gitlab-org-gitlab-ce-commit-00acef434031b5dc0bf39576a9e83802c7806842-revert' into 'master'
Resolve "Un-revert 00acef4340 revert"

Closes #55433

See merge request gitlab-org/gitlab-ce!23861
2018-12-17 12:29:20 +00:00
Ahmad Hassan d6886506a0 Merge remote-tracking branch 'origin/master' into support-gitaly-tls 2018-12-17 13:18:50 +02:00
Zeger-Jan van de Weg 50ce459118
Upgrade Gitaly to 1.9.0
This upgrade moves logic from gitlab-rails to Gitaly, which allowed code
removal too.
2018-12-17 09:26:09 +01:00
Ash McKenzie 8ce86bf9a0
Revert "Revert "LfsToken uses JSONWebToken::HMACToken by default""
This reverts commit 00acef4340.
2018-12-17 17:17:39 +11:00
Jasper Maes 56296f1eda Remove rails4 specific code 2018-12-16 10:48:41 +01:00
Jasper Maes 807139b6b9 Remove deprecated ActionDispatch::ParamsParser 2018-12-16 10:47:24 +01:00
Nick Thomas 0b74b86367
Fix repository cleanup with object storage on
When the BFG object map file is in object storage (i.e., uploads in
general are placed into object storage), we get an instance of the
Gitlab::HttpIO class. This doesn't behave as expected when you try to
read past EOF, so we need to explicitly check for this condition to
avoid ending up in a tight loop around io.read
2018-12-15 13:50:59 +00:00
Nick Thomas 8d2e1b724b Merge branch '54786-mr-empty-file-display' into 'master'
Display empty files properly on MR diffs

Closes #54786

See merge request gitlab-org/gitlab-ce!23671
2018-12-15 12:21:54 +00:00
Jasper Maes 44fef4fe4c Remove rails 4 support in CI, Gemfiles, bin/ and config/ 2018-12-14 19:36:22 +01:00
Robert Speicher 0a69dbd23d Merge branch 'fix-warnings' into 'master'
Fix warnings in tests

See merge request gitlab-org/gitlab-ce!23788
2018-12-14 16:06:10 +00:00
Kamil Trzciński 213891fa43 Merge branch 'ac-releases-name-sha-author' into 'master'
Add name, author and sha to releases

See merge request gitlab-org/gitlab-ce!23763
2018-12-14 11:53:13 +00:00
Oswaldo Ferreira ed3034bbb7 Allow suggesting single line changes in diffs 2018-12-13 19:17:19 +00:00
Alessio Caiazza b782ba1113
Add name, author and sha to releases
This commit adds a name to each release, defaulting it to tag name,
keeps track of the SHA when a new release is created and tracks the
current user as release author.
2018-12-13 12:15:21 +01:00
Kamil Trzciński 0165cfaa07 Re-define default only except policy 2018-12-13 10:39:55 +00:00
Sean Nichols ece6df18f8 Fix redundant returns in spec file 2018-12-13 02:24:31 -05:00
Semyon Pupkov 3c2a6be04d Fix warning: already initialized constant STATUSES
spec/lib/gitlab/background_migration/migrate_stage_status_spec.rb:9: warning: already initialized constant STATUSES
spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb:9: warning: previous definition of STATUSES was here
2018-12-13 12:01:47 +05:00
Sean Nichols 4d2448e03a Add tests and move empty file message into own component 2018-12-13 01:49:32 -05:00
Nick Thomas 0ce7c29fb7
Update GitLab Workhorse to v8.0.0 2018-12-11 16:23:23 +00:00
Ahmad Hassan dfc54352c0 Merge remote-tracking branch 'origin/master' into support-gitaly-tls 2018-12-11 16:48:26 +02:00
Gilbert Roulot e6226e8cb3 Generalise test compare service
It adds a base class for CompareTestReportsService
containing common code with CompareLicenseManagementReportsService
which is present in GitLab Enterprise Edition.
2018-12-11 11:39:22 +01:00
Rémy Coutable f233c3bce0
Fix a frozen string error in lib/gitlab/utils.rb
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-12-10 16:08:58 +01:00
Rémy Coutable 5c5a5992c0 Merge branch 'sh-ignore-arrays-url-sanitizer' into 'master'
Only allow strings in URL::Sanitizer.valid?

Closes #55079

See merge request gitlab-org/gitlab-ce!23675
2018-12-10 12:03:01 +00:00
Douwe Maan 5a727a4d36 Merge branch 'osw-update-mr-metrics-with-events-data' into 'master'
Populate MR metrics with events table information (migration)

Closes #41587

See merge request gitlab-org/gitlab-ce!23564
2018-12-10 09:39:07 +00:00
Stan Hu 401be1d17f Only allow strings in URL::Sanitizer.valid?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55079
2018-12-09 07:59:54 -08:00
Matija Čupić a1be580979
Implement Command#ambiguous_ref? 2018-12-08 19:28:56 +01:00
Matija Čupić 38348aa121
Remove Gitlab::Git::Ref#full_ref 2018-12-08 19:28:55 +01:00
Matija Čupić b6c8d3ac9f
Reintroduce Command#protected_ref? 2018-12-08 19:28:54 +01:00
Matija Čupić 855e7c32b9
Use Gitlab::Git::Ref in Project#resolve_ref
Reworks Project#resolve_ref to return Gitlab::Git::Branch,
Gitlab::Git::Tag or raise an AmbiguousRef error.
2018-12-08 19:28:34 +01:00
Matija Čupić ce14c20a82
Avoid using magic variable in spec 2018-12-08 19:28:34 +01:00
Matija Čupić 2edc02143b
Prevent creating pipelines with ambiguous refs 2018-12-08 19:28:33 +01:00
Clement Ho a89b526950 Merge branch 'ce-jej/group-saml-sso-button-link-description' into 'master'
[CE] Backport SAML unlink changes: UrlBlocker#ascii_only

See merge request gitlab-org/gitlab-ce!23627
2018-12-08 03:02:18 +00:00
Stan Hu 9655a602ac Merge branch 'tc-backfill-hashed-project_repositories' into 'master'
Fill project_repositories for hashed storage projects

Closes #48527

See merge request gitlab-org/gitlab-ce!23482
2018-12-07 23:16:44 +00:00
Zeger-Jan van de Weg 896c0bdbfb
Allow public forks to be deduplicated
When a project is forked, the new repository used to be a deep copy of everything
stored on disk by leveraging `git clone`. This works well, and makes isolation
between repository easy. However, the clone is at the start 100% the same as the
origin repository. And in the case of the objects in the object directory, this
is almost always going to be a lot of duplication.

Object Pools are a way to create a third repository that essentially only exists
for its 'objects' subdirectory. This third repository's object directory will be
set as alternate location for objects. This means that in the case an object is
missing in the local repository, git will look in another location. This other
location is the object pool repository.

When Git performs garbage collection, it's smart enough to check the
alternate location. When objects are duplicated, it will allow git to
throw one copy away. This copy is on the local repository, where to pool
remains as is.

These pools have an origin location, which for now will always be a
repository that itself is not a fork. When the root of a fork network is
forked by a user, the fork still clones the full repository. Async, the
pool repository will be created.

Either one of these processes can be done earlier than the other. To
handle this race condition, the Join ObjectPool operation is
idempotent. Given its idempotent, we can schedule it twice, with the
same effect.

To accommodate the holding of state two migrations have been added.
1. Added a state column to the pool_repositories column. This column is
managed by the state machine, allowing for hooks on transitions.
2. pool_repositories now has a source_project_id. This column in
convenient to have for multiple reasons: it has a unique index allowing
the database to handle race conditions when creating a new record. Also,
it's nice to know who the host is. As that's a short link to the fork
networks root.

Object pools are only available for public project, which use hashed
storage and when forking from the root of the fork network. (That is,
the project being forked from itself isn't a fork)

In this commit message I use both ObjectPool and Pool repositories,
which are alike, but different from each other. ObjectPool refers to
whatever is on the disk stored and managed by Gitaly. PoolRepository is
the record in the database.
2018-12-07 19:18:37 +01:00
Stan Hu e17ccef5ca Merge branch 'store-correlation-logs' into 'master'
Log and pass correlation-id between Unicorn, Sidekiq and Gitaly

See merge request gitlab-org/gitlab-ce!22844
2018-12-07 15:29:00 +00:00
Douwe Maan cda291f0c3 Merge branch '48889-populate-merge_commit_sha' into 'master'
Update merge request's merge_commit after branch update

Closes #48889

See merge request gitlab-org/gitlab-ce!22794
2018-12-07 15:27:17 +00:00
Mark Chao c6c53d1c74 Fix commit with two parents is set with wrong direct_ancestor
If a commit has two parents, one is direct ancestor, and one is not,
and the order of `commits` is in such fashion that the non-ancestor
side is visited first, the commit would be determined as non-ancestor,
when in fact it can be.

Therefore we should first determine all direct ancestors
prior to analyzing.
2018-12-07 21:00:47 +08:00
Mark Chao 1f7647f446 Update merge request's merge_commit for branch update
Analyze new commits graph to determine each commit's merge commit.

Fix "merged with [commit]" info for merge requests being merged
automatically by other actions.

Allow analyzing upto the relevant commit
2018-12-07 19:24:34 +08:00
Douglas Barbosa Alexandre 8c9e692095
Fill project_repositories for hashed storage 2018-12-06 22:57:56 -02:00
Oswaldo Ferreira 4f6999fa26 Populate MR metrics with events table information (migration) 2018-12-06 22:08:38 -02:00
Toon Claes 5237a55d62
Fill project_repositories for hashed storage
This adds a background migration that will ensure all projects that
are on hashed storage have a row in `project_repositories`.

Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/48527
2018-12-06 21:04:41 -02:00
Jan Provaznik 239fdc78b1 Use FastDestroy for deleting uploads
It gathers list of file paths to delete before destroying
the parent object. Then after the parent_object is destroyed
these paths are scheduled for deletion asynchronously.

Carrierwave needed associated model for deleting upload file.
To avoid this requirement, simple Fog/File layer is used directly
for file deletion, this allows us to use just a simple list of paths.
2018-12-06 22:00:19 +01:00
Kamil Trzciński ebb5d9f4db Revert "Prefer to use correlation-id in logs"
This reverts commit 3560b11922.
2018-12-06 21:46:31 +01:00
Douglas Barbosa Alexandre c3bbad762d Merge branch '19376-post-bfg-cleanup' into 'master'
Allow internal references to be removed

Closes #19376

See merge request gitlab-org/gitlab-ce!23189
2018-12-06 20:43:58 +00:00
Kamil Trzciński 3560b11922 Prefer to use correlation-id in logs
This changes `correlation_id` to be `correlation-id` when passed via jobs
2018-12-06 20:49:31 +01:00
Kamil Trzciński 39c1731a53 Log and pass correlation-id between Unicorn, Sidekiq and Gitaly
The Correlation ID is taken or generated from received X-Request-ID.
Then it is being passed to all executed services (sidekiq workers
or gitaly calls).

The Correlation ID is logged in all structured logs as `correlation_id`.
2018-12-06 20:46:14 +01:00
Nick Thomas 9395d198f9
Use BFG object maps to clean projects 2018-12-06 18:58:00 +00:00
Cindy Pallares a50c777d95 Merge branch '54857-fix-templates-path-traversal' into 'master'
[master]: Prevent a path traversal attack on global file templates

Closes #2745

See merge request gitlab/gitlabhq!2677
2018-12-06 18:38:43 +00:00
Rémy Coutable 69b2a78826 Merge branch 'blob-count2' into 'master'
Support unlimited file search in web UI and API

See merge request gitlab-org/gitlab-ce!23553
2018-12-06 16:59:45 +00:00
Jan Provaznik 3720d02b8b Use approximate counts for big tables 2018-12-06 16:07:14 +00:00
James Edwards-Jones 72c0059407 Allow URLs to be validated as ascii_only
Restricts unicode characters and IDNA deviations
which could be used in a phishing attack
2018-12-06 15:18:18 +00:00
Jan Provaznik 58bfd73331 Optimized file search to work without limits
* removed 100 limit on file search results because we
  load all results anyway
* expensive processing (parsing match content, utf encoding)
  is done only for selected page in paginated output
2018-12-06 09:25:09 +01:00
Stan Hu 184240e86a Gracefully handle unknown/invalid GPG keys
An unknown public GPG key will result in a GPGME::Error thrown from gpg,
which would cause an Error 500 on the signatures endpoint.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54729
2018-12-05 10:55:30 -08:00
Kamil Trzciński 65f106d565 Merge branch '54886-usage-data-group-clusters' into 'master'
Add UsageData for group/project clusters

Closes #54886

See merge request gitlab-org/gitlab-ce!23590
2018-12-05 15:48:12 +00:00
Kamil Trzciński 13b1508c3e Merge branch '34758-deployment-cluster' into 'master'
Use group clusters when deploying (DeploymentPlatform)

See merge request gitlab-org/gitlab-ce!22308
2018-12-05 15:46:41 +00:00
Francisco Javier López a6778fc647 Rename project's pipelines relation 2018-12-05 14:39:15 +00:00
Nick Thomas 69645389e9
Prevent a path traversal attack on global file templates
The API permits path traversal characters like '../' to be passed down
to the template finder. Detect these requests and cause them to fail
with a 500 response code.
2018-12-05 14:12:35 +00:00
Dylan Griffith 821b4fdec7 Add UsageData for group/project clusters 2018-12-05 14:50:30 +01:00
Nick Thomas 61bc233ef0 Merge branch 'osw-fix-grouping-by-file-path' into 'master'
Avoid 500's when serializing legacy diff notes

Closes #54793

See merge request gitlab-org/gitlab-ce!23544
2018-12-05 13:40:24 +00:00
Kamil Trzciński fb048d2cf5 Merge branch 'mr-pipelines-2' into 'master'
Merge request pipelines

See merge request gitlab-org/gitlab-ce!23217
2018-12-05 10:32:39 +00:00
Kamil Trzciński 9a563b1b42 Merge branch 'retryable_create_or_update_kubernetes_namespace' into 'master'
Update K8s project namespace and ServiceAccount if exist

See merge request gitlab-org/gitlab-ce!23525
2018-12-05 09:28:28 +00:00
Dmitriy Zaporozhets a4ff91f794 Merge branch 'set-kubeconfig-nil-when-token-nil' into 'master'
Make KUBECONFIG nil if KUBE_TOKEN is nil

See merge request gitlab-org/gitlab-ce!23414
2018-12-05 09:13:12 +00:00
🤖 GitLab Bot 🤖 00acef4340 Revert "LfsToken uses JSONWebToken::HMACToken by default"
This reverts commit 22954f2202
2018-12-05 07:03:28 +00:00
Shinya Maeda e62bfc7817 Merge request pipelines 2018-12-05 15:57:52 +09:00
Ash McKenzie 1beb7ffc54
Add missing spec coverage for LfsToken
Added specs for #deploy_key_pushable?() and #type()
2018-12-05 15:22:43 +11:00
Ash McKenzie 22954f2202
LfsToken uses JSONWebToken::HMACToken by default
LfsToken::HMACToken#token_valid?() will be examined and if false, look
in redis via LfsToken::LegacyRedisDeviseToken#token_valid?().
2018-12-05 15:22:37 +11:00
Thong Kuah f85440e63c Various improvements to hierarchy sorting
- Rename ordered_group_clusters_for_project ->
ancestor_clusters_for_clusterable
- Improve name of order option. It makes much more sense to have `hierarchy_order: :asc`
and `hierarchy_order: :desc`
- Allow ancestor_clusters_for_clusterable for group
- Re-use code already present in Project
2018-12-05 10:16:44 +13:00
Thong Kuah 703233e1e9 Add association project -> kubernetes_namespaces
kubernetes_namespaces is not needed for project import/export as it
tracks internal state of kubernetes integration
2018-12-05 10:16:44 +13:00
Thong Kuah 5bb2814ae6 Deploy to clusters for a project's groups
Look for matching clusters starting from the closest ancestor, then go
up the ancestor tree.

Then use Ruby to get clusters for each group in order. Not that
efficient, considering we will doing up to `NUMBER_OF_ANCESTORS_ALLOWED`
number of queries, but it's a finite number

Explicitly order query by depth

This allows us to control ordering explicitly and also to reverse the
order which is useful to allow us to be consistent with
Clusters::Cluster.on_environment (EE) which does reverse ordering.

Puts querying group clusters behind Feature Flag. Just in case we have
issues with performance, we can easily disable this
2018-12-05 10:16:44 +13:00
Thong Kuah d3866fb48c Modify service so that it can be re-run
If the service fails mid-point, then we should be able to re-run this
service. So, detect presence of any previously created Kubernetes
resource and update or create accordingly.

Fix specs accordingly. In the case of finalize_creation_service_spec.rb,
I decided to stub out the async worker rather than maintaining
individual stubs for various kubeclient calls for that worker.
2018-12-05 10:16:44 +13:00
Kamil Trzciński 12a1da9402 Merge branch 'define-default-value-for-only-except-keys' into 'master'
Define the default value for only/except policies

See merge request gitlab-org/gitlab-ce!23531
2018-12-04 18:55:42 +00:00
Nick Thomas 80163b972a Merge branch 'fix/gb/encrypt-runners-tokens' into 'master'
Encrypt runners tokens

Closes #51232 and #52931

See merge request gitlab-org/gitlab-ce!23412
2018-12-04 16:48:30 +00:00
Oswaldo Ferreira 89a676019c Avoid 500's when serializing legacy diff notes 2018-12-04 13:13:22 -02:00
Shinya Maeda ad957a3f42 Define the default value for only/except policies
Currently, if a job does not have only/except policies, the policy is considered as an unspecified state, and therefore the job is executed regardless of how it's executed and which branch/tags are targetted.
Ideally, this should be specified as only: ['branches', 'tags'], as it indicates that unspecified policy jobs are meant to run on any git references.
2018-12-05 00:11:48 +09:00
Francisco Javier López 6ed50b62e7 CE port Refactor Gitlab::Checks::ChangeAccess class 2018-12-04 11:55:49 +00:00
Grzegorz Bizon 6b4926f2aa Merge commit '83f0798e7dc588f0e4cb6816daadeef7dbfc8b81' into fix/gb/encrypt-runners-tokens
* commit '83f0798e7dc588f0e4cb6816daadeef7dbfc8b81': (101 commits)
2018-12-04 09:11:33 +01:00
Thong Kuah dc18272091 Modify service so that it can be re-run
If the service fails mid-point, then we should be able to re-run this
service. So, detect presence of any previously created Kubernetes
resource and update or create accordingly.

Fix specs accordingly. In the case of finalize_creation_service_spec.rb,
I decided to stub out the async worker rather than maintaining
individual stubs for various kubeclient calls for that worker.

Also add test cases for group clusters
2018-12-04 15:46:46 +13:00