Commit Graph

1490 Commits

Author SHA1 Message Date
Stan Hu 4f9068dfc0 Eliminate N+1 queries in LFS file locks checks during a push
This significantly improves performance when a user pushes many references.

project.path_locks.any? doesn't cache the output and runs `SELECT 1 AS one
FROM "path_locks" WHERE project_id = N` each time. When there are thousands
of refs being pushed, this can time out the unicorn worker.

CE port for https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6159.
2018-06-18 16:42:20 -07:00
Sean McGivern 17335a42ae Merge branch 'rails5-database' into 'master'
Fix table_exists? to be Rails5 compatible

Closes #45107

See merge request gitlab-org/gitlab-ce!19418
2018-06-14 13:12:37 +00:00
Jarka Kadlecová fa36101a7f Use data_source_exists? instead of table_exists?
Use data_source_exists? where possible instead of table_exists? in order to be Rails5 compatible
2018-06-14 08:39:43 +02:00
Douwe Maan e0de57a836 Merge branch 'bvl-fix-maintainer-push-rejected' into 'master'
Fixes rejected pushes from maintainers

Closes #46337

See merge request gitlab-org/gitlab-ce!18968
2018-06-12 08:08:42 +00:00
Mayra Cabrera 421957cf8c Merge branch 'sh-expire-content-cache-after-import' into 'master'
Expire Wiki content cache after importing a repository

Closes #47546

See merge request gitlab-org/gitlab-ce!19617
2018-06-11 17:35:39 +00:00
Bob Van Landuyt 698515313f Fixes rejected pushes from maintainers
Before the push git would make a call to
`/:namespace/:project/git-receive-pack`. This would perform an access
check without a ref. So the `Project#branch_allows_maintainer_push?`
would return false.

This adjusts `Project#branch_allows_maintainer_push?` to return true
when passing no branch name if there are merge requests open that
would allow the user to push.

The actual check then happens when a call to
`/api/v4/internal/allowed` is made from a git hook.
2018-06-11 17:35:13 +02:00
Stan Hu 6defeb0a7d Expire Wiki content cache after importing a repository
The cache state for Wikis that were imported via GitHub or Bitbucket does
not appear to have been flushed after a successful import.

Closes #47546
2018-06-11 08:33:06 -07:00
Francisco Javier López 1418afc2d6 Avoid checking the user format in every url validation 2018-06-11 13:29:37 +00:00
Douwe Maan a9155ab05e Merge branch '47208-human-import-status-name-not-working' into 'master'
Resolve "ActionView::Template::Error: undefined method `human_import_status_name"

Closes #47208

See merge request gitlab-org/gitlab-ce!19470
2018-06-07 09:24:51 +00:00
Tiago Botelho 3ed66d4abd Adds #human_import_status_name to make it comply with ProjectImportState#human_status_name 2018-06-06 09:21:47 +01:00
Kamil Trzciński ced0b4453e Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
# Conflicts:
#   db/schema.rb
2018-06-05 16:46:43 +00:00
Robert Speicher 6ced2f1243 Merge branch '42751-rename-mr-maintainer-push' into 'master'
Rephrase Merge Request Maintainer Edit

See merge request gitlab-org/gitlab-ce!19061
2018-06-05 15:04:18 +00:00
Grzegorz Bizon da246582db Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
# Conflicts:
#   db/schema.rb
2018-06-05 13:51:31 +00:00
Grzegorz Bizon 809a50fcbf Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
Conflicts:
   app/models/ci/pipeline.rb
2018-06-05 07:39:59 +00:00
Kamil Trzciński f12ee2a2f4 Remove unused running_or_pending_build_count 2018-06-04 21:34:11 +02:00
Kamil Trzciński afb2d667ca Merge branch '46010-add-more-validations-for-runners-and-runner-type' into 'master'
Improve validations for Ci::Runner#runner_type

See merge request gitlab-org/gitlab-ce!18901
2018-06-01 12:43:43 +00:00
Francisco Javier López 840f80d48b Add validation to webhook and service URLs to ensure they are not blocked because of SSRF 2018-06-01 11:43:53 +00:00
Mark Chao 0d44f4d50e Rephrase "maintainer" to more precise "members who can merge to the target branch"
"Maintainer" will be freed to be used for #42751
2018-06-01 14:33:12 +09:00
Kamil Trzciński cfee3e0c4e Add `Ci::Runner` inverse_of's 2018-05-31 10:56:41 +02:00
Grzegorz Bizon a2f6aa96a9 Merge branch 'master' into backstage/gb/use-persisted-stages-to-improve-pipelines-table
* master: (583 commits)
2018-05-29 17:24:50 +02:00
Stan Hu 760fdd1dd3 Fix project destruction failing due to idle in transaction timeouts
When deleting associated records, Rails loads all associations into memory
(https://github.com/rails/rails/issues/22510) before destroying them. This
can cause a surge in memory and cause destruction of objects to fail
due to idle in transaction database timeouts. This fix is inspired from
https://github.com/thisismydesign to destroy `has_many` relationships
in batches.

Closes #44610
2018-05-24 16:40:02 -07:00
Rémy Coutable 0279a72752 Merge branch 'issue_38418' into 'master'
Fix sidebar issue count

Closes #38418

See merge request gitlab-org/gitlab-ce!19022
2018-05-24 16:23:13 +00:00
Felipe Artur aee2b23549 Fix sidebar issue count 2018-05-24 11:51:18 -03:00
Grzegorz Bizon be3a0377da Fix memoization-related rubocop offense in project 2018-05-22 14:03:02 +02:00
Imre Farkas 10237d458d Expose readme url in Project API 2018-05-22 10:53:37 +00:00
Grzegorz Bizon 9520d2ff27 Memoize project active runners to avoid N+1 queries 2018-05-22 12:29:52 +02:00
Grzegorz Bizon 631bd9bf08 Use persisted stages to load pipelines index table 2018-05-21 15:13:32 +02:00
Robert Speicher 47555ef85e Merge branch '6020-extract-ee-specific-controller-lines' into 'master'
[CE]  Resolve "Extract EE specific files/lines for some controllers"

See merge request gitlab-org/gitlab-ce!18994
2018-05-17 15:49:07 +00:00
Rémy Coutable 8d024ba79a
Backport changes from EE to minimize the CE/EE diff in Projects::Settings::IntegrationsController
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-05-16 20:39:29 +02:00
Jan Provaznik 32e2246830 Changed order of include 2018-05-16 08:58:07 +02:00
Jan Provaznik 7da3b2cdd0 Delete remote uploads
ObjectStore uploader requires presence of associated `uploads` record
when deleting the upload file (through the carrierwave's after_commit
hook) because we keep info whether file is LOCAL or REMOTE in `upload`
object.

For this reason we can not destroy uploads as "dependent: :destroy" hook
because these would be deleted too soon. Instead we rely on
carrierwave's hook to destroy `uploads` in after_commit hook.

But in before_destroy hook we still have to delete not-mounted uploads
(which don't use carrierwave's destroy hook). This has to be done in
before_Destroy instead of after_commit because `FileUpload` requires
existence of model's object on destroy action.

This is not ideal state of things, in a next step we should investigate
how to unify model dependencies so we can use same workflow for all
uploads.

Related to #45425
2018-05-16 08:58:07 +02:00
Dylan Griffith 46eeaafc25 Display help text below auto devops domain with nip.io domain name (#45561) 2018-05-15 10:36:57 +02:00
Douwe Maan 1bd5896cd0
Don't create import_state until project is persisted 2018-05-08 09:47:37 +02:00
Robert Speicher f9fcd2b410 Merge branch 'dm-project-factory-import-state' into 'master'
Fix project factory `import_*` traits

Closes gitlab-ee#5904

See merge request gitlab-org/gitlab-ce!18780
2018-05-07 22:30:13 +00:00
Douwe Maan cfa798da53
Force creation of new import_state when setting an import state field 2018-05-07 20:36:11 +02:00
Douwe Maan d0cbef7e8f Merge branch '42099-port-push-mirroring-to-ce-ce-port-v-2' into 'master'
CE backport of Backports Push Mirrors to CE

Closes #42099

See merge request gitlab-org/gitlab-ce!18715
2018-05-07 15:15:57 +00:00
Tiago Botelho 961255b107 Adds remote mirror table migration 2018-05-07 12:00:13 +02:00
Tiago Botelho 9a13059332 Backports every CE related change from ee-5484 to CE 2018-05-07 11:59:51 +02:00
Shinya Maeda 1fd10d4f24 Merge branch 'live-trace-v2' into live-trace-v2-efficient-destroy-all 2018-05-07 12:04:30 +09:00
Douwe Maan e8b116ab94 Merge branch '44542-move-import-specific-attributes-out-of-the-project-model-ce-port' into 'master'
Resolve "Move `import_status` out of `projects`"

See merge request gitlab-org/gitlab-ce!18688
2018-05-04 16:27:09 +00:00
Tiago Botelho bddbcaefc2 Backports every CE related change from ee-44542 to CE 2018-05-04 17:33:26 +02:00
James Lopez bc7ea2d438
Add ci_cd_settings delete_all dependency on project 2018-05-04 15:09:28 +02:00
Shinya Maeda ecf8287ce5 Use prepend: true to evaluate always perform_fast_destroy than dependent: :destroy 2018-05-04 20:47:23 +09:00
Dylan Griffith af15b6f0e1 Fix Project#group_runners_enabled as it was doing nothing 2018-05-03 14:37:19 +02:00
Shinya Maeda b97d08494c Fix typo for comments in project.rb 2018-05-03 15:50:35 +09:00
Shinya Maeda 9e65dc5377 Introduce `use_fast_destroy` helper for parent associations. Rename method names in build_trace_chunks. Forbid `destroy` method when `FastDestroyAll` included. 2018-05-02 15:55:55 +09:00
Shinya Maeda 1d53918b62 Introduces `FastDestroyAll` module 2018-05-01 17:06:44 +09:00
Dylan Griffith d8dd25a60e Introduce Project#all_runners and use in Ci::UpdateBuildQueueService 2018-04-30 17:25:49 +04:00
Dylan Griffith 0077679ae8 Bring back shared_runners_available? method since it is overriden in EE 2018-04-27 10:05:51 +08:00
Dylan Griffith 8d8139862a Rename `runner.belonging_to_group(project.id) -> runner.belonging_to_parent_group_of_project(project.id)` 2018-04-27 09:15:54 +08:00