Commit Graph

2416 Commits

Author SHA1 Message Date
Kamil Trzciński 9ccb289aa1 Merge branch 'zj-job-view-goes-real-time' into 'master'
Initial implementation for real time job view

Closes #31397

See merge request !11651
2017-06-05 10:24:57 +00:00
Pawel Chojnacki ae5268ce8c Additional Metrics tests 2017-06-05 11:37:07 +02:00
Pawel Chojnacki 6a70509a27 Towards Reviewable prometheus 2017-06-05 11:37:07 +02:00
Pawel Chojnacki e74896df0c Matched Metrics tests 2017-06-05 11:36:56 +02:00
Robert Speicher 993412f9de Merge branch 'fix/use-new-gitaly-commit-diff-rpc' into 'master'
Use the new Gitaly CommitDiff RPC

See merge request !11826
2017-06-02 19:39:02 +00:00
Sean McGivern 1d3c33b57e Increase diff limits to 100 KB for collapse and 200 KB overall
This is controlled with the feature flag gitlab_git_diff_size_limit_increase.
Both of these limits were basically picked arbitrarily in the first place;
disabling the feature flag reverts to the old limits.
2017-06-02 19:37:09 +01:00
Kamil Trzcinski 0383b48225 Merge remote-tracking branch 'origin/master' into zj-job-view-goes-real-time 2017-06-02 20:32:02 +02:00
Pawel Chojnacki d26573c6e3 Make PrometheusTextFormat return proper output terminated with '\n'
remove file dangling after rebase
2017-06-02 19:48:39 +02:00
Pawel Chojnacki 6a67148ed3 Make production settings fixture use Gitlab::CurrentSettings.current_application_settings
small code formatting changes
2017-06-02 19:46:29 +02:00
Pawel Chojnacki c86e1437eb Make fixture message more descriptive
+ use strip_heredoc to make the text in tests much more readable
2017-06-02 19:46:29 +02:00
Pawel Chojnacki ae8f7666e5 Add prometheus text formatter
+ rename controler method to #index from #metrics
 + remove assertion from nullMetric
2017-06-02 19:45:58 +02:00
Pawel Chojnacki c134a72cdb Move Prometheus presentation logic to PrometheusText
+ Use NullMetrics to mock metrics when unused
+ Use method_missing in NullMetrics mocking
+ Update prometheus gem to version that correctly uses transitive dependencies
+ Ensure correct folders are used in Multiprocess prometheus client tests.
+ rename Sessions controller's metric
2017-06-02 19:45:58 +02:00
Pawel Chojnacki 394e962e52 Make tests of Gitlab::Metrics use explicit descriptions. 2017-06-02 19:45:58 +02:00
Pawel Chojnacki 21561f3434 Correctly handle temporary folder for testing multiproces metrics 2017-06-02 19:45:58 +02:00
Pawel Chojnacki ef9d9ddeb2 Add tests for metrics behavior 2017-06-02 19:45:58 +02:00
Ahmad Sherif 4d1e987ec3 Use the new Gitaly CommitDiff RPC 2017-06-02 18:33:18 +02:00
Grzegorz Bizon 626cb8edc3 Fix invalid conditional in pipeline create service 2017-06-02 15:05:14 +02:00
Grzegorz Bizon fe0b2f81c7 Refine implementation of pipeline stage seeds 2017-06-02 12:16:11 +02:00
Bob Van Landuyt e564fe971f Rename `Gitlab::Git::EncodingHelper` to `Gitlab::EncodingHelper` 2017-06-01 21:21:14 +00:00
Kamil Trzciński 8d131eb85d Merge branch 'zj-realtime-env-list' into 'master'
Realtime env list

Closes #31701

See merge request !11333
2017-06-01 20:38:46 +00:00
Kamil Trzciński 950db1bd64 Merge branch '24196-protected-variables' into 'master'
Implementation for protected variables

Closes #24196

See merge request !11688
2017-06-01 17:18:03 +00:00
Z.J. van de Weg 6c87239653 Merge remote-tracking branch 'origin/master' into zj-job-view-goes-real-time 2017-06-01 15:54:58 +02:00
Grzegorz Bizon aa0d6b07b6 Merge branch 'feature/gb/migrate-pipeline-stages' into feature/gb/persist-pipeline-stages
* feature/gb/migrate-pipeline-stages:
  Use stage_id column in code that needs to know about it
2017-06-01 12:58:11 +02:00
Grzegorz Bizon 1a438e9f71 Use stage_id column in code that needs to know about it 2017-06-01 12:21:34 +02:00
Sean McGivern 04251829ba Merge branch 'dm-collapsed-blob' into 'master'
Consistent diff and blob size limit names

See merge request !11776
2017-06-01 09:10:53 +00:00
Z.J. van de Weg 00b00f1ede Merge branch 'master' into zj-realtime-env-list 2017-06-01 10:31:33 +02:00
Kamil Trzciński 3cc138d824 Merge branch 'master' into '24196-protected-variables'
# Conflicts:
#   db/schema.rb
2017-06-01 07:25:48 +00:00
Grzegorz Bizon eb728d37a7 Merge branch 'master' into 'trigger-source'
# Conflicts:
#   db/schema.rb
2017-05-31 21:15:40 +00:00
Alejandro Rodríguez 671284ba37 Add feature toggles through Flipper 2017-05-31 21:06:01 +00:00
Grzegorz Bizon 322c9be816 Merge branch 'dm-gitmodules-parsing' into 'master'
Make .gitmodules parsing more resilient to syntax errors

Closes #26009

See merge request !11803
2017-05-31 20:36:35 +00:00
Z.J. van de Weg 47a0276e53 Initial implementation for real time job view
Added the needed keys and paths to a new entity, BuildDetailsEntity.
Not renaming BuildEntity to BuildBasicEntity on explicit request. Most
code now has test coverage, but not all. This will be added on later
commits on this branch.

Resolves gitlab-org/gitlab-ce#31397
2017-05-31 21:44:15 +02:00
Douwe Maan 04cf618b6f Change no_limits to limits 2017-05-31 14:41:25 -05:00
Lin Jen-Shin 554426ddca Merge remote-tracking branch 'upstream/master' into 24196-protected-variables
* upstream/master: (141 commits)
  Add Documentation for GIT_CHECKOUT variable
  Ui improvements for count badges and permission badges
  Rename the other jobs
  Update jobs_spec for changes from builds_spec
  Update docs related to protected actions
  Add changelog for protected branches abilities fix
  Ask for an example project for bug reports
  Center loading spinner in issuable filters
  Fix chat commands specs related to protected actions
  Fix builds controller specs related to protected actions
  Fix pipeline retry specs related to protected actions
  Fix environment model specs related to protected actions
  Fix build factory specs related to protected actions
  Fix job play service specs related to protected actions
  Fix play status specs related to protected actions
  Fix deploy chat command specs for protected actions
  Fix environment specs related to protected actions
  Use another scope to add the - prefix, feedback:
  Fix pipeline processing specs related to protected actions
  Fix build entity specs related to protected actions
  ...
2017-06-01 03:39:47 +08:00
Lin Jen-Shin afb1bf0baf Merge remote-tracking branch 'upstream/master' into rename-builds-controller
* upstream/master: (63 commits)
  Update docs related to protected actions
  Add changelog for protected branches abilities fix
  Ask for an example project for bug reports
  Center loading spinner in issuable filters
  Fix chat commands specs related to protected actions
  Fix builds controller specs related to protected actions
  Fix pipeline retry specs related to protected actions
  Fix environment model specs related to protected actions
  Fix build factory specs related to protected actions
  Fix job play service specs related to protected actions
  Fix play status specs related to protected actions
  Fix deploy chat command specs for protected actions
  Fix environment specs related to protected actions
  Fix pipeline processing specs related to protected actions
  Fix build entity specs related to protected actions
  Check only a merge ability for protected actions
  Add tag_list param to project api
  Allow PostReceivePack to be enabled with Gitaly
  Remove some deprecated methods
  Add :owned param to ProjectFinder
  ...
2017-05-31 22:58:34 +08:00
Kamil Trzciński aefd8b2333 Merge branch 'fix/gb/use-merge-ability-for-protected-manual-actions' into 'master'
Check only a merge ability for protected actions

Closes #32618

See merge request !11648
2017-05-31 13:37:49 +00:00
Grzegorz Bizon c72e21fd97 Return stage seeds object from YAML processor 2017-05-31 15:13:40 +02:00
Grzegorz Bizon c881425b66 Refine pipeline stages seeds class 2017-05-31 14:40:50 +02:00
Kamil Trzcinski 161af17c1b Introduce source to pipeline entity 2017-05-31 14:17:49 +02:00
James Edwards-Jones 0c1bf16d5f Backport EE refactorings for Protected Tag EE-only functionality
Improvements and refactorings were made while adding role based permissions for protected tags to EE. This doesn’t backport the feature, but should improve code quality and minimize divergence.
2017-05-31 13:06:29 +01:00
Lin Jen-Shin afc1fac039 Merge remote-tracking branch 'upstream/master' into 24196-protected-variables
* upstream/master: (89 commits)
  Revert "Merge branch 'grpc-1.3.4' into 'master'"
  Return nil when looking up config for unknown LDAP provider
  Avoid crash when trying to parse string with invalid UTF-8 sequence
  Enable Gitaly by default in GitLab 9.3
  Don’t create comment on JIRA if link already exists
  Disable sub_group_issuables_spec.rb for mysql
  Fix math rendering on blob pages
  Add changelog
  Don't allow to pass a user to ProjectWiki#http_url_to_repo
  Revert "Merge branch '1937-https-clone-url-username' into 'master'
"
  Fix bottom padding for build page
  Fix /unsubscribe slash command creating extra todos
  Fix omniauth-google-oauth2 dependencies in Gemfile.lock
  Update looks job log
  'New issue'/'New merge request' dropdowns should show only projects with issues/merge requests feature enabled
  Fix spec for Members::AuthorizedDestroyService
  31616-add-uptime-of-gitlab-instance-in-admin-area
  Set head pipeline when creating merge requests
  Create a separate helper to check if we show particular tab on a search page
  Add performance deltas between app deployments on Merge Request widget
  ...
2017-05-31 19:07:27 +08:00
Rémy Coutable ce65e0dba6 Merge branch 'enable-gitaly-receive-pack' into 'master'
Allow PostReceivePack to be enabled with Gitaly

Closes gitaly#246

See merge request !11809
2017-05-31 10:52:27 +00:00
Lin Jen-Shin 6c72d8a219 Merge remote-tracking branch 'upstream/master' into rename-builds-controller
* upstream/master: (116 commits)
  Revert "Merge branch 'grpc-1.3.4' into 'master'"
  Return nil when looking up config for unknown LDAP provider
  Avoid crash when trying to parse string with invalid UTF-8 sequence
  Enable Gitaly by default in GitLab 9.3
  Don’t create comment on JIRA if link already exists
  Disable sub_group_issuables_spec.rb for mysql
  Fix math rendering on blob pages
  Add changelog
  Don't allow to pass a user to ProjectWiki#http_url_to_repo
  Revert "Merge branch '1937-https-clone-url-username' into 'master'
"
  Fix bottom padding for build page
  Fix /unsubscribe slash command creating extra todos
  Fix omniauth-google-oauth2 dependencies in Gemfile.lock
  Update looks job log
  'New issue'/'New merge request' dropdowns should show only projects with issues/merge requests feature enabled
  Fix spec for Members::AuthorizedDestroyService
  31616-add-uptime-of-gitlab-instance-in-admin-area
  Set head pipeline when creating merge requests
  Create a separate helper to check if we show particular tab on a search page
  Add performance deltas between app deployments on Merge Request widget
  ...
2017-05-31 18:14:11 +08:00
Grzegorz Bizon 3769485822 Fix chat commands specs related to protected actions 2017-05-31 11:25:55 +02:00
Grzegorz Bizon e3cb71442e Fix build factory specs related to protected actions 2017-05-31 11:18:15 +02:00
Grzegorz Bizon 13f10a96e3 Fix play status specs related to protected actions 2017-05-31 11:11:46 +02:00
Grzegorz Bizon 1984359de3 Fix deploy chat command specs for protected actions 2017-05-31 11:09:29 +02:00
Jarka Kadlecova 4464c22d6d Support descriptions for snippets 2017-05-31 07:17:03 +02:00
Douwe Maan ce869e3964 Fix Diff#too_large? and specs 2017-05-30 21:48:30 -05:00
Alejandro Rodríguez 870a8bbbdd Allow PostReceivePack to be enabled with Gitaly 2017-05-30 22:16:43 -04:00
Douwe Maan 04bb8fe994 Return nil when looking up config for unknown LDAP provider 2017-05-30 16:41:07 -05:00
Douwe Maan 0c7dd30c78 Make .gitmodules parsing more resilient to syntax errors 2017-05-30 16:19:36 -05:00
Douwe Maan 8039b9c3c6 Merge branch '30410-revert-9347-and-10079' into 'master'
Resolve "Allow to disable username on checkout url"

Closes #30410 and #30174

See merge request !11792
2017-05-30 18:47:55 +00:00
Bob Van Landuyt 33aed43e9d Avoid crash when trying to parse string with invalid UTF-8 sequence 2017-05-30 15:05:52 +00:00
Grzegorz Bizon 805715cc68 Add stage seed class that represents attributes 2017-05-30 15:30:45 +02:00
Pawel Chojnacki 9ccda90127 Add Prometheus client tests 2017-05-30 15:27:51 +02:00
Rémy Coutable bf4cc9e1f3
Don't allow to pass a user to ProjectWiki#http_url_to_repo
This partially reverts be25bbc4d2.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-30 14:18:58 +02:00
Douwe Maan aed0387f97 Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
Douwe Maan 08a17d15e3 Merge branch '30917-wiki-is-not-searchable-with-guest-permissions' into 'master'
Resolve "Wiki is not searchable with Guest permissions"

Closes #30917

See merge request !11613
2017-05-29 17:50:07 +00:00
Douwe Maan 26bcef97d6 Merge branch 'rework-authorizations-performance' into 'master'
Rework project authorizations and nested groups for better performance

See merge request !10885
2017-05-29 15:49:56 +00:00
Valery Sizov 1a424a9bc9 Explicitly test that guest is able to search through the wiki 2017-05-29 16:20:25 +03:00
Lin Jen-Shin (godfat) b5e8de5c4c Merge branch 'master' into '24196-protected-variables'
# Conflicts:
#   db/schema.rb
2017-05-26 19:18:07 +00:00
Grzegorz Bizon f46d3d601b Merge branch 'dm-dependency-value-regex' into 'master'
Don't allow spaces in dependency linker value regex

See merge request !11721
2017-05-26 18:34:18 +00:00
Grzegorz Bizon 5aea2e6e99 Merge branch '31459-fix-transient-error-caused-by-small-timeout-also-adapt-tests-to-work-locally-correctly' into 'master'
Fix transient CI errors by increasing command execution timeouts from 1s to 30s

Closes #31459

See merge request !11420
2017-05-26 18:23:15 +00:00
Douwe Maan c197b72fea Add spec 2017-05-26 09:43:44 -05:00
Douwe Maan 324af4ac9a Merge branch 'diffcollection-no-restarts' into 'master'
Fix buffering in DiffCollection

See merge request !11659
2017-05-26 14:35:45 +00:00
Lin Jen-Shin 70eb0c6a88 Merge remote-tracking branch 'upstream/master' into rename-builds-controller
* upstream/master: (307 commits)
  Address feedback
  Add small update for the i18n guide.
  update webpack to v2.6.1 patch release to fix "Can't find variable: Promise" error
  update webpack-bundle-analyzer past v2.4.1 to support NamedChunksPlugin
  name all webpack chunks to improve long term cacheability
  add NameAllModulesPlugin to cover shortcomings of NamedModulesPlugin
  upgrade to latest webpack version
  Only use DROP INDEX CONCURRENTLY on postgreql 9.2+
  Provide default for calculating label text color (!11681)
  Add failing test for #32728
  Bugfix: Always use the default language when generating emails.
  Remove unecessary commit pattern check
  Add regexp_for_value helper method
  Remove shared example and improve sub_group_issuables_spec.rb
  Remove 'should' from scenario in has_subgroup_title_spec.rb
  Cartfile git and binary methods cannot take a GitHub repo
  Fix terminals support for Kubernetes service
  Add review comments to compare_spec.rb
  Fix transient error clicking dropdown items in compare_spec.rb
  Use non-global jQuery reference within raven bundle
  ...
2017-05-26 18:25:32 +08:00
Kamil Trzciński 7a509c26dd Merge branch '31556-ci-coverage-paralel-rspec' into 'master'
Return the last coverage in trace stream

Closes #31556

See merge request !11128
2017-05-26 09:16:50 +00:00
Robert Speicher 8e2fefc6c4 Merge branch 'dm-diff-cleanup' into 'master'
Clean up diff rendering

See merge request !11390
2017-05-25 22:15:57 +00:00
Pawel Chojnacki a0497a7bc0 Move helpers to spec file, use const's instead of helper methods 2017-05-25 21:59:57 +02:00
Douwe Maan e20eb71203 Merge branch '32851-fix-postgres-9-1' into 'master'
Resolve "GitLab 9.0 to 9.2 is incompatible with PostgreSQL 9.1"

See merge request !11709
2017-05-25 19:43:17 +00:00
Douwe Maan b3b6c78112 Merge branch '32748-emails-are-being-sent-with-the-wrong-language' into 'master'
Bugfix: Always use the default language when generating emails.

Closes #32748

See merge request !11662
2017-05-25 18:05:06 +00:00
Nick Thomas eb21f93267 Only use DROP INDEX CONCURRENTLY on postgreql 9.2+ 2017-05-25 18:12:42 +01:00
Grzegorz Bizon d9835145f9 Merge branch 'dm-more-dependency-linkers' into 'master'
Autolink package names in more dependency files

See merge request !11226
2017-05-25 16:23:21 +00:00
Ruben Davila 5c921809cd Bugfix: Always use the default language when generating emails.
There was a race condition issue when the application was generating an
email and was using a language that was previously being used in other
request.
2017-05-25 10:22:45 -05:00
Robert Speicher 516e3532c6 Merge branch 'revert-b0498c17' into 'master'
Refactor `DynamicPathValidator` and `GitLab::Regex` some more

See merge request !11693
2017-05-25 15:14:16 +00:00
Dmitriy Zaporozhets 1ed7b7629a Merge branch '17848-web-hook-logging' into 'master'
Implement Web Hooks calls logging

Closes #17848

See merge request !11027
2017-05-25 13:26:12 +00:00
Lin Jen-Shin 7f01167681 Fix tests and rubocop offense 2017-05-25 20:53:03 +08:00
Z.J. van de Weg 7ec8969285 Merge branch 'master' into zj-realtime-env-list 2017-05-25 13:57:22 +02:00
Lin Jen-Shin efebdba21d Frontend implementation, tests, and changelog 2017-05-25 19:31:21 +08:00
Alexander Randa 330789c23c Implement web hooks logging
* implemented logging of project and system web hooks
* implemented UI for user area (project hooks)
* implemented UI for admin area (system hooks)
* implemented retry of logged webhook
* NOT imeplemented log remover
2017-05-25 10:07:52 +03:00
Douwe Maan 43b1750892 Revert "Remove changes that are not absolutely necessary"
This reverts commit b0498c176f
2017-05-24 20:59:26 +00:00
Grzegorz Bizon af50d334e7 Merge branch 'dm-outdated-system-note' into 'master'
Add system note with link to diff comparison when MR discussion becomes outdated

Closes #30058

See merge request !11584
2017-05-24 19:00:26 +00:00
Robert Speicher 2a6227a9fc Merge branch 'dm-fix-routes' into 'master'
Fix ambiguous routing issues by teaching router about reserved words

See merge request !11570
2017-05-24 15:08:05 +00:00
Robert Speicher 03bd3081ca Merge branch '29852-latex-formatting' into 'master'
Fix LaTeX formatting for AsciiDoc wiki

Closes #29852

See merge request !11212
2017-05-24 15:03:09 +00:00
Jarka Kadlecova 3ca9328443 Fix LaTeX formatting for AsciiDoc wiki 2017-05-24 15:47:35 +02:00
Shinya Maeda a6f6056c62 Use force_encoding when regex contains UTF-8 char 2017-05-24 20:10:14 +09:00
Shinya Maeda b9950c22b3 Use each_line. Avoid comparison of partial. Add UTF-8 spec. 2017-05-24 20:10:14 +09:00
Shinya Maeda 3d11b7d8e2 Fix reverse_line from chunk based 2017-05-24 20:10:14 +09:00
Shinya Maeda a1cddf051e Reproduced 2017-05-24 20:10:14 +09:00
Z.J. van de Weg 3be9820da6 Test etag caching router and incorporate review 2017-05-24 10:02:32 +02:00
Douwe Maan b0498c176f Remove changes that are not absolutely necessary 2017-05-23 20:38:35 -05:00
Douwe Maan ed16c351c5 Fix specs 2017-05-23 20:38:26 -05:00
Douwe Maan 4345bb8c50 Fix ambiguous routing issues by teaching router about reserved words 2017-05-23 20:38:24 -05:00
Douwe Maan 6e698b254e Fix specs 2017-05-23 16:27:30 -05:00
Douwe Maan ab91f76e8b Add system note with link to diff comparison when MR discussion becomes outdated 2017-05-23 16:27:30 -05:00
Douwe Maan d9a0188d2f Add question mark to Gitlab::Diff::File predicate methods 2017-05-23 15:37:04 -05:00
Douwe Maan c734f2f0dd Autolink package names in requirements.txt 2017-05-23 15:35:59 -05:00
Douwe Maan 640440c9d8 Autolink package names in Godeps.json 2017-05-23 15:35:51 -05:00
Douwe Maan e780259a65 Autolink package names in Cartfile 2017-05-23 15:35:51 -05:00
Douwe Maan c35463d5f8 Autolink package names in podspec.json 2017-05-23 15:35:50 -05:00
Douwe Maan 190b7b45a6 Autolink package names in podspec 2017-05-23 15:35:50 -05:00
Douwe Maan 03db4f1106 Autolink package names in Podfile 2017-05-23 15:35:42 -05:00
Douwe Maan fbec6dbd1a Autolink package names in composer.json 2017-05-23 15:35:33 -05:00
Douwe Maan 83747783e2 Autolink package names in package.json 2017-05-23 15:35:17 -05:00
Douwe Maan 02ad8c0c68 Autolink package names in gemspec 2017-05-23 15:35:07 -05:00
Douwe Maan aa24feed6f Refactor DependencyLinker::BaseLinker 2017-05-23 15:34:42 -05:00
Robert Speicher 6f4e977046 Merge branch 'issue_32225' into 'master'
Add transient head_pipeline_of to pipeline factories

See merge request !11566
2017-05-23 18:53:29 +00:00
Kamil Trzciński 536f74ff1e Merge branch 'zj-fix-pipeline-etag' into 'master'
Fix pipeline etag

Closes #32658

See merge request !11615
2017-05-23 17:48:51 +00:00
Jacob Vosmaer fcdc427972 Add test that shows DiffCollection restart bug 2017-05-23 18:45:58 +02:00
Timothy Andrew b00c268b4c Merge branch 'fix-backup-raketask' into 'master'
Add missing regex to backup manager

Closes #32669

See merge request !11635
2017-05-23 14:11:00 +00:00
Pawel Chojnacki 8067efdf3d Make the test cases more readable and fix to_s coercion problem 2017-05-23 14:46:37 +02:00
Achilleas Pipinellis 4ee79839cf Fix tests 2017-05-23 13:34:22 +02:00
Achilleas Pipinellis 6fe2744d23 Add tests for removing old backups with the new timestamp 2017-05-23 11:15:05 +02:00
Z.J. van de Weg 33961ee418 Add Etag caching for Pipeline#Show action
Due to a typo this was not actually the case. Now that is fixed and
performance should improve because of this.
2017-05-22 22:07:11 +02:00
Felipe Artur 921c2be44a Add transient head_pipeline_of to pipeline factories 2017-05-22 17:06:45 -03:00
Z.J. van de Weg ebede2b3ff Use etag caching for environments JSON
For the index view, the environments can now be requested every 15
seconds. Any transition state of a projects environments will trigger a
cache invalidation action.

Fixes gitlab-org/gitlab-ce#31701
2017-05-22 21:55:43 +02:00
Pawel Chojnacki 1f10a3c224 Stop skipping tests if local dependencies are not found 2017-05-22 19:44:54 +02:00
Lin Jen-Shin b3095251c4 Make sure that Arel.sql would work for update_column_in_batches 2017-05-23 00:25:26 +08:00
Bob Van Landuyt f62f0c258d Fixes for the rename reserved paths helpers 2017-05-18 20:08:32 +00:00
Ruben Davila 3396edcea0 Remove Services count from usage ping payload.
This query was timing out and is blocking the sync of usage data for
GitLab.com
2017-05-18 11:49:11 -05:00
Douwe Maan 6319ca271c Merge branch 'gitaly-local-branches' into 'master'
Incorporate Gitaly's local_branches operation into repo code

Closes #27379

See merge request !10059
2017-05-18 14:22:41 +00:00
Alejandro Rodríguez 925945f01b Incorporate Gitaly's local_branches operation into repo code 2017-05-17 18:12:10 -04:00
Yorick Peterse ac382b5682
Use CTEs for nested groups and authorizations
This commit introduces the usage of Common Table Expressions (CTEs) to
efficiently retrieve nested group hierarchies, without having to rely on
the "routes" table (which is an _incredibly_ inefficient way of getting
the data). This requires a patch to ActiveRecord (found in the added
initializer) to work properly as ActiveRecord doesn't support WITH
statements properly out of the box.

Unfortunately MySQL provides no efficient way of getting nested groups.
For example, the old routes setup could easily take 5-10 seconds
depending on the amount of "routes" in a database. Providing vastly
different logic for both MySQL and PostgreSQL will negatively impact the
development process. Because of this the various nested groups related
methods return empty relations when used in combination with MySQL.

For project authorizations the logic is split up into two classes:

* Gitlab::ProjectAuthorizations::WithNestedGroups
* Gitlab::ProjectAuthorizations::WithoutNestedGroups

Both classes get the fresh project authorizations (= as they should be
in the "project_authorizations" table), including nested groups if
PostgreSQL is used. The logic of these two classes is quite different
apart from their public interface. This complicates development a bit,
but unfortunately there is no way around this.

This commit also introduces Gitlab::GroupHierarchy. This class can be
used to get the ancestors and descendants of a base relation, or both by
using a UNION. This in turn is used by methods such as:

* Namespace#ancestors
* Namespace#descendants
* User#all_expanded_groups

Again this class relies on CTEs and thus only works on PostgreSQL. The
Namespace methods will return an empty relation when MySQL is used,
while User#all_expanded_groups will return only the groups a user is a
direct member of.

Performance wise the impact is quite large. For example, on GitLab.com
Namespace#descendants used to take around 580 ms to retrieve data for a
particular user. Using CTEs we are able to reduce this down to roughly 1
millisecond, returning the exact same data.

== On The Fly Refreshing

Refreshing of authorizations on the fly (= when
users.authorized_projects_populated was not set) is removed with this
commit. This simplifies the code, and ensures any queries used for
authorizations are not mutated because they are executed in a Rails
scope (e.g. Project.visible_to_user).

This commit includes a migration to schedule refreshing authorizations
for all users, ensuring all of them have their authorizations in place.
Said migration schedules users in batches of 5000, with 5 minutes
between every batch to smear the load around a bit.

== Spec Changes

This commit also introduces some changes to various specs. For example,
some specs for ProjectTeam assumed that creating a personal project
would _not_ lead to the owner having access, which is incorrect. Because
we also no longer refresh authorizations on the fly for new users some
code had to be added to the "empty_project" factory. This chunk of code
ensures that the owner's permissions are refreshed after creating the
project, something that is normally done in Projects::CreateService.
2017-05-17 16:51:08 +02:00
Pawel Chojnacki 6ced4d138e Fix transient CI errors by increasing command execution timeouts from 1s to 30s
+ actually make local tests correctly detect wether 'timeout' or 'gtimeout' is available
2017-05-17 16:22:47 +02:00
Lin Jen-Shin 71777a4a18 Rename BuildsController to JobsController
Rename other URL generators

admin_builds_path -> admin_jobs_path

Fix tests and more renaming

Fix more tests

Also change build_id to job_id in the controller
2017-05-17 20:17:30 +08:00
Alejandro Rodríguez cf09c826a5 Re-enable gitaly migration for ref_name_for_sha after bugfixes 2017-05-16 11:43:37 -04:00
Douwe Maan 1fd83f972c Merge branch 'bvl-rename-build-events-to-job-events' into 'master'
Rename `build_events` to `job_events`

Closes #31620

See merge request !11287
2017-05-16 14:12:19 +02:00
Robert Speicher 21c96a657c Merge branch '32231-fix-transient-failure-of-deployment-query-spec' into 'master'
Fix transient failure of deployment query spec

Closes #32231

See merge request !11371
2017-05-16 08:59:52 +00:00
Yorick Peterse c53d06c4d8 Merge branch 'dm-rename-column-concurrently-with-null' into 'master'
Disallow NULL on renamed column after default has been set

See merge request !11396
2017-05-15 22:06:52 +00:00
Douwe Maan beec97f6cf Disallow NULL on renamed column after default has been set 2017-05-15 16:01:09 -05:00
Douwe Maan 950fa32a7c Revert "Merge branch 'bvl-rename-build-events-to-job-events' into 'master'"
This reverts merge request !11287
2017-05-15 20:24:19 +00:00
Pawel Chojnacki 0ddd1d52fd Due to DB rounding timestamp to 1s resolution - freeze date on non fractional time 2017-05-15 21:11:14 +02:00
Rémy Coutable 84199f1919 Merge branch 'rename-rendered_title' into 'master'
Rename all references to rendered_title to realtime_changes

See merge request !11359
2017-05-15 16:27:23 +00:00
Douwe Maan 0663458ce9 Merge branch 'bvl-rename-build-events-to-job-events' into 'master'
Rename `build_events` to `job_events`

Closes #31620

See merge request !11287
2017-05-15 15:11:45 +00:00
Bob Van Landuyt cac7e03fa1 Rename `build_events` to `job_events` in code 2017-05-15 14:27:01 +02:00
Jacob Vosmaer 43f037c903 Don't reuse gRPC channels
It seems that bad things happen when two gRPC stubs share one gRPC
channel so let's stop doing that. The downside of this is that we
create more gRPC connections; one per stub.
2017-05-15 10:52:33 +02:00
Kamil Trzciński e261b4b851 Merge branch 'allow_numeric_values_in_gitlab_ci_yml' into 'master'
Allow numeric values in gitlab-ci.yml

Closes #30017

See merge request !10607
2017-05-15 07:59:45 +00:00
Rémy Coutable ae8511df13 Merge branch 'rename-column-concurrently-defaults' into 'master'
Fix adding defaults for concurrent column renames

See merge request !11335
2017-05-15 07:50:44 +00:00
Rémy Coutable c48554edc2 Merge branch 'dturner/username' into 'master'
add username field to push webhook

Closes #32136

See merge request !11272
2017-05-15 07:28:58 +00:00
Robert Speicher 133d2bb40a Merge branch 'fix/support-commit-deltas-only-for-gitaly' into 'master'
Fetch commit deltas from Gitaly

Closes gitaly#199

See merge request !11122
2017-05-14 20:03:15 +00:00
Luke "Jared" Bennett 3efb60642a
Rename all references to rendered_title to realtime_changes 2017-05-13 21:23:58 +01:00
Ahmad Sherif 99feed6e00 Add support for deltas_only under Gitaly
Closes gitaly#199
2017-05-13 18:27:06 +02:00
Gabriel Mazetto f661980904 Added repository_update hook 2017-05-12 23:26:48 +01:00
Douwe Maan e4261fe3ce Merge branch 'fix-conflict-resolution-with-corrupt-repos' into 'master'
Fix conflict resolution from corrupted upstream

Closes gitlab-ee#2128

See merge request !11298
2017-05-12 20:37:30 +00:00
Sean McGivern ad2bfeb857 Fix conflict resolution from corrupted upstream
I don't know why this happens exactly, but given an upstream and fork repository
from a customer, both of which required GC, resolving conflicts would corrupt
the fork so badly that it couldn't be cloned.

This isn't a perfect fix for that case, because the MR may still need to be
merged manually, but it does ensure that the repository is at least usable.

My best guess is that when we generate the index for the conflict
resolution (which we previously did in the target project), we obtain a
reference to an OID that doesn't exist in the source, even though we already
fetch the refs from the target into the source.

Explicitly setting the source project as the place to get the merge index from
seems to prevent repository corruption in this way.
2017-05-12 20:47:51 +01:00
Robert Speicher b012c0b316 Merge branch 'disable-usage-ping' into 'master'
Usage ping updates

Closes #31741 and #31453

See merge request !11231
2017-05-12 19:16:40 +00:00
Sean McGivern ec1a3c093f Merge branch 'dm-dependency-linker-gemfile' into 'master'
Autolink package names in Gemfile

See merge request !11224
2017-05-12 17:27:42 +00:00
Douwe Maan bec9ec9a6e Merge branch '27439-performance-deltas' into 'master'
Expose memory deltas between app deployments and refactor prometheus queries to support more custom queries

See merge request !10981
2017-05-12 17:15:31 +00:00
Douwe Maan 4024200314 Merge branch 'bvl-fix-dynamic-path-query' into 'master'
Only rename namespaces and projects with an invalid path

See merge request !11338
2017-05-12 17:00:38 +00:00
Douwe Maan ee0b2f3418 Remove unrelated link from spec 2017-05-12 11:20:33 -05:00
Bob Van Landuyt 3760a7c230 Only rename namespaces and projects with an invalid path
For exact matches, not namespaces that end with an invalid path
2017-05-12 17:46:16 +02:00
Douwe Maan e9d7b6cd8f Link Gemfile git URLs 2017-05-12 10:35:41 -05:00
Yorick Peterse 3fc20c0117
Fix adding defaults for concurrent column renames
By adding the default value _after_ adding the column we avoid updating
all rows in a table, saving a lot of time and unnecessary work in the
process.
2017-05-12 16:27:30 +02:00
Sean McGivern e012427cf3 Merge branch 'backport_file_filder_from_ee' into 'master'
Backport FileFinder from EE

Closes #32188

See merge request !11319
2017-05-12 11:32:43 +00:00
Valery Sizov f6c4ccd1f2 Backport FileFinder from EE 2017-05-12 13:21:30 +03:00
Pawel Chojnacki 436e90780b match query times with appropriate delta 2017-05-11 23:24:26 +02:00
Pawel Chojnacki 693602d957 Keep presentation logic in one place and remove unecessary arguments.
+ fix tests
2017-05-11 23:07:12 +02:00
Pawel Chojnacki 4f824d2aec Custom queries for prometheus
- Tests for prometheus queries

- fix rubocop warnings

- Remove unused method. Add more queries to deployment queries.

- Wrap BaseQuery in module hierarchy

Renname Prometheus class to PrometheusClient
2017-05-11 23:07:12 +02:00
Sean McGivern d2d6435372 Add hostname to usage ping 2017-05-11 09:20:12 +01:00
Regis Boudinot 81df0034f4 Merge branch 'retried-in-database-mysql' into 'master'
Retried in database

Closes #25737

See merge request !11115
2017-05-10 22:07:05 +00:00
Robert Speicher cb2f739d48 Merge branch '27144-enforce-rubocop-trailing_commas-no_comma-style' into 'master'
Resolve "Use consistent style for trailing commas"

Closes #27144

See merge request !11063
2017-05-10 21:43:34 +00:00
David Turner 47b8516c15 Add username field to push webhook
Signed-off-by: David Turner <novalis@novalis.org>
2017-05-10 17:11:36 -04:00
Rémy Coutable 3db37e0562 Enable the Style/TrailingCommaInArguments cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Douwe Maan 61a81a3ac2 Merge branch '31157-respect-project-features-in-wiki-search' into 'security'
Respect project features in wiki and blob search

See merge request !2089
2017-05-10 16:44:20 +02:00
Robert Speicher da13d1af3e Merge branch 'bvl-security-9-1-validate-urls-in-markdown-using-uri'
(security-9-1) Add correct `rel` attributes to external links when rendering markdown

See merge request !2097
2017-05-10 16:44:20 +02:00
Robert Speicher 99996b6bc7 Merge branch 'bvl-security-9-1-markup-pipeline'
(security-9-1) Render asciidoc & other markup using banzai in a pipeline

See merge request !2098
2017-05-10 16:44:20 +02:00
Douwe Maan 02650d97e5 Fix specs 2017-05-10 08:26:21 -05:00
Douwe Maan b1012d986c Autolink package names in Gemfile 2017-05-10 08:26:21 -05:00
Douwe Maan 3f6d91c53c Add Gitlab::StringRegexMarker 2017-05-10 08:26:21 -05:00
Douwe Maan e179707844 Extract generic parts of Gitlab::Diff::InlineDiffMarker 2017-05-10 08:26:21 -05:00
Sean McGivern a3607aa439 Merge branch 'issue_27168_2' into 'master'
Preloads head pipeline for each merge request

Closes #27168

See merge request !10064
2017-05-09 15:16:31 +00:00
Fatih Acet 0151325dac Merge request widget redesign 2017-05-09 04:15:34 +00:00
Felipe Artur 2ccee7161a Small code improvements and add migration spec 2017-05-08 18:43:53 -03:00
Felipe Artur d9bebd89df Fix specs 2 2017-05-08 11:29:10 -03:00
Felipe Artur 24824cbb4c Fix Specs 2017-05-08 11:26:04 -03:00
Felipe Artur 4ae411ff40 Preloads head pipeline for each merge request 2017-05-08 11:24:55 -03:00
Dmitriy Zaporozhets 11ff9fc6a9 Merge branch '28359-skip-process-commit-worker-unless-issues-referenced' into 'master'
Use regex to skip unnecessary reference processing in ProcessCommitWorker

Closes #28359

See merge request !10867
2017-05-08 12:54:23 +00:00
Sam Rose 1ebd9dad8e Add confirm delete protected branch modal 2017-05-08 07:41:58 +00:00
Robert Speicher 8b9cd3c072 Merge branch 'fix/support-gitaly-commit-diff-flags' into 'master'
Add support for commit diff ignore_whitespace_change and paths flags

Closes gitaly#198

See merge request !11028
2017-05-07 22:59:30 +00:00
Zeger-Jan van de Weg 8df3997a92 Add Pipeline Schedules that supersedes experimental Trigger Schedule 2017-05-07 22:35:56 +00:00
Ahmad Sherif 2f60a402d1 Remove stubbing from Gitlab::GitalyClient::Commit specs
Closes gitaly#198
2017-05-07 23:37:42 +02:00
Kamil Trzcinski f2a4420d66
Store retried in database for CI builds 2017-05-07 22:43:53 +02:00
blackst0ne 295cecfb56 Allow numeric values in gitlab-ci.yml 2017-05-07 08:29:43 +11:00
Kamil Trzciński 6ad3814e1b Merge branch 'feature/gb/manual-actions-protected-branches-permissions' into 'master'
Check access to a branch when user triggers manual action

Closes #20261

See merge request !10494
2017-05-06 17:17:02 +00:00
Zeger-Jan van de Weg c17e6a6c68 Real time pipeline show action 2017-05-06 16:45:46 +00:00
Sean McGivern 56fb7823f9 Merge branch '17361-redirect-renamed-paths' into 'master'
Resolve "Redirect to new project link after a rename"

Closes #17361 and #30317

See merge request !11136
2017-05-06 05:45:56 +00:00
Sean McGivern 9e041f2185 Merge branch '29925-gitlab-shell-hooks-can-no-longer-send-absolute-paths-to-gitlab-ce' into 'master'
Generate and handle a gl_repository param to pass around components

Closes #29925

See merge request !10992
2017-05-05 22:08:29 +00:00
Sean McGivern 86e75ae092 Merge branch 'blackst0ne/gitlab-ce-add_system_note_for_editing_issuable' 2017-05-05 22:00:36 +01:00
Michael Kozono 7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
Valery Sizov 5004579b15 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into mia_backort[ci skip] 2017-05-05 16:59:31 +03:00
Alejandro Rodríguez 8bc381db90 Pass GL_REPOSITORY in Workhorse responses 2017-05-05 10:52:06 -03:00
Robert Speicher 10c1bf2d77 Merge branch 'prometheus-integration-test-setting-fix' into 'master'
Added rescue block for the test method for the prometheus service

Closes #31451

See merge request !10994
2017-05-05 13:50:03 +00:00
Sean McGivern faf2ce89cd Merge branch 'mrchrisw-import-shell-timeout' 2017-05-05 14:40:52 +01:00
Grzegorz Bizon e5f24c5490 Add specs for extended status for manual actions 2017-05-05 15:31:00 +02:00
Grzegorz Bizon 55cec2177c Refine inheritance model of extended CI/CD statuses 2017-05-05 15:21:06 +02:00
Grzegorz Bizon 2cc8f43e54 Introduce generic manual action extended status class 2017-05-05 15:13:58 +02:00
Grzegorz Bizon b6facd8313 Merge commit '3a2b60f7' from 'master'
* commit '3a2b60f7a0109cdb84e8727a2625318a746e84dc': (151 commits)
  Fixed Karma spec
  Reject EE reserved namespace paths in CE as well
  Updated webpack config
  Include the bundler:audit job into the static-analysis job
  Document serializers
  Add artifact file page that uses the blob viewer
  Pipeline table mini graph dropdown remains open when table is refreshed
  Adds off for event hub
  Compile gitlab-shell go executables
  Allow to create new branch and empty WIP merge request from issue page
  Moved to a view spec
  Improving copy of CONTRIBUTING.md, PROCESS.md, and code_review.md
  Convert seconds to minutes and hours on chat notifations
  Disable navigation to Pages config if Pages is disabled
  Sort the network graph both by commit date and topographically.
  Add tooltips to note action buttons
  Add breadcrumb, build header and pipelines submenu to artifacts browser
  Update todos screenshots
  removes the possibility of commit messages having carriage returns
  Handle incoming emails from aliases correctly
  ...
2017-05-05 12:22:46 +02:00
Pawel Chojnacki cba965eba4 Set minimum latency to be non-negative number.
Sometimes the tests run so fast latency is calculated as 0.
This causes transient failures in our CI.
2017-05-05 11:34:01 +02:00
Rémy Coutable 8b336ae124 Merge branch 'adam-separate-slash-commands' into 'master'
Display slash commands outcome when previewing Markdown

Closes #21531

See merge request !10054
2017-05-05 09:07:56 +00:00