summaryrefslogtreecommitdiff
path: root/app/services
Commit message (Collapse)AuthorAgeFilesLines
* Refactored AfterRenameService to reduce couplingGabriel Mazetto2019-01-222-13/+21
| | | | | | | | | | | We still rely on the Dirty API for project rename (before/after) values, but we don't access the dirty api from the service class anymore. The previous value is now part of the initialization, which makes it easier to test and the behavior is clearer. The same was done with the `rename_repo` on the Storage classes, we now provide before and after values as part of the method signature.
* Fixed legacy storage renaming codeGabriel Mazetto2019-01-212-2/+6
| | | | | | | | | | | | | | | During a previous refactor on project model, code related to the hashed storage was extracted into AfterRenameService, see 4b9c17f196bab6075563f62d01f9db65c1a0515c. The "path_before" was changed from using `previous_changes['path']` to `path_was`. They are not equivalent. `path_was` exists reliably only *before* persisting to the database. After database persistence is confirmed, the value is moved to `previous_changes[:attribute_name]`. Because the repository/attachments rename or storage upgrade happens after it was persisted to the database, we were in fact not informing the right parameters (and therefore not doing what it was supposed to).
* Merge branch 'raise-on-unfiltered-params' into 'master'Rémy Coutable2019-01-211-1/+1
|\ | | | | | | | | Set ActionController raise_on_unfiltered_parameters to true See merge request gitlab-org/gitlab-ce!24443
| * Actually set raise_on_unfiltered_parameters to trueJasper Maes2019-01-161-1/+1
| |
* | Merge branch 'osw-enforces-project-removal-with-past-failed-attempts' into ↵Nick Thomas2019-01-181-5/+19
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 'master' Cleanup stale +deleted repo paths on project removal (adjusts project removal bug) Closes #46146 See merge request gitlab-org/gitlab-ce!24269
| * | Cleanup stale +deleted repo paths on project removalOswaldo Ferreira2019-01-181-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. When removing projects, we can end-up leaving the +deleted repo path dirty and not successfully removing the non-deleted namespace (mv process is not atomic and can be killed without fully moving the path). 2. In order to solve that, we're adding a clean-up phase on ensure which will schedule possible staled +deleted path deletion. Note that we don't check the current state (if there is or not a repo) in order to schedule the deletion. That's intentional in order to leverage Gitlab::GitalyClient::NamespaceService#remove idempotency and ensure consistency.
* | | Merge branch '55544-port-upgrade-command' into 'master'Kamil Trzciński2019-01-181-0/+4
|\ \ \ | | | | | | | | | | | | | | | | Port generic Helm upgrade functionality to CE See merge request gitlab-org/gitlab-ce!23924
| * | | Port generic upgrade functionality to CE55544-port-upgrade-commandThong Kuah2019-01-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port from EE generic upgrade related functionality used to upgrade Helm applications Remove memoization which could be incorrect It looks like we are memoizing without regard to the method's argument so this could result in an incorrect upgrade_command Remove `const_get` indirection now we are no longer in EE
* | | | Merge branch '47988-improve-milestone-queries-with-subq' into 'master'Andreas Brandl2019-01-173-6/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve MilestonesFinder to accept project and group relations Closes #47988 See merge request gitlab-org/gitlab-ce!24325
| * | | | Fix MilestonesFinder to pass relations to scopeHeinrich Lee Yu2019-01-123-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of querying relations into ids we just pass them to the model scope because the scope supports it now. Also changes other calls to `Milestone.for_projects_and_groups`
* | | | | API for importing external reposBen2019-01-172-0/+83
| |_|_|/ |/| | |
* | | | Merge branch 'refactor-after-create-default-branch' into 'master'Nick Thomas2019-01-161-0/+67
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Refactor Project#after_create_default_branch See merge request gitlab-org/gitlab-ce!24329
| * | | | Refactor code for protecting default branchesYorick Peterse2019-01-161-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge branch 'osw-fix-quick-suggestion-application-being-reverted' into 'master'Douwe Maan2019-01-141-8/+26
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | Adjust applied suggestion reverting previous changes Closes #56017 See merge request gitlab-org/gitlab-ce!24250
| * | | | Adjust applied suggestion reverting previous changesOswaldo Ferreira2019-01-111-8/+26
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Avoid suggestions being applied on the same file from reverting previous changes 2. Gracefully use and handle file changes error when updating the file (though, it does not totally solves the sync problem for multiple suggestion applications at once)
* | | | Fix several ActionController::Parameters deprecationsJasper Maes2019-01-114-4/+4
| |/ / |/| |
* | | Disable audit event logging for pipeline destructionStan Hu2019-01-101-2/+0
| |/ |/| | | | | | | | | | | | | | | | | | | AuditEventService isn't equipped to handle logging of the destruction of entities such as CI pipelines. It's a project-level event that operates on a pipeline. The current log doesn't even indicate that the pipeline is being destroyed. This is a CE backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9105. We're removing the auditing call because it breaks the EE implementation.
* | Service for calling Sentry issues apiReuben Pereira2019-01-091-0/+49
|/
* Merge branch '53966-hashed-storage-read-only' into 'master'Douglas Barbosa Alexandre2019-01-081-0/+14
|\ | | | | | | | | Hashed Storage: Only set as `read_only` when starting the per-project migration See merge request gitlab-org/gitlab-ce!24128
| * Only set as `read_only` when starting the per-project migration53966-hashed-storage-read-onlyGabriel Mazetto2019-01-071-0/+14
| | | | | | | | | | | | | | | | | | | | 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).
* | Merge branch '49231-import-issues-csv' into 'master'Douwe Maan2019-01-072-1/+54
|\ \ | | | | | | | | | | | | | | | | | | Import issues from CSV Closes #49231 See merge request gitlab-org/gitlab-ce!23532
| * | Remove caching of CSV file49231-import-issues-csvHeinrich Lee Yu2019-01-071-18/+6
| | | | | | | | | | | | Load whole file in memory to simplify code
| * | Improve email messagesHeinrich Lee Yu2019-01-071-3/+3
| | | | | | | | | | | | Also refactored cleanup view to use the same localized string
| * | Refactor upload service to return uploaderHeinrich Lee Yu2019-01-071-5/+3
| | | | | | | | | | | | Also changes old calls to the service
| * | Import CSV BackendHeinrich Lee Yu2019-01-072-3/+70
| | | | | | | | | | | | Process CSV uploads async using a worker then email results
* | | Merge branch 'ce-7407-label-quick-epics' into 'master'Lin Jen-Shin2019-01-072-15/+28
|\ \ \ | | | | | | | | | | | | | | | | CE port: Use parent instead of project for quick actions See merge request gitlab-org/gitlab-ce!24124
| * | | Use parent instead of projectJarka Košanová2019-01-082-15/+28
| | | | | | | | | | | | | | | | Add support for group entities to quick actions
* | | | Implement error tracking configurationPeter Leitzen2019-01-071-1/+1
|/ / / | | | | | | | | | Re-use operations controller which already handles tracing settings.
* | | Merge branch 'user-update-head-pipeline-worker-2' into 'master'Grzegorz Bizon2019-01-071-15/+1
|\ \ \ | |/ / |/| | | | | | | | Refactor the logic of updating head pipelines for merge requests See merge request gitlab-org/gitlab-ce!23502
| * | Refactor the logic of updating head pipelinesShinya Maeda2019-01-041-15/+1
| | | | | | | | | | | | Sort out some logic
* | | Move settings operations controller from EE to CEmove-settings-oprations-to-cePeter Leitzen2019-01-061-0/+19
| | | | | | | | | | | | | | | This commit prepares the structure for the upcoming feature error tracking.
* | | Add config_options|variables to BuildMetadatakamil-refactor-ci-builds-v5Kamil Trzciński2019-01-041-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | 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).
* | Add unique constraint to release and urlShinya Maeda2019-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix coding style Improve coding style Decouple UPDATE and DELETE operations of asset links Rename links_attributes to assets:links Rename exposed param and updated spec
* | Add spec for duplicate link name creationShinya Maeda2019-01-041-1/+1
| | | | | | | | Fix spec for mysql unique validation failure
* | Support CURD operation for release asset linksShinya Maeda2019-01-041-1/+2
|/ | | | | | - Add Releases::Links model - Expose it in release API - Add integration tests
* Merge branch '18667-handle-push-opts' into 'master'Douwe Maan2019-01-023-3/+6
|\ | | | | | | | | | | | | Handle 'git push -o ci.skip' Closes #18667 See merge request gitlab-org/gitlab-ce!15643
| * Add support for Git push options, specifically ci.skipJonathon Reinhart2018-12-313-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gitlab-org/gitlab-shell!166 added support for collecting push options from the environment, and passing them along to the /internal/post_receive API endpoint. This change handles the new push_options JSON element in the payload, and passes them on through to the GitPushService and GitTagPushService services. Futhermore, it adds support for the first push option, ci.skip. With this change, one can use 'git push -o ci.skip' to skip CI pipe execution. Note that the pipeline is still created, but in the "skipped" state, just like with the 'ci skip' commit message text. Implements #18667
* | Merge branch 'blackst0ne-bump-rails-cve-2018-16476' into 'master'Grzegorz Bizon2019-01-022-3/+5
|\ \ | | | | | | | | | | | | Bump Ruby on Rails to 5.0.7.1 See merge request gitlab-org/gitlab-ce!23396
| * | Bump Ruby on Rails to 5.0.7.1blackst0ne-bump-rails-cve-2018-16476blackst0ne2018-12-212-3/+5
| | | | | | | | | | | | Fix the CVE-2018-16476 vulnerability.
* | | Merge branch 'security-todos_not_redacted_for_guests' into 'master'John Jarvis2019-01-026-11/+20
|\ \ \ | | | | | | | | | | | | | | | | [master] Security todos not redacted for guests See merge request gitlab/gitlabhq!2697
| * | | Delete confidential issue todos for guestsFelipe Artur2018-12-146-11/+20
| | | | | | | | | | | | | | | | | | | | Fix leaking information of confidential issues on TODOs when user is downgraded to guest access.
* | | | Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhqJohn Jarvis2019-01-012-15/+44
|\ \ \ \ | |_|_|/ |/| | |
| * | | Merge branch 'security-bvl-fix-cross-project-mr-exposure' into 'master'John Jarvis2019-01-011-7/+17
| |\ \ \ | | | | | | | | | | | | | | | | | | | | [master] Validate projects in MR build service See merge request gitlab/gitlabhq!2678
| | * | | Validate projects in MR build serviceBob Van Landuyt2018-12-141-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This validates the correct abilities for both projects. Only `read_project` isn't enough: For the `source_project` we validate `create_merge_request_from` this also validates that the user has developer access to the project. For the `target_project` we validate `create_merge_reqeust_in` this also validates that the user has access to the project's repository. To avoid generating diffs for unrelated projects we also validate that the projects are in the same fork network now.
| * | | | Merge branch 'security-fix-ssrf-lfs-project-import' into 'master'John Jarvis2019-01-011-8/+27
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | [master] SSRF in project imports with LFS See merge request gitlab/gitlabhq!2720
| | * | | | Fixed SSRF in project imports with LFSFrancisco Javier López2018-12-181-8/+27
| | | | | |
* | | | | | Resolve a Cognitive Complexity of 12Shinya Maeda2018-12-311-12/+18
| | | | | |
* | | | | | Add spec for Release APIShinya Maeda2018-12-318-103/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add spec for all release API - GET, POST, PUT, DELETE. Also, fixes some minior bugs.
* | | | | | Add delete method in Release APIShinya Maeda2018-12-311-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | Introduce DELETE endpoint in Release API
* | | | | | Refactor Release servicesAlessio Caiazza2018-12-312-60/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CreateReleaseService and UpdateReleaseService now takes all the release attributes as constructor parameters. This will simplify attribute expansion