Commit Graph

5576 Commits

Author SHA1 Message Date
Hiroyuki Sato 30cd8432dd Support `only: changes:` on MR pipelines 2019-02-13 10:59:34 +00:00
Grzegorz Bizon d29e81b2aa Merge branch '7048_usage_ping_for_security_dashboard_as_default_view_for_groups-ce' into 'master'
Usage ping for Group overview default user preference

See merge request gitlab-org/gitlab-ce!24980
2019-02-12 14:41:34 +00:00
Yorick Peterse 1319a9edd9 Merge branch '8798-geo-implement-selective-sync-support-for-the-various-fdw-queries' into 'master'
Replace dots with an underscore when creating an alias for the recursive CTE

See merge request gitlab-org/gitlab-ce!25112
2019-02-12 13:09:32 +00:00
Yorick Peterse 6dfce6e786 Merge branch 'sh-import-source-branch-github-forks' into 'master'
Create the source branch for a GitHub import

Closes #57370

See merge request gitlab-org/gitlab-ce!25064
2019-02-12 11:05:22 +00:00
Victor Zagorodny fa518963ec Protect group overview usage ping w/ feature flag
user_preferences key is includes into system usage
data only if group_overview_security_dashboard
feature flag is enabled; see
https://gitlab.com/gitlab-org/gitlab-ee/issues/7048
2019-02-12 12:46:31 +02:00
Victor Zagorodny 60bd0a24f5 Add user_preferences_usage to usage ping 2019-02-12 12:46:31 +02:00
Grzegorz Bizon 91f74f455e Merge branch 'add-client-for-count-diverging-commits' into 'master'
add client support for CountDivergingCommits rpc

See merge request gitlab-org/gitlab-ce!24287
2019-02-12 07:53:13 +00:00
Stan Hu e34a321327 Create the source branch for a GitHub import
When the GitHub importer creates a merge request, it retrieves the SHA
but does not actually create the source branch. This makes it impossible
to merge an open merge request, particularly if the source branch were
from a forked project. In that case, the branch will never exist because
the original `project-name:source-branch` name is never created, nor
is it a valid branch name.

To prevent possible branch name conflicts, forked source branches
are now renamed `github/fork/project-name/source-branch` and created
when necessary.

Note that we only create the source branch if the merge request
is open. For projects that have many merge requests, the project
would end up with a lot of possibly dead branches.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57370
2019-02-11 22:00:05 -08:00
Douglas Barbosa Alexandre 9100ca188c
Replace dots with an underscore when creating an alias for the CTE
When the Arel table to use as the alias contains a schema in your
name, e.g., "gitlab_secondary"."namespaces" it produces an invalid
query.
2019-02-11 18:06:54 -02:00
Lin Jen-Shin b502d90a9f Adapt that diverging commits could be just one bar
refactors the ui for diverging commits so that it's only a single
bar instead of two separate bars
2019-02-11 10:44:06 -08:00
Douglas Barbosa Alexandre 42c3ef50ae Merge branch '52424-goodbye-hipchat' into 'master'
Remove HipChat integration from GitLab

Closes #52424

See merge request gitlab-org/gitlab-ce!22223
2019-02-11 15:26:55 +00:00
Grzegorz Bizon 25af903275 Merge branch 'an-peek-jaeger' into 'master'
Provide a performance bar link to the Jaeger UI

See merge request gitlab-org/gitlab-ce!24902
2019-02-11 08:49:20 +00:00
Ash McKenzie c4f1e8ed10
Move LFS auth hash creation into GitLab::LfsToken 2019-02-11 15:49:36 +11:00
Ash McKenzie 9ab268b9c1
Tidy up Gitlab::LfsToken spec
- Remove unnecessary encrypted_password stubbing
- Remove unnecessary attr_encrypted_db_key_base stub
- Rename shared_example to 'a valid LFS token'
2019-02-11 15:49:36 +11:00
Nick Thomas a5378665a1
Remove HipChat integration from GitLab 2019-02-08 18:20:38 +00:00
Andrew Newdigate 48bcd5248f Provide a performance bar link to the Jaeger UI
Jaeger is a distributed tracing tool. This change adds a "Tracing" link
to the performance bar to directly link to a current request in Jaeger.

This is useful for two reasons: 1 - it provides affordance to developers
that the distributed tracing tool is available, so that it can quickly
be discovered. 2 - it allows developers to quickly find a specific trace
without having to manually navigate to a second user-interface.
2019-02-08 14:08:31 +02:00
Thong Kuah f67fc23727 Upgrade cluster applications, starting with runner 2019-02-07 21:40:55 +00:00
Jason Lenny 37410a9ddf
Add Pages templates
Adds templates for the 5 most popular Pages templates to the new project
menu. This does not add unique icons for the templates because that
turned out more complicated than expected, and this feature is valuable
without them.
2019-02-07 17:05:33 +01:00
John Cai 1f2f38f59a Add client support for count diverging commits
Adds the client call for the gitaly rpc CountDivergingCommits

fixing signature

simplifying commit logic

adding test for max-count

refactoring tests
2019-02-06 22:25:37 -08:00
John Cai 04b9de85a8 Modifying gitaly search files client to add chunking support
updates gitaly proto to 1.7.0, modifies the search files gitaly client
call to use the new chunked_response flag in the rpc request, and stitch
the responses together.

maintains backwards compatibility with older gitaly servers.
2019-02-06 20:32:53 -08:00
Stan Hu e059cca42c Merge branch 'bjk/56788_unicorn_labels' into 'master'
Clean up unicorn sampler metric labels

Closes #56788

See merge request gitlab-org/gitlab-ce!24626
2019-02-06 22:36:33 +00:00
Rémy Coutable b0e2e76004 Merge branch 'sh-log-project-name-with-gitaly' into 'master'
Send project name with Gitaly repository requests

Closes gitaly#1394

See merge request gitlab-org/gitlab-ce!23373
2019-02-06 17:03:39 +00:00
GotenXiao 7a1c810dc9 Fix #44332 - Add support for profile and email 2019-02-06 16:48:36 +00:00
Ben Kochie 54438ad04b
Clean up unicorn sampler metric labels
Change `type` and `address` labels to be less generic to avoid conflicts
with other systems.
2019-02-06 14:19:51 +01:00
Heinrich Lee Yu a04d9ba90c Add reply to notes to turn into discussions 2019-02-06 10:31:46 +00:00
Stan Hu f929411c6d Rename gl_project_name -> gl_project_path
Upgrade gitaly-proto to 1.10.0 to have this field.
2019-02-05 21:33:10 -08:00
Stan Hu 322402aada Add more tests and comments around Wiki formatting 2019-02-05 21:33:10 -08: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 6bac612dc4 Clean up Shell.fork_repository
Use project models instead of a list of parameters.
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
Reuben Pereira 2079444091 DB and model changes for Sentry project selection dropdown 2019-02-04 12:12:24 +00:00
Mark Chao c34f6ea604 Consume remaining MigrateApproverToApprovalRulesInBatch
Allow `steal` to handle dead jobs.
2019-02-02 21:45:10 +08:00
Kamil Trzciński d4c7214799
[master] Pipelines section is available to unauthorized users 2019-01-31 16:52:50 +01:00
Francisco Javier López 4b868ba8e7
[master] Check access rights when creating/updating ProtectedRefs 2019-01-31 16:52:50 +01:00
James Lopez f78545af98
Fix tree restorer visibility level 2019-01-31 16:52:49 +01:00
Heinrich Lee Yu 35b8f103a8
Prevent comments by email when issue is locked
This changes the permission check so it uses the policy on Noteable
instead of Project. This prevents bypassing of rules defined in
Noteable for locked discussions and confidential issues.

Also rechecks permissions when reply_to_discussion_id is provided since the
discussion_id may be from a different noteable.
2019-01-31 16:52:48 +01:00
Francisco Javier López b3c13bbb3c
Added validations to prevent LFS object forgery 2019-01-31 16:51:54 +01:00
Luke Duncalfe f27cba0fee
Fix private user email being visible in tag webhooks
Fixes #54721
2019-01-31 16:51:18 +01:00
Luke Duncalfe 6c0758f69b
Prefer build() rather than create() 2019-01-31 16:51:17 +01:00
James Lopez 57f082d969
Fix path disclosure on Project Import 2019-01-31 16:51:16 +01:00
Balasankar "Balu" C 232a7a36e2
Add number of repositories to usage ping data 2019-01-31 18:46:07 +05:30
Douwe Maan 4c2096b46a Merge branch 'an-opentracing-render-tracing' into 'master'
Add OpenTracing instrumentation for Action View Render events

See merge request gitlab-org/gitlab-ce!24728
2019-01-30 12:33:02 +00:00
Andrew Newdigate d022ce8655 Add OpenTracing instrumentation for Action View Render events
This change adds three new instrumentations, driven through rails
notifications: render_template.action_view,
render_collection.action_view and render_partial.action_view.

These can help developers understand why renders are taking a long
time which may in turn help them to improve their performance.
2019-01-30 13:38:19 +02:00
Lin Jen-Shin 6fc5495703 Merge branch 'anan-add-MethodCallWithoutArgsParentheses-cop' into 'master'
Re-enable MethodCallWithoutArgsParentheses Cop

Closes #56795

See merge request gitlab-org/gitlab-ce!24631
2019-01-30 10:02:38 +00:00
Brandon Labuschagne def2b548d2 Revert the "What's new" feature 2019-01-29 20:45:47 +00:00
Andrew Newdigate ff0b2cc61f Re-enable MethodCallWithoutArgsParentheses Cop
Re-enables and autocorrects all instances of the
Style/MethodCallWithoutArgsParentheses rule
2019-01-29 21:05:30 +02:00
Andreas Brandl 4ac06d344b
Revert " Trigger iid logic from GitHub importer for merge requests."
This reverts commit fb98496f49.
2019-01-29 15:38:40 +01:00
Andreas Brandl 820739eb09
Revert "Trigger iid logic from GitHub importer for issues."
This reverts commit b78a69b06c.
2019-01-29 15:38:40 +01:00
Andreas Brandl 852e68fd95
Revert "Trigger iid logic from GitHub importer for milestones."
This reverts commit 358675d09f.
2019-01-29 15:38:40 +01:00
Gabriel Mazetto 7bc16889df Refactor Storage Migration
Specs were reviewed and improved to better cover the current behavior.
There was some standardization done as well to facilitate the
implementation of the rollback functionality.

StorageMigratorWorker was extracted to HashedStorage namespace were
RollbackerWorker will live one as well.
2019-01-25 20:26:35 +01:00
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