Commit Graph

3251 Commits

Author SHA1 Message Date
Mike Greiling 7b262c4356 Resolve "Precompiled assets with digest strings are ignored in CI" 2017-10-03 14:47:56 +00:00
Alessio Caiazza 5709408585 Hide CI section markers from job trace 2017-10-03 11:35:23 +02:00
Sean McGivern 4582fff662 Merge branch 'close-issue-by-implements' into 'master'
Add "implements" to the default issue closing message regex

Closes #38424

See merge request gitlab-org/gitlab-ce!14612
2017-10-03 08:27:54 +00:00
Sean McGivern 0ac06c89e9 Merge branch 'ff_port_from_ee' into 'master'
Move Fast-Forward Merge to CE

See merge request gitlab-org/gitlab-ce!14272
2017-10-03 08:24:31 +00:00
Andrew Newdigate 27cc1c2b28 Fix for Gitaly nil encoding issue 2017-10-03 08:03:19 +00:00
Jarka Kadlecova c488bcd13e Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into 18608-lock-issues-v2
# Conflicts:
#	db/schema.rb
2017-10-03 09:37:48 +02:00
Alejandro Rodríguez 40060b18c7 [ci skip] Fix archive spec descrptions 2017-10-02 15:33:31 -03:00
Alejandro Rodríguez fce708c154 Send extra Gitaly params for `send_git_archive` if needed 2017-10-02 12:39:42 -03:00
Douwe Maan b40192a946 Merge branch '33493-attempt-to-link-saml-users-to-ldap-by-email' into 'master'
Attempt to link saml users to ldap by email

Closes #33493

See merge request gitlab-org/gitlab-ce!14216
2017-10-02 15:24:48 +00:00
Douwe Maan 4716e81f9d Merge branch 'revert-configurable-size-limits' into 'master'
Revert "Increase diff limits to 100 KB for collapse and 200 KB overall"

See merge request gitlab-org/gitlab-ce!14628
2017-10-02 14:39:55 +00:00
Yorick Peterse c16b99a49c
Use a UNION ALL for getting merge request notes
In this particular case the use of UNION ALL leads to a better query
plan compared to using 1 big query that uses an OR statement to combine
different data sources.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/38508 for more
information.
2017-10-02 15:31:59 +02:00
Sean McGivern a5d47bb063 Revert "Increase diff limits to 100 KB for collapse and 200 KB overall"
This reverts commit 1d3c33b57e.
2017-10-02 13:54:40 +01:00
Guilherme Vieira 4e4a29ad75 Add "implements" to the default issue closing message regex 2017-10-02 12:02:38 +00:00
Tiago Botelho 011c168bff Refactors SAML identity creation in gl_user. 2017-10-02 11:35:09 +01:00
Valery Sizov a0ac2d932c Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ff_port_from_ee 2017-10-02 13:15:46 +03:00
Valery Sizov 284185a356 Add merge_requests_rebase_enabled to json entities for specs 2017-10-02 12:54:28 +03:00
Jacob Vosmaer 972c5e8900 Fix 'gitlay' typo in spec 2017-10-02 11:37:26 +02:00
Sean McGivern 0a69abdb28 Merge branch 'gitaly-add-branch' into 'master'
Implement OperationService.UserAddBranch Gitaly RPC

Closes gitaly#544

See merge request gitlab-org/gitlab-ce!14522
2017-10-02 09:27:23 +00:00
Alejandro Rodríguez fa5f0164eb Implement OperationService.UserAddBranch Gitaly RPC 2017-09-30 00:58:56 -03:00
Alejandro Rodríguez 16f850033f Populate `Gitlay::Repository`'s `gl_repository` field 2017-09-30 00:58:56 -03:00
Alejandro Rodríguez a97ff8aae0 Add a factory for `Gitaly::GitCommit`s 2017-09-30 00:51:16 -03:00
David Turner dbcf48af8b Add username as GL_USERNAME in hooks (http)
When calling pre-receive, post-receive, and update hooks, add the GitLab
username as the GL_USERNAME environment variable.

This patch only handles cases where pushes are over http, or via
the web interface.  Later, we will address the ssh case.
2017-09-29 18:12:03 -04:00
Jacob Vosmaer e5fecc3a37 Create repositories via Gitaly 2017-09-29 18:27:06 +02:00
Lin Jen-Shin 9401c137fd Just allow the scheme we want! 2017-09-29 21:45:00 +08:00
Rémy Coutable 05e9c9f77e Merge branch '36631-activerecord-statementinvalid-pg-querycanceled-error-canceling-statement-due-to-statement-timeout' into 'master'
Insert at most 1,000 rows at once in MR diff background migration

Closes #36631 et #37505

See merge request gitlab-org/gitlab-ce!13661
2017-09-29 13:43:28 +00:00
Jacob Vosmaer (GitLab) 403712f06e Make Repository#has_visible_content more efficient 2017-09-29 13:08:44 +00:00
Lin Jen-Shin f7fd36f2a2 Adapt to the latest addressable behaviour 2017-09-29 20:42:27 +08:00
Sean McGivern 1507ff8ab7 Make MR diff background migration less likely to time out
This version does not use transactions, but individual statements. As we have
unique constraints on the target tables for the inserts, we can just ignore
uniqueness violations there (as long as we always insert the same batch size, in
the same order).

This means the spec now must use truncation, not a transaction, as the
uniqueness violation means that the whole transaction for that spec would be
invalid, which isn't what we'd want. In real-world use, this isn't run in a
transaction anyway.

This commit also wraps unhandled exceptions, for easier finding in Sentry, and
logs with a consistent format, for easier searching.
2017-09-29 11:56:08 +01:00
Sean McGivern 917194153f Insert at most 1,000 rows at once in MR diff background migration
We were hitting the statement timeout for very large MR diffs. Now we insert at
most 1,000 rows to `merge_request_diff_commits` in a single statement, or 100
rows to `merge_request_diff_files`.
2017-09-29 11:00:19 +01:00
Robert Speicher 07c3112ef5 Merge branch 'feature/migrate-repository-rm-tag-to-gitaly' into 'master'
Migrate Git::Repository#rm_tag to Gitaly

Closes gitaly#562

See merge request gitlab-org/gitlab-ce!14388
2017-09-28 22:43:37 +00:00
Eric Eastwood 3468ca835d Merge branch 'master' into ff_port_from_ee
Conflicts:
	app/models/project.rb
	db/schema.rb
2017-09-28 16:59:49 -05:00
Ahmad Sherif 3944e16b4b Migrate Git::Repository#rm_tag to Gitaly
Closes gitaly#562
2017-09-28 23:36:40 +02:00
Douwe Maan ae03a52f09 Merge branch 'hashed-storage-migration-path' into 'master'
Hashed storage migration path

Closes gitlab-ee#3118

See merge request gitlab-org/gitlab-ce!14067
2017-09-28 17:26:16 +00:00
Gabriel Mazetto 38607b48b6
[Backported from EE] Readonly flag for Projects
This is used in EE for the storage migration, and we want to use this
in CE as well to be able to migrate projects to hashed_storage.
2017-09-28 13:20:11 +01:00
Sean McGivern b63e8d64c1 Handle error when fetching ref for MR with deleted source branch
If the ref doesn't exist, and the source branch is deleted, we can't get it back
easily. Previously, we ignored this error by shelling out, so replicate that
behaviour.
2017-09-28 11:11:10 +01:00
Kamil Trzciński 0bba522f74 Merge branch 'backstage/gb/refactor-pipeline-create-service' into 'master'
Refactor a service responsible for creating a pipeline

Closes #37563 and #34415

See merge request gitlab-org/gitlab-ce!14482
2017-09-27 14:44:28 +00:00
Eric Eastwood 6f9a6d37a9 Merge branch 'master' into ff_port_from_ee 2017-09-26 16:24:54 -05:00
Robert Speicher d0606b5ff4 Merge branch 'dm-bitbucket-import-truncated-shas' into 'master'
Fix bug that caused merge requests with diff notes imported from Bitbucket to raise errors

Closes #38100

See merge request gitlab-org/gitlab-ce!14438
2017-09-26 14:16:46 +00:00
Grzegorz Bizon 835bdcb88e Add specs for pipeline chain builder sequence class 2017-09-26 14:24:40 +02:00
Grzegorz Bizon f6bd832f3f Fix some code style offenses in pipeline chain classes 2017-09-26 14:15:05 +02:00
Grzegorz Bizon 53cad50043 Add missing tests for pipeline chain access validator 2017-09-26 14:13:08 +02:00
Grzegorz Bizon 6a9cfdde02 Add specs for pipeline builder that validates config 2017-09-26 14:04:28 +02:00
Grzegorz Bizon 39f05fd85e Add specs for pipeline builder repository validator 2017-09-26 13:40:37 +02:00
Grzegorz Bizon 652ecff91b Add specs for builder chain that persist a pipeline 2017-09-26 13:34:53 +02:00
Grzegorz Bizon 2432d5bd9e Add specs for builder chain step that skipps pipelines 2017-09-26 13:22:28 +02:00
Grzegorz Bizon da15b38850 Add specs for pipeline builder abilities validator 2017-09-26 13:00:29 +02:00
Grzegorz Bizon fa3fb23fb1 Move pipeline builder validation chain to a module 2017-09-26 11:53:50 +02:00
Grzegorz Bizon 609fa45f0e Split pipeline chain builder validation class 2017-09-26 11:50:47 +02:00
Jarka Kadlecova 142bbd900b Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into 18608-lock-issues
# Conflicts:
#	app/assets/javascripts/notes/components/issue_comment_form.vue
2017-09-25 18:48:58 +02:00
Douwe Maan c19030332c Add specs 2017-09-25 16:56:14 +02:00
Grzegorz Bizon 8f47d484da Extract pipeline chain builder classes from service 2017-09-25 16:22:00 +02:00
Grzegorz Bizon 1209f4f671 Move related pipeline class to new pipeline module 2017-09-25 13:22:04 +02:00
Kim "BKC" Carlbäcker 9c16958c30 Migrate Gitlab::Git::Repository#log to Gitaly 2017-09-25 11:34:10 +02:00
Tiago Botelho 718e5b0865 Attempt to link saml users to ldap by email 2017-09-25 09:44:31 +01:00
Douwe Maan 7cf8e0981a Merge branch '36549-circuit-breaker-handles-missing-storages' into 'master'
Allow the git circuit breaker to correctly handle missing repository storages

Closes #36549

See merge request gitlab-org/gitlab-ce!14417
2017-09-22 20:24:22 +00:00
Rémy Coutable 41eea4fd6a Merge branch '33328-usage-ping-for-gitlab-features-and-components' into 'master'
Adds gitlab features and components to usage ping data.

Closes #33328

See merge request gitlab-org/gitlab-ce!14305
2017-09-22 11:06:02 +00:00
Douwe Maan 408c595292 Merge branch 'sh-blob-raw-check' into 'master'
Ensure that Blob.raw returns always returns a valid blob object

See merge request gitlab-org/gitlab-ce!14412
2017-09-22 10:40:27 +00:00
Nick Thomas ba0ebbb510 Allow the git circuit breaker to correctly handle missing repository storages 2017-09-22 10:05:28 +01:00
Rémy Coutable d2d5549d2a Merge branch 'fix-multi-line-hook-output' into 'master'
Display full pre-receive and post-receive hook output in GitLab UI

Closes #25214

See merge request gitlab-org/gitlab-ce!14222
2017-09-22 06:12:58 +00:00
Stan Hu 794b4c5579 Ensure that Blob.raw returns always returns a valid blob object
In gitlab-org/gitlab-ee!2976, we saw that a given OID could point
to a commit, which would cause the delta size check to fail.
Gitaly already returns nil if the OID isn't a blob, so this change
makes the Rugged implementation consistent.
2017-09-21 14:49:51 -04:00
Robert Speicher 6c026c3670 Merge branch 'dm-closing-issue-urls' into 'master'
Correctly detect multiple issue URLs after 'Closes...' in MR descriptions

Closes #33745

See merge request gitlab-org/gitlab-ce!14411
2017-09-21 17:26:41 +00:00
Tiago Botelho 25932308c0 Adds gitlab features and components to usage ping data. 2017-09-21 14:47:35 +01:00
Robin Bobbitt fbe205f92f Display full pre-receive and post-receive hook output in GitLab UI 2017-09-21 09:13:00 -04:00
Tiago Botelho 4c5acddaa7 Adds EE tag detection to remove_old in gitlab backup. 2017-09-21 13:00:58 +01:00
Douwe Maan a3d5c82f53 Correctly detect multiple issue URLs after 'Closes...' in MR descriptions 2017-09-21 12:42:25 +02:00
Douwe Maan 70dc7e9a99 Merge branch 'gitlab-git-popen' into 'master'
Use Gitlab::Git's Popen on that module's code

Closes gitaly#597

See merge request gitlab-org/gitlab-ce!14237
2017-09-20 15:15:53 +00:00
Rémy Coutable 2ce49b53b9 Merge branch '32796-tighten-up-remove-old-while-backing-up-gitlab' into 'master'
Tighten up remove_old regex from gitlab backup manager.

Closes #32796

See merge request gitlab-org/gitlab-ce!14333
2017-09-20 15:15:39 +00:00
Luke "Jared" Bennett ff7b545c8e
Merge remote-tracking branch 'origin/master' into 18608-lock-issues 2017-09-20 15:23:00 +01:00
Alejandro Rodríguez 34eeac6108 Use Gitlab::Git's Popen on that module's code
This allows the current Gitaly migration to depend on less code outside
of the Gitlab::Git module
2017-09-20 13:21:54 +02:00
Tiago Botelho 0a60698892 Tighten up remove_old regex from gitlab backup manager. 2017-09-20 12:11:14 +01:00
Grzegorz Bizon b49bd4d3bb Fix rewriting issue references with group milestones 2017-09-20 09:55:54 +00:00
Valery Sizov 7af585f166 Fast forward merge: basic implemenation[ci skip] 2017-09-19 23:48:40 -05:00
Robert Speicher 8aac719fd6 Merge branch 'fix/gitaly-commit-diff-rpc-encoding-error' into 'master'
Encode paths properly for Gitaly Commit{Diff,Delta}

Closes gitaly#589

See merge request gitlab-org/gitlab-ce!14361
2017-09-20 00:32:58 +00:00
Kamil Trzciński c60bdf9189 Merge branch 'backstage/gb/jobs-triggering-policy-specifications' into 'master'
Implement job policy specifications

Closes #37280

See merge request gitlab-org/gitlab-ce!14265
2017-09-19 15:45:44 +00:00
Ahmad Sherif 28d95e10a4 Encode paths properly for Gitaly Commit{Diff,Delta}
Fixes gitaly#589
2017-09-19 13:35:22 +02:00
Andrew Newdigate 64d7ec0a9e Detect n+1 issues involving Gitaly 2017-09-19 10:55:37 +00:00
Grzegorz Bizon 14966419e3 Fix closing braces in YAML processor specs 2017-09-19 10:35:18 +02:00
Rémy Coutable ce5abaae80 Merge branch '37789-followup-for-read-registry-change' into 'master'
Clean up read_registry scope changes

Closes #37789

See merge request gitlab-org/gitlab-ce!14307
2017-09-18 14:42:37 +00:00
Grzegorz Bizon f028718641 Raise exception when initializing unknown policy 2017-09-18 14:39:42 +02:00
Robin Bobbitt 0013e6c00d Clean up read_registry scope changes
Closes #37789
2017-09-18 08:39:01 -04:00
Grzegorz Bizon 00e58f835a Use parentheses in CI/CD kubernetes policy specs 2017-09-18 14:37:11 +02:00
Grzegorz Bizon f52c61f846 Do not initialize YAML processor with project full path 2017-09-18 14:35:31 +02:00
Grzegorz Bizon d79ad28fcb Do not pass project path from YAML processor
Use project full path that can be received from a pipeline object
2017-09-18 14:29:43 +02:00
Grzegorz Bizon a04cbd5bb5 Add specs for CI/CD job policy refs specification 2017-09-18 13:57:14 +02:00
Grzegorz Bizon 97caed20ed Add specs for CI/CD job policy factory method 2017-09-18 13:57:14 +02:00
Grzegorz Bizon a7a7e2d8f7 Fix Rubocop offenses in YAML processor classes 2017-09-18 13:57:14 +02:00
Grzegorz Bizon 10a486b366 Remove YAML processor refactoring stubs and fix specs 2017-09-18 13:57:14 +02:00
Grzegorz Bizon 59f87e7317 Implement CI/CD kubernetes policy specification 2017-09-18 13:57:14 +02:00
Luke "Jared" Bennett 9ca7c94f66
Merge remote-tracking branch 'origin/master' into 18608-lock-issues 2017-09-18 10:54:12 +01:00
Rémy Coutable 2f594206e2 Merge branch 'operation-service-merge' into 'master'
Prepare Repository#merge for migration to Gitaly

Closes gitaly#559

See merge request gitlab-org/gitlab-ce!14154
2017-09-18 09:06:23 +00:00
Douwe Maan 36ad91d75a Merge branch 'mk-delete-conflicting-redirects-mysql' into 'master'
Clean up redirect routes that conflict with regular routes

Closes #36229

See merge request gitlab-org/gitlab-ce!13783
2017-09-18 08:24:52 +00:00
Yorick Peterse ac702af822
Fix setting share_with_group_lock
Prior to this commit running
Namespace#force_share_with_group_lock_on_descendants would result in
updating _all_ namespaces in the namespaces table, not just the
descendants. This is the result of ActiveRecord::Relation#update_all not
taking into account the CTE. To work around this we use the CTE query as
a sub-query instead of directly calling #update_all.

To prevent this from happening the relations returned by
Gitlab::GroupHierarchy are now marked as read-only, resulting in an
error being raised when methods such as #update_all are used.

Fortunately on GitLab.com our statement timeouts appear to have
prevented this query from actually doing any damage other than causing
a very large amount of dead tuples.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37916
2017-09-15 17:38:46 +02:00
Jacob Vosmaer 902b5347dc Prepare Repository#merge for migration to Gitaly 2017-09-15 16:39:20 +02:00
Michael Kozono c923208721 Spread out the work a little 2017-09-14 14:17:23 -07:00
Michael Kozono ee4f73916f Extract helper for queuing background jobs 2017-09-14 14:17:23 -07:00
Michael Kozono f1e963bd89 Add specs for deleting conflicting redirects 2017-09-14 14:17:23 -07:00
Rémy Coutable 0cf694fbf3 Merge branch 'gitlab-git-user' into 'master'
Rename Gitlab::Git::Committer to User

See merge request gitlab-org/gitlab-ce!14254
2017-09-14 17:13:39 +00:00
Jacob Vosmaer 9e40baba1e Rename Gitlab::Git::Committer to User 2017-09-14 17:42:02 +02:00
Jarka Kadlecova b928720852 Support discussion locking in the backend 2017-09-14 14:50:32 +02:00
Rémy Coutable cc66c3fda2
Don't force the encoding of the OAuth provider in Gitlab::OAuth::AuthHash#provider
Some providers freeze their name (e.g.
414c43ef3f/lib/omniauth/strategies/google_oauth2.rb (L1)),
so trying to modify the string would fail with a `can't modify frozen
String` exception (see
https://gitlab.com/gitlab-org/gitlab-ce/issues/37845#note_40308148).

In this case, we can just stop trying to force the encoding of the
provider name as they should always be in utf8 by default.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-09-14 10:29:35 +02:00
Rémy Coutable f06d370b20 Merge branch 'backport-ee-changes-to-url-sanitizer' into 'master'
Backport more EE changes to Gitlab::UrlSanitizer

See merge request !14150
2017-09-13 17:10:47 +00:00
Kamil Trzciński e19827ab3b Merge branch 'zj-usage-data-auto-devops' into 'master'
Add usage ping for Auto DevOps

Closes #37648

See merge request !14162
2017-09-13 08:48:20 +00:00
Grzegorz Bizon b097d065c5 Merge branch '5836-move-lib-ci-into-gitlab-namespace' into 'master'
Resolve "Move `lib/ci` to `lib/gitlab/ci`"

Closes #5836

See merge request !14078
2017-09-13 07:21:41 +00:00
Maxim Rydkin e83a818751
adds changelog
fix CI

fix CI
2017-09-12 22:32:02 +03:00
Maxim Rydkin 5b296f81e2
move `lib/ci/mask_secret.rb` into `lib/gitlab/ci/mask_secret.rb` 2017-09-12 22:32:02 +03:00
Maxim Rydkin c45ace8972
move `lib/ci/gitlab_ci_yaml_processor.rb` into `lib/gitlab/ci/yaml_processor.rb` 2017-09-12 22:32:02 +03:00
Maxim Rydkin f364cc34ea
move `lib/ci/charts.rb` into `lib/gitlab/ci/charts.rb` 2017-09-12 22:32:01 +03:00
Maxim Rydkin 060fc3905d
move `lib/ci/ansi2html.rb` into `lib/gitlab/ci/ansi2html.rb` 2017-09-12 22:32:01 +03:00
Robert Speicher e21c12375a Merge branch 'revert-2f46c3a8' into 'master'
Revert "Merge branch 'revert-f2421b2b' into 'master'"

See merge request !14190
2017-09-12 18:31:54 +00:00
Robert Speicher a1a2ce4af4 Merge branch 'gitaly-519-commit-stats' into 'master'
Migrate Git::CommitStats to Gitaly

Closes gitaly#519

See merge request !14077
2017-09-12 16:48:30 +00:00
Micael Bergeron a31e0aff22 Resolve "Error 500 in non-UTF8 branch names" 2017-09-12 14:07:31 +00:00
Zeger-Jan van de Weg 74bf291c78
Add auto devops enabled/disabled to usage ping 2017-09-12 12:33:48 +02:00
Kamil Trzciński 2602cc0c36 Merge branch 'hide-read-registry-scope-when-registry-disabled' into 'master'
Hide read_registry scope when registry is disabled on instance

See merge request !13314
2017-09-12 09:57:48 +00:00
Nick Thomas b46d5b13ec Backport more EE changes to Gitlab::UrlSanitizer 2017-09-11 21:43:43 +01:00
Kim "BKC" Carlbäcker 25c34608b9 Migrate Git::CommitStats to Gitaly 2017-09-11 21:00:58 +02:00
Annabel Dunstone Gray 9b177bb7c9 Revert "Merge branch 'revert-f2421b2b' into 'master'"
This reverts merge request !14148
2017-09-11 15:44:42 +00:00
Zeger-Jan van de Weg 5c6f40ab6e
Add usage ping for Auto DevOps
Fixes gitlab-org/gitlab-ce#37648
2017-09-08 19:38:02 +02:00
Rubén Dávila 52a2423e37 Revert "Merge branch '35012-navigation-add-option-to-change-navigation-color-palette' into 'master'"
This reverts merge request !13619
2017-09-08 14:48:44 +00:00
Robert Speicher bc10afb600 Merge branch 'dm-go-get-xss' into 'security-9-3'
Fix XSS issue in go-get handling

See merge request !2128
2017-09-07 20:22:16 -04:00
Douwe Maan 40b0b1a391 Merge branch '35558-only-one-garbage-collection-should-be-running-per-project-at-once' into 'master'
Adds exclusive lease to Git garbage collect worker.

Closes #35558

See merge request !14036
2017-09-07 19:34:59 +00:00
Tiago Botelho 39298575a8 Adds exclusive lease to Git garbage collect worker. 2017-09-07 18:52:04 +01:00
Andrew Newdigate 94680e1448 Gitaly feature toggles are on by default in development environments 2017-09-07 17:39:00 +00:00
Kamil Trzcinski 12ddc28f84 Merge remote-tracking branch 'origin/master' into zj/gitlab-ce-zj-auto-devops-table 2017-09-07 18:03:20 +02:00
Sean McGivern f2421b2b97 Merge branch '35012-navigation-add-option-to-change-navigation-color-palette' into 'master'
Add option to change navigation color palette

Closes #35012

See merge request !13619
2017-09-07 15:56:00 +00:00
Sean McGivern 4ae8e20c9c Merge branch 'events-migration-cleanup' into 'master'
Finish migration to the new events setup

Closes #37241

See merge request !13932
2017-09-07 15:33:54 +00:00
Zeger-Jan van de Weg 62a5cc7134
Merge branch 'master' into zj-auto-devops-table 2017-09-07 15:20:04 +02:00
Alejandro Rodríguez c2e99b40f7 Implement fix for n+1 issue on `flatten_tree` helper 2017-09-06 17:47:25 -03:00
Kamil Trzcinski cd8ea329f0 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into zj/gitlab-ce-zj-auto-devops-table 2017-09-06 21:00:47 +02:00
Annabel Dunstone Gray 6ee158197d Add previews in preferences 2017-09-06 11:37:40 -07:00
Sean McGivern 1245cccf68 Use `table` helper in migration specs 2017-09-06 12:57:30 -05:00
Sean McGivern cd84ce1a1b Don't depend on user model in migration spec
The User model now has a default value for a field that didn't exist when these
migrations ran.
2017-09-06 12:56:22 -05:00
Annabel Dunstone Gray c3ac731152 Add blue theme 2017-09-06 12:54:09 -05:00
Annabel Dunstone Gray 3c815f97d3 Add functionality for two themes 2017-09-06 12:54:09 -05:00
Rubén Dávila 6c49a62800 Restore some changes from !9199 2017-09-06 12:54:09 -05:00
Robert Speicher 86cbf60cbb Merge branch 'feature/migrate-branch-operations-to-gitaly' into 'master'
Migrate creating/deleting a branch to Gitaly

See merge request !13864
2017-09-06 17:26:05 +00:00
Douwe Maan 04f8874209 Merge branch 'url-sanitizer-fixes' into 'master'
Fix problems sanitizing URLs with empty passwords

Closes gitlab-ee#3352

See merge request !14083
2017-09-06 16:15:02 +00:00
Kamil Trzciński 29a34b3c28 Merge branch 'feature/gb/download-single-job-artifact-using-api' into 'master'
Add API endpoint for downloading a single job artifact

Closes #37196

See merge request !14027
2017-09-06 15:58:26 +00:00
Sean McGivern ba39b26cc2 Merge branch '35942_api_binary_encoding' into 'master'
API fix for non UTF-8 data

Closes #35942

See merge request !14038
2017-09-06 15:55:35 +00:00
Ahmad Sherif 41ef94e777 Migrate creating/deleting a branch to Gitaly 2017-09-06 17:25:17 +02:00
Yorick Peterse 235b105c91
Finish migration to the new events setup
This finishes the procedure for migrating events from the old format
into the new format. Code no longer uses the old setup and the database
tables used during the migration process are swapped, with the old table
being dropped.

While the database migration can be reversed this will 1) take a lot of
time as data has to be coped around 2) won't restore data in the
"events.data" column as we have no way of restoring this.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37241
2017-09-06 16:40:31 +02:00
Nick Thomas c8bdb20228 Remove blank passwords from sanitized URLs 2017-09-06 15:29:14 +01:00
Nick Thomas 759f34bd0a Backport EE fixes to Gitlab::UrlSanitizer to CE 2017-09-06 15:29:13 +01:00
micael.bergeron 46f6092a6d [ci-skip] spec for an instance method 2017-09-06 09:44:12 -04:00
Alexander Keramidas 4df54f2607 Profile updates from providers 2017-09-06 16:38:52 +03:00
Zeger-Jan van de Weg 8189347b49
Merge branch 'master' into zj-auto-devops-table 2017-09-06 15:16:38 +02:00
micael.bergeron 5625b0e453 add .json_safe_diff spec 2017-09-06 09:01:53 -04:00
Grzegorz Bizon 3b9f9aa00b Merge commit 'd1b60cbc67dc14b21820ef3f823a8e1ea851697d' into feature/gb/download-single-job-artifact-using-api
* commit 'd1b60cbc67dc14b21820ef3f823a8e1ea851697d': (210 commits)
2017-09-06 14:29:17 +02:00
Douwe Maan 9985296521 Merge branch 'AshleyDumaine/gitlab-ce-36994-toggle-for-automatically-collapsing-outdated-diff-comments' into 'master'
Add setting to collapse outdated diff comments on push

Closes #36994

See merge request !14053
2017-09-06 11:57:16 +00:00
Douwe Maan c1af169f1a Merge branch 'fix/import-export-performance' into 'master'
Improve Import/Export memory use and performance

Closes #35389 and #26556

See merge request !13957
2017-09-06 11:55:28 +00:00
Sean McGivern b40941db14 Fix note resolution specs 2017-09-06 10:10:16 +01:00
Ashley Dumaine ef4b3a39bc Add functionality to collapse outdated diff comments regardless of discussion resolution 2017-09-06 10:07:46 +01:00
Rubén Dávila 66cfb901c0 Optimize SQL queries used in Groups::GroupMembersController#create
The following optimizations were performed:

- Add new association to GroupMember and ProjectMember

  This new association will allow us to check if a user is a member of a
  Project or Group through a single query instead of two.

- Optimize retrieving of Members when adding multiple Users
2017-09-05 15:54:07 -05:00
James Lopez 104f221b60 fix specs 2017-09-05 21:06:27 +02:00
Ahmad Sherif e10437de40 Migrate Gitlab::Git::Repository#find_branch to Gitaly 2017-09-05 17:29:45 +00:00
Sean McGivern 9bb056e0f1 Merge branch 'fuzzy-issue-search' into 'master'
Fuzzy search issues / merge requests

Closes #26835, #29994, and #20362

See merge request !13780
2017-09-05 15:48:39 +00:00
James Lopez 1d57ae8f84 fix typo 2017-09-05 17:47:45 +02:00
James Lopez d8d05e5f28 refactor code a little 2017-09-05 17:47:45 +02:00
James Lopez 4119206f76 fix export performance of CI builds 2017-09-05 17:47:45 +02:00
Sean McGivern 8813089a64 Merge branch 'mr-index-page-performance' into 'master'
Re-use issue/MR counts for the pagination system

Closes #27168

See merge request !13805
2017-09-05 14:51:19 +00:00
Hiroyuki Sato 8bafe5d1ee Fix typo 2017-09-05 22:23:02 +09:00
Alexis Reigel 978252a3fa use new #verification_status 2017-09-05 12:18:33 +02:00
Alexis Reigel 00392d929b add verification_status: same_user_different_email
this is used to make a difference between a committer email that belongs
to user, where the user used a different email for the gpg key. this
means that the user is the same, but a different, unverified email is
used for the signature.
2017-09-05 12:18:32 +02:00
Alexis Reigel 2a89037b63 downcase gpg key's emails
this is necessary for email comparisons
2017-09-05 12:18:31 +02:00
Alexis Reigel c5e0bd56fb extract shared example 2017-09-05 12:18:31 +02:00
Alexis Reigel 64855c8e30 match the committer's email against the gpg key
the updated verification of a gpg signature requires the committer's
email to also match the user's and the key's emails.
2017-09-05 12:18:31 +02:00
Alexis Reigel 508ff17b34 pass whole commit to Gitlab::Gpg::Commit again
we need the commit object for the updated verification that also checks
the committer's email to match the gpg key and user's emails.
2017-09-05 12:18:31 +02:00
Grzegorz Bizon c53f319f88 Extract a class that represents artifacts file path 2017-09-05 12:17:56 +02:00
Yorick Peterse 42062a454a
Re-use issue/MR counts for the pagination system
This changes the issue and MR index pages so the pagination system
re-uses the output of the COUNT(*) query used to calculate the number of
rows per state (opened, closed, etc). This removes the need for an
additional COUNT(*) on both pages.
2017-09-05 11:53:45 +02:00
Shinya Maeda 68f6c61cf6 - Allow runner API to pass failure_reason
- Fix spec
2017-09-05 14:30:28 +09:00
Zeger-Jan van de Weg bcd70c4c46
Incorporate review 2017-09-04 15:44:46 +02:00
Kamil Trzciński a0c13698f9 Merge branch 'feature/gb/kubernetes-only-pipeline-jobs' into 'master'
Check if Kubernetes is required when creating pipeline jobs

Closes #34785

See merge request !13849
2017-09-04 12:30:27 +00:00
Douwe Maan a6f9470b4a Merge branch 'bvl-only-require-po-parser-in-rake' into 'master'
Only require `simple_po_parser` in rake task that needs it

Closes #37379

See merge request !14018
2017-09-04 10:21:48 +00:00
Grzegorz Bizon e23e86953d Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (469 commits)
2017-09-04 12:13:11 +02:00
Kamil Trzciński d449355f94 Merge branch 'feature/sm/33281-protected-runner-executes-jobs-on-protected-branch' into 'master'
Protected runner executes jobs on protected branch [Solution 1]

Closes #33281

See merge request !13194
2017-09-04 08:23:50 +00:00
Kamil Trzciński a343484bdf Merge branch 'zj-sort-templates' into 'master'
Sort templates when fetching them

Closes #37153

See merge request !13920
2017-09-04 08:18:41 +00:00
Zeger-Jan van de Weg a315e6025c
Merge branch 'master' into zj-auto-devops-table 2017-09-04 09:28:46 +02:00
Zeger-Jan van de Weg 78dad4cf32
Fix tests 2017-09-04 09:27:09 +02:00
Bob Van Landuyt 7199e882db Only require `simple_po_parser` in rake task that needs it
That way we don't need to install it in production, since it's really
not needed there.
2017-09-04 08:30:10 +02:00
Jose Ivan Vargas b623807682 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2017-09-03 16:09:59 -05:00
Shinya Maeda eab938d505 Fix typo 2017-09-03 23:49:11 +09:00
Shinya Maeda f3d3cecf5a Fix schema. Add safe_model_attributes for pipelines 2017-09-03 23:49:10 +09:00
Shinya Maeda 3875983205 Impprove spec by godfat suggestions 2017-09-03 23:49:10 +09:00
Shinya Maeda 1925bfd2a5 Fix spec 2017-09-03 23:49:10 +09:00
Shinya Maeda bbe967abeb Add the rest of specs 2017-09-03 23:49:10 +09:00
Robert Speicher 223849fa17 Merge branch '17849-allow-admin-to-restrict-min-key-length-and-techno' into 'master'
Add settings for minimum key strength and allowed key type

Closes #17849

See merge request !13712
2017-09-01 19:23:08 +00:00
Douwe Maan dceb2112d2 Merge branch 'bvl-validate-po-files' into 'master'
Validate PO files in static analysis

See merge request !13000
2017-09-01 14:30:43 +00:00
Douwe Maan 7d3e888d06 Merge branch '37202-revert-changes-to-signing-enabled' into 'master'
Rollback changes made to signing_enabled.

Closes #37202

See merge request !13956
2017-09-01 11:49:22 +00:00
Bob Van Landuyt 4761235f69 Validate unescaped `%` chars in PO files 2017-09-01 13:44:10 +02:00
Grzegorz Bizon fc4fb6e4d2 Change CI/CD kubernetes policy keyword to `active` 2017-09-01 13:04:08 +02:00
Tiago Botelho 37383d9a9d Rollsback changes made to signing_enabled. 2017-09-01 10:51:40 +01:00
Jacob Vosmaer (GitLab) 35acc4cbbe Make Gitaly PostUploadPack mandatory 2017-09-01 08:45:19 +00:00
Marin Jankovski 28060caa0a
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2017-09-01 09:21:18 +02:00
Dmitriy Zaporozhets 6f96ccaa7d Merge branch 'gitaly-shell-redis' into 'master'
Implement /internal/post_receive unified endpoint for PostReceive tasks

See merge request !13916
2017-09-01 06:49:28 +00:00
Zeger-Jan van de Weg 770bcf71bb
Form for setting project auto devops settings 2017-08-31 22:25:26 +02:00
Bob Van Landuyt 538104bdd1 Fetch all translation keys using a regex 2017-08-31 21:13:02 +02:00
Bob Van Landuyt abe198723d Take `nplurals` into account when validating translations. 2017-08-31 21:13:02 +02:00
Bob Van Landuyt 2c4f9b7a73 Check for newlines in different methods on TranslationEntry 2017-08-31 21:13:02 +02:00
Bob Van Landuyt f35a5d0d99 Split translation & metadata entries into classes 2017-08-31 21:13:01 +02:00
Bob Van Landuyt c6d969949e Validate the number of plurals in an entry 2017-08-31 21:13:01 +02:00
Bob Van Landuyt cdaf1072da Move detailed information of an entry into a separate class 2017-08-31 21:13:01 +02:00
Bob Van Landuyt 0fa0ed7d85 Move `PoLinter` into `Gitlab::I18n` 2017-08-31 21:13:00 +02:00
Bob Van Landuyt 49b3819477 Only perform `join_message` in `validate_variable_usage` 2017-08-31 21:13:00 +02:00
Bob Van Landuyt 1da594d39b Check newlines in translations 2017-08-31 21:13:00 +02:00
Bob Van Landuyt 973c697960 Add spec for languages without plurals 2017-08-31 21:13:00 +02:00
Douwe Maan 52ac5cf27c Merge branch '37266-nomethoderror-undefined-method-current_application_settings-build-failed-30837482' into 'master'
`current_application_settings` belongs on `Gitlab::CurrentSettings`

Closes #37266

See merge request !13955
2017-08-31 14:55:54 +00:00
Alejandro Rodríguez eaf60bb544 Implement /internal/post_receive unified endpoint for PostReceive tasks 2017-08-31 11:31:45 -03:00
Zeger-Jan van de Weg ed8f7ed671
Sort templates when fetching them
Used to rely on the underlying filesystem to sort the entries, now its
forced to be sorted on the name of the template.
2017-08-31 15:45:48 +02:00
Grzegorz Bizon ef030709eb Change kubernetes job policy allowed values
It is now possible to use `kubernetes: configured`.
2017-08-31 14:56:25 +02:00
Sean McGivern 5883ce95ef `current_application_settings` belongs on `Gitlab::CurrentSettings`
The initializers including this were doing so at the top level, so every object
loaded after them had a `current_application_settings` method. However, if
someone had rack-attack enabled (which was loaded before these initializers), it
would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't
have that method.

To fix this:

1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need
   `Object.new.current_application_settings` to work.
2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it
   like that in several places.
3. Change the initializers to use that new form.
2017-08-31 13:38:33 +01:00
Bob Van Landuyt bde39322f1 Add a linter for PO files 2017-08-31 14:10:04 +02:00
Bob Van Landuyt b6646e778d Track the locale in Sentry so we know which ones are failing 2017-08-31 14:10:04 +02:00
Grzegorz Bizon 92673c2c63 Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (275 commits)
  Decrease Metrics/PerceivedComplexity threshold to 17
  Upgrade mail and nokogiri gems due to security issues
  Link out to stackoverflow answer on setting swappiness
  Document swappiness recomendations in the requirements doc
  Fix invalid attribute used for time-ago-tooltip component
  Update latest artifacts doc
  Add changelog entry for flipping verify_certificates
  Default LDAP config verify_certificates to true
  Update share project with groups docs
  remove accidental console.log from karma tests
  update specs to match reorganized monitoring components
  Remove tooltips from new sidebar
  Use `git update-ref --stdin -z` to delete refs
  Don't use public_send in destroy_conditionally! helper
  Remove unused expressions policy from ci/cd config
  Simplify code for appending strategies in CI/CD config
  Raise exception when simplifiable ci entry incomplete
  Add changelog entry
  Fix MySQL failure for emoji autocomplete
  max-width for lazy-loaded images (this was removed in the original MR through merge resolution most probably)
  ...

Conflicts:
	lib/gitlab/ci/config/entry/policy.rb
2017-08-31 14:02:52 +02:00
Sean McGivern 91a55ed6a1 Merge branch 'gitaly-440-shell-fetch-remote' into 'master'
Migrate Repository.FetchRemote to Gitaly

See merge request !13625
2017-08-31 11:08:45 +00:00
Marin Jankovski 7d38df306c
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2017-08-31 10:45:28 +02:00
Kamil Trzciński a0b5684634 Merge branch 'feature/gb/add-complex-jobs-only-except-config-policy' into 'master'
New syntax for CI/CD job triggering policy that supports variables expressions

See merge request !13769
2017-08-31 07:24:57 +00:00
Douwe Maan eacda4cc98 Merge branch '36743-existing-repo-master' into 'master'
[master] Prevent project creation (blank, import or fork) when repository already exists on disk

See merge request gitlab/gitlabhq!2169
2017-08-31 07:03:12 +00:00
Hiroyuki Sato 6edeff3d9c Fix MySQL spec errors 2017-08-31 13:43:56 +09:00
Nick Thomas b84ca08e35 Address review comments 2017-08-30 20:50:44 +01:00
Nick Thomas 6847060266 Rework the permissions model for SSH key restrictions
`allowed_key_types` is removed and the `minimum_<type>_bits` fields are
renamed to `<tech>_key_restriction`. A special sentinel value (`-1`) signifies
that the key type is disabled.

This also feeds through to the UI - checkboxes per key type are out, inline
selection of "forbidden" and "allowed" (i.e., no restrictions) are in.

As with the previous model, unknown key types are disallowed, even if the
underlying ssh daemon happens to support them. The defaults have also been
changed from the lowest known bit size to "no restriction". So if someone
does happen to have a 768-bit RSA key, it will continue to work on upgrade, at
least until the administrator restricts them.
2017-08-30 20:50:44 +01:00
Nick Thomas b0f982fbdf Add settings for minimum key strength and allowed key type
This is an amalgamation of:

* Cory Hinshaw: Initial implementation !5552
* Rémy Coutable: Updates !9350
* Nick Thomas: Resolve conflicts and add ED25519 support !13712
2017-08-30 20:50:44 +01:00
Kim "BKC" Carlbäcker b77176d11a Migrate Repository.FetchRemote to Gitaly
- `Gitlab::Shell.fetch_remote` now takes a `Gitlab::Git::Repository` instead
2017-08-30 20:51:56 +02:00
Hiroyuki Sato 59e5393827 Fuzzy search issuable title or description 2017-08-31 03:14:58 +09:00
Douwe Maan d6e956d3a8 Merge branch '36807-gc-unwanted-refs-after-import' into 'master'
Remove unwanted refs after importing a project

Closes #36807

See merge request !13766
2017-08-30 18:08:37 +00:00
Douwe Maan e68a1fc1be Merge branch 'check-trigger-permissions-mysql' into 'master'
Improve migrations using triggers

Closes #36633

See merge request !13666
2017-08-30 17:55:15 +00:00
Lin Jen-Shin c5553ce772 Use `git update-ref --stdin -z` to delete refs 2017-08-30 22:01:23 +08:00
Grzegorz Bizon 1bf87d2524 Remove unused expressions policy from ci/cd config 2017-08-30 14:47:54 +02:00
Grzegorz Bizon 808fb2549b Raise exception when simplifiable ci entry incomplete 2017-08-30 13:26:11 +02:00
Yorick Peterse 8274e0fe3c Merge branch 'improve-autocomplete-user-performance' into 'master'
Improve AutocompleteController#users.json performance

Closes #36879

See merge request !13754
2017-08-30 11:17:10 +00:00
Yorick Peterse 5eab624d3c
Improve migrations using triggers
This adds a bunch of checks to migrations that may create or drop
triggers. Dropping triggers/functions is done using "IF EXISTS" so we
don't throw an error if the object in question has already been dropped.
We now also raise a custom error (message) when the user does not have
TRIGGER privileges. This should prevent the schema from entering an
inconsistent state while also providing the user with enough information
on how to solve the problem.

The recommendation of using SUPERUSER permissions is a bit extreme but
we require this anyway (Omnibus also configures users with this
permission).

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
2017-08-29 13:02:44 +02:00
Hiroyuki Sato 12633b46b6 Refactor 2017-08-29 18:00:03 +09:00
Hiroyuki Sato 87b51c5981 Move the logic to a concern 2017-08-29 07:14:41 +09:00
James Lopez 49495fe63d fix spec 2017-08-28 15:24:24 +02:00
Hiroyuki Sato 866aab7f2a Fix escape characters was not sanitized 2017-08-26 22:32:55 +09:00
Grzegorz Bizon 5ce9e03f6c Use new complex only/except policy internal scheme 2017-08-26 11:11:28 +02:00
Grzegorz Bizon 15ace6a910 Merge commit '2be34630623711fc20ef8c101b5cef688f207cc1' into backstage/gb/rename-ci-cd-processing-sidekiq-queues
* commit '2be34630623711fc20ef8c101b5cef688f207cc1':
  Common Docker Documentation Location in `gitlab-ce`
  fix deprecation warning present during webpack compiles
  Enable 5 lines of Sidekiq backtrace lines to aid in debugging
  Add support for copying permalink to notes via more actions dropdown
  Handle creating a nested group on MySQL correctly
  Decrease statuses batch size even more in a migration
  Fix repo editor scrollbar
  Replace 'source/search_code.feature' spinach test with an rspec analog
  Authorizations regarding OAuth - style confirmation
  Update README.md
  Refactor complicated API group finding rules into GroupsFinder
  Fix group and project search for anonymous users
  Document version Group Milestones API introduced
  Allow v4 API GET requests for groups to be unauthenticated
  Adjust a range and a size in stages statuses migration
  Update README.md
  Point to /developers on docs/administration/authentiq.md
  Indexes GFM markdown guide
  use inline links instead of referenced
  Add index on ci_runners.contacted_at
2017-08-26 10:55:20 +02:00
Gabriel Mazetto 8f178c4222 Prevent new / renamed project from using a repository path that already exists on disk
There are some redundancies in the validation steps, and that is to
preserve current error messages behavior

Also few specs have to be changed in order to fix madness in validation
logic.
2017-08-25 20:06:06 +02:00
Grzegorz Bizon 0410861171 Add specs for attributable aspect of ci config entry 2017-08-25 18:26:55 +02:00
Grzegorz Bizon 4509594e20 Fix Rubocop offense in CI/CD only/except policy class 2017-08-25 17:54:14 +02:00
Sean McGivern f92a80b42a Merge branch 'bvl-fix-mysql-bare-repository-importer' into 'master'
Handle creating a nested group on MySQL correctly

See merge request !13829
2017-08-25 15:00:35 +00:00
Grzegorz Bizon 7e6bc4dde2 Improve reporting of a CI/CD entry config location 2017-08-25 15:16:09 +02:00
Kamil Trzciński a653c8ead4 Merge branch 'master' into 'backstage/gb/rename-ci-cd-processing-sidekiq-queues'
# Conflicts:
#   db/schema.rb
2017-08-25 12:10:53 +00:00
Bob Van Landuyt 529a07bd1e Handle creating a nested group on MySQL correctly
Since we don't support nested groups on MySQL, raise an error
explaining that on import instead of trying anyway.
2017-08-25 12:35:47 +02:00
Sean McGivern 4a2cc38197 Merge branch '36939-fix-find-blobs-by-path' into 'master'
Fix searching for files by path

Closes #36939

See merge request !13798
2017-08-25 10:26:12 +00:00
Grzegorz Bizon 946e8d3a93 Use only/except policy that returns an array 2017-08-25 12:01:59 +02:00
Grzegorz Bizon a061a2461a Fix CI/CD trigger policy default value 2017-08-25 11:42:40 +02:00
Hiroyuki Sato 9e203582b3 Improve AutocompleteController#user.json performance 2017-08-25 18:41:43 +09:00
Nick Thomas fa2915ec2d Fix searching for files by path 2017-08-25 10:36:32 +01:00
Grzegorz Bizon 873460783a Add specs for a simplifiable CI/CD entry aspect 2017-08-25 11:25:37 +02:00
Grzegorz Bizon fcb4d1f809 Implement complex only/except policy CI/CD config 2017-08-25 10:27:00 +02:00
Grzegorz Bizon 8c409fc40b Make it possible to define CI/CD config strategies 2017-08-25 09:49:18 +02:00