summaryrefslogtreecommitdiff
path: root/lib/gitlab/checks
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Don't pass `env` anymore to GitAccess, ChangeAccess, and ForcePushbackport-ee-1525Rémy Coutable2017-04-102-4/+3
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Retrieve Git-specific env in Gitlab::Git::RevList and add a new #new_refs methodRémy Coutable2017-04-101-7/+3
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Protected Tags backend review changesJames Edwards-Jones2017-04-061-8/+2
| | | Added changelog
* Cleanup & tests for UserAccess#can_create_tag?James Edwards-Jones2017-04-041-1/+1
|
* Protected Tags prevents all updates instead of just force pushes.James Edwards-Jones2017-04-041-5/+9
| | | This only changes behaviour for masters, as developers are already prevented from updating/deleting tags without the Protected Tags feature
* Clean up non TODO rubocop errorsJames Edwards-Jones2017-04-031-4/+4
|
* Moved Project#protected_branch? to ProtectedBranch, similar for tagsJames Edwards-Jones2017-04-031-2/+2
|
* Added ‘protected’ label and disabled delete button for tags index/showJames Edwards-Jones2017-03-311-1/+1
|
* Protected Tags enforced over gitJames Edwards-Jones2017-03-311-5/+32
|
* Backport changes from gitlab-org/gitlab-ee!1406adam-backport-ee-1406Adam Niedzielski2017-03-131-2/+6
|
* Remove useless permission checks in Gitlab::Checks::ChangeAccess25018-gitlab-checks-changeaccess-looks-for-user-permissions-that-don-t-existRémy Coutable2017-01-121-2/+2
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-12-202-5/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/1376-allow-write-access-deploy-keys * upstream/master: (538 commits) Reject blank environment vcariables in Gitlab::Git::RevList Add online terminal documentation Add changelog entry Add terminal UI and controller actions Fix specs Even out padding on plus button in breadcrumb menu Update font size of detail page header to 14px Update CHANGELOG.md for 8.13.10 Update CHANGELOG.md for 8.14.5 Fix Route#rename_children behavior Remove inline-block styling from status Add terminals to the Kubernetes deployment service Add a ReactiveCaching concern for use in the KubernetesService Add xterm.js 2.1.0 and a wrapper class to the asset pipeline Remove unnecessary hidden svg elements for icons. Fix consistent typo in environment.js Use a block to insert extra check for authenticate_build! Align milestone column header with count number Add Wiki import to BB importer Make CI badge hitboxes better match container ...
| * Implement final review comments from @rymai.25301-git-2.11-force-push-bugTimothy Andrew2016-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | - `raise "string"` raises a `RuntimeError` - no need to be explicit - Remove top-level comment in the `RevList` class - Use `%w()` instead of `%w[]` - Extract an `environment_variables` method to cache `env.slice(*ALLOWED_VARIABLES)` - Use `start_with?` for env variable validation instead of regex match - Validation specs for each allowed environment variable were identical. Build them dynamically. - Minor change to `popen3` expectation.
| * Check the exit code while invoking git in the force push check.Timothy Andrew2016-12-161-2/+7
| | | | | | | | | | Previously, we were calling out to `popen` without asserting on the returned exit-code. Now we raise a `RuntimeError` if the exit code is non-zero.
| * Accept environment variables from the `pre-receive` script.Timothy Andrew2016-12-162-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Starting version 2.11, git changed the way the pre-receive flow works. - Previously, the new potential objects would be added to the main repo. If the pre-receive passes, the new objects stay in the repo but are linked up. If the pre-receive fails, the new objects stay orphaned in the repo, and are cleaned up during the next `git gc`. - In 2.11, the new potential objects are added to a temporary "alternate object directory", that git creates for this purpose. If the pre-receive passes, the objects from the alternate object directory are migrated to the main repo. If the pre-receive fails the alternate object directory is simply deleted. 2. In our workflow, the pre-recieve script (in `gitlab-shell) calls the `/allowed` endpoint, which calls out directly to git to perform various checks. These direct calls to git do _not_ have the necessary environment variables set which allow access to the "alternate object directory" (explained above). Therefore these calls to git are not able to access any of the new potential objects to be added during this push. 3. We fix this by accepting the relevant environment variables (GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_OBJECT_DIRECTORY) on the `/allowed` endpoint, and then include these environment variables while calling out to git. 4. This commit includes (whitelisted) these environment variables while making the "force push" check. A `Gitlab::Git::RevList` module is extracted to prevent `ForcePush` from being littered with these checks.
* | We never check user privilege if it's a deploy keyLin Jen-Shin2016-11-181-2/+9
|/
* Avoid protected branches checks when verifying access without branch namePaco Guzman2016-09-131-0/+1
| | | | | | GitlabShell verify access sending ‘_any’ as the changes made on the git command, in those cases Gitlab::Checks::ChangeAccess won’t receive a branch_name so we don’t need to check for access to the protected branches on that repository. So we avoid some git operations in case the are not cached (empty_repo?) and some database lookups to get protected branches. These request is happening in every push.
* Change the order of the access rules to check simpler first, and add specschange-access-updateAlejandro Rodríguez2016-08-121-1/+1
|
* api for generating new merge requestScott Le2016-08-111-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | DRY code + fix rubocop Add more test cases Append to changelog DRY changes list find_url service for merge_requests use GET for getting merge request links remove files rename to get_url_service reduce loop add test case for cross project refactor tiny thing update changelog