summaryrefslogtreecommitdiff
path: root/lib/gitlab/checks
Commit message (Collapse)AuthorAgeFilesLines
* Allow users to create protected branches via CLIPatrick Bajao2019-03-211-0/+2
| | | | | | | | | | This is for fixing a regression introduced by: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24969 This fix will allow users who are allowed to push to protected branches to create protected branches via CLI as well, just like before. The checks for protected branch creation won't need to run.
* Move empty_repo check on its own58613-protected-branches-errorPatrick Bajao2019-03-071-1/+3
|
* Allow protected branch creation for empty projectPatrick Bajao2019-03-071-1/+1
|
* Allow protected branch creation via web and APIPatrick Bajao2019-03-061-2/+32
| | | | | | | | | | | | This commit includes changes to add `UserAccess#can_create_branch?` which will check whether the user is allowed to create a branch even if it matches a protected branch. This is used in `Gitlab::Checks::BranchCheck` when the branch name matches a protected branch. A `push_to_create_protected_branch` ability in `ProjectPolicy` has been added to allow Developers and above to create protected branches.
* Remove oldrev and newrev nil-checks that are now unnecessaryDouwe Maan2019-01-022-2/+6
|
* Don't run single change checks when changes are unknownDouwe Maan2019-01-021-2/+2
| | | | | | | | When the `changes` passed to `GitAccess` are the literal string `_any`, which indicates that this is a pre-authorization check, we now check whether the user can push to any branch in the project in question, instead of running the per-change check with `oldrev` `_any`, `newrev` `nil`, and `ref` `nil`.
* Skip change access check for deploy keysDouwe Maan2019-01-021-4/+1
|
* Skip per-commit validations which have already passed on another change/branchFrancisco Javier López2018-12-283-13/+28
|
* Remove now-unnecessary checksDouwe Maan2018-12-111-1/+1
|
* Fix DiffCheck failing due to invalid string argumentStan Hu2018-12-111-0/+1
| | | | Hot patch for #55137
* CE port Refactor Gitlab::Checks::ChangeAccess classFrancisco Javier López2018-12-048-281/+355
|
* Fix bug in CommitCheckfj-fix-bug-commit-checkFrancisco Javier López2018-11-141-2/+2
|
* Reverts commits_check messageTiago Botelho2018-10-261-1/+1
|
* Iterating through commit list times outTiago Botelho2018-10-252-2/+6
| | | | | | | | Validating each commit on ChangeAccess times out if it already took too long to complete. Improves the TimedLogger specs to not make use of a stubbed class anymore
* Refactors TimedLogger to be more OOP compliantTiago Botelho2018-10-252-6/+18
| | | | | | | Adds a #full_message method so that external classes do not have access to the state of the logger. Adds a #append_message to always append to the array in-place
* Adds tracing messages for slow git pushesTiago Botelho2018-10-253-38/+144
| | | | | | Whenever a git push takes more than 50 seconds the user will receive a trace from each check performed along with their timings
* Enable some frozen string in lib/gitlabgfyoung2018-10-138-0/+16
| | | | | | | | | | | | | | Enable frozen string for the following files: * lib/gitlab/auth/**/*.rb * lib/gitlab/badge/**/*.rb * lib/gitlab/bare_repository_import/**/*.rb * lib/gitlab/bitbucket_import/**/*.rb * lib/gitlab/bitbucket_server_import/**/*.rb * lib/gitlab/cache/**/*.rb * lib/gitlab/checks/**/*.rb Partially addresses #47424.
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-113-0/+6
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Backport some changes from gitlab-org/gitlab-ee!6767Rubén Dávila2018-08-071-3/+2
|
* Improves remote message when a developer is unable to push in an empty ↵27456-improve-feedback-when-dev-cannot-push-to-empty-repoTiago Botelho2018-07-181-1/+24
| | | | repository
* Force push is handled by Gitaly nowzj-force-push-opt-outZeger-Jan van de Weg2018-06-191-12/+4
| | | | Closes gitlab-org/gitaly#348
* Eliminate N+1 queries in LFS file locks checks during a pushsh-optimize-locks-check-ceStan Hu2018-06-181-1/+1
| | | | | | | | | | 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.
* change wordingMark Chao2018-06-061-1/+1
|
* Add helper for accessing lfs_objects for projectBob Van Landuyt2018-04-051-2/+1
| | | | | | | | | | | | | | This makes accessing LFS Objects for a project easier project.lfs_storage_project.lfs_objects` becomes project.all_lfs_objects This will make the refactor in https://gitlab.com/gitlab-org/gitlab-ce/issues/39769 easier to deal with.
* Remove permanent redirectsBob Van Landuyt2018-03-281-18/+2
| | | | | Removes permanent redirects, this means that redirects will only be possible as long as the old route isn't taken by a new project/group.
* Limit queries to a user-branch combinationBob Van Landuyt2018-03-071-1/+6
| | | | | The query becomes a lot simpler if we can check the branch name as well instead of having to load all branch names.
* Allow maintainers to edit directly in a forkBob Van Landuyt2018-03-071-1/+1
|
* Merge branch 'jej/avoid-slow-file-lock-checks' into 'master'Sean McGivern2018-02-192-3/+8
|\ | | | | | | | | | | | | Avoid slow File Lock checks when not used Closes #43339 See merge request gitlab-org/gitlab-ce!17140
| * Avoid slow File Lock checks when not usedJames Edwards-Jones2018-02-192-3/+8
| | | | | | | | | | Also avoid double commit lookup during file lock check by reusing memoized commits.
* | Only check LFS integrity for first branch in pushjej/fix-slow-lfs-object-checkJames Edwards-Jones2018-02-151-3/+4
|/
* Backport of LFS File Locking APIrd-35856-backport-lfs-file-locking-apiRubén Dávila2018-02-072-1/+89
|
* Merge branch 'master' into '26388-push-to-create-a-new-project'Douwe Maan2018-02-061-2/+2
|\ | | | | | | # Conflicts: # lib/gitlab/path_regex.rb
| * Refactor Gitlab::Git code related to LFS changes for Gitaly migrationgitaly-lfs-client-prepAlejandro Rodríguez2018-02-021-2/+2
| | | | | | | | | | | | | | We stop relying on Gitlab::Git::Env for the RevList class, and use Gitlab::Git::Repository#run_git methods inteaad. The refactor also fixes another issue, since we now top using "path_to_repo" (which is a Repository model method).
* | Moves project creationg to git access check for git pushTiago Botelho2018-02-063-6/+6
| |
* | Abstracts ProjectMoved and ProjectCreated into a BaseProjectTiago Botelho2018-02-063-65/+58
| |
* | Move new project on push logic to a serviceTiago Botelho2018-02-061-12/+12
| |
* | Add specsTiago Botelho2018-02-061-0/+2
| |
* | Adds remote messsage when project is created in a push over SSH or HTTPTiago Botelho2018-02-061-0/+60
|/
* Backport changes to Gitlab::Checks::ChangeAccess from EEDouwe Maan2018-01-231-17/+21
|
* Disable redirect messages for anonymous clonessh-handle-anonymous-clones-project-movedStan Hu2017-12-251-10/+7
|
* Fix Error 500s with anonymous clones for a project that has movedStan Hu2017-12-251-3/+10
| | | | Closes #41457
* Allow git pull/push on project redirectsMayra Cabrera2017-12-081-0/+65
|
* Handle forks in Gitlab::Checks::LfsIntegrityjej/fix-lfs-integrity-with-forksJames Edwards-Jones2017-11-091-1/+4
|
* Prevent git push when LFS objects are missingJames Edwards-Jones2017-11-062-1/+35
|
* replace `is_ancestor` with `ancestor?`Maxim Rydkin2017-08-291-1/+1
|
* Migrate force push check to Gitalyfeature/migrate-force-push-check-to-gitalyAhmad Sherif2017-08-111-6/+13
|
* Remove GitAccessStatus (no longer needed)Michael Kozono2017-06-051-2/+2
|
* Refactor to let GitAccess errors bubble upMichael Kozono2017-06-051-17/+15
| | | | | | No external behavior change. This allows `GitHttpController` to set the HTTP status based on the type of error. Alternatively, we could have added an attribute to GitAccessStatus, but this pattern seemed appropriate.
* Fix Git over HTTP specMichael Kozono2017-06-051-11/+25
| | | | | | | | | | | * The spec has 7 failures at this point * Specify rendered error messages * Render the GitAccess message rather than “Access denied” * Render the Not Found message provided by GitAccess, instead of a custom one * Expect GitAccess to check the config for whether Git-over-HTTP pull or push is disabled, rather than doing it in the controller * Add more thorough testing for authentication * Dried up a lot of tests * Fixed some broken tests
* Add confirm delete protected branch modalSam Rose2017-05-081-27/+41
|