summaryrefslogtreecommitdiff
path: root/spec/models/project_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '1937-https-clone-url-username' into 'master' Rémy Coutable2017-02-271-0/+21
|\ | | | | | | | | | | | | Add the username of the current user to the HTTP(S) clone URL Closes #1937 See merge request !9347
| * Add the username of the current user to the HTTP(S) clone URLJan Christophersen2017-02-241-0/+21
| |
* | Rename commit_file, commit_dir and remove_file and update specsDouwe Maan2017-02-241-1/+1
| |
* | Use Namespace#full_path instead of #path where appropriatedm-more-namespace-full-pathDouwe Maan2017-02-231-9/+7
|/
* Use Namespace#full_path instead of Namespace#pathDmitriy Zaporozhets2017-02-141-10/+29
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Store group and project full name and full path in routes tabledz-refactor-full-pathDmitriy Zaporozhets2017-02-081-7/+14
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Address feedbackDouwe Maan2017-02-061-106/+1
|
* Improve performance of finding last deployed environmentDouwe Maan2017-02-061-44/+8
|
* Add testsDouwe Maan2017-02-061-0/+123
|
* Merge branch 'jej-pages-to-ce' into 'master' Douwe Maan2017-02-061-0/+44
|\ | | | | | | | | | | | | Adding GitLab Pages to CE Closes #14605, gitlab-com/infrastructure#1058, gitlab-ee#1333, and #323 See merge request !8463
| * Mock Dir::exist? in project_spec.rbKamil Trzcinski2017-01-311-2/+1
| |
| * Introduce pages_deployed? to Project modelKamil Trzcinski2017-01-311-6/+17
| |
| * Describe #pages_url instead of :pages_urlKamil Trzcinski2017-01-311-1/+1
| |
| * Fix the URL of group pagesKamil Trzcinski2017-01-311-0/+33
| |
| * Pages domain model specsKamil Trzcinski2017-01-311-0/+1
| |
* | Add traits for ProjectFeatures to Project factorySemyon Pupkov2017-02-051-1/+1
|/ | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
* Improve search within group logicDmitriy Zaporozhets2017-01-301-0/+8
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Present group and dashboard MR list without grouping by projectOswaldo Ferreira2017-01-271-4/+4
|
* Refactor Project#to_reference and make full_path a keyword argumentBerna Castro2017-01-271-6/+32
| | | | | | | | | | | | Refactor overall code and fix failing specs Fix Project#to_reference Fix wrong spaces and update changelog Refactor #to_reference for Project & Issue Fix and improves Project#to_reference
* Fix and add specs for Project#to_referenceBerna Castro2017-01-271-3/+9
|
* Backport changes introduced by ↵Kamil Trzcinski2017-01-201-0/+42
| | | | https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1083
* Convert most Project model specs to use `:empty_project`Robert Speicher2017-01-191-54/+54
|
* Expire related caches after changing HEADpmq20/gitlab-ce-psvr/head/cacheMinqi Pan2017-01-151-7/+4
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* New error message recreating projects on pending deletefix/project-delete-tooltipJames Lopez2017-01-111-5/+25
|
* Remove unused `Project#web_url_without_protocol` methodrs-remove-unused-methodRobert Speicher2017-01-031-8/+0
|
* Add more storage statisticsMarkus Koller2016-12-211-0/+21
| | | | | | | | | | | | | This adds counters for build artifacts and LFS objects, and moves the preexisting repository_size and commit_count from the projects table into a new project_statistics table. The counters are displayed in the administration area for projects and groups, and also available through the API for admins (on */all) and normal users (on */owned) The statistics are updated through ProjectCacheWorker, which can now do more granular updates with the new :statistics argument.
* Rename MattermostNotificationService back to MattermostServicefix/25843Douglas Barbosa Alexandre2016-12-201-1/+1
|
* Rename SlackNotificationService back to SlackServiceDouglas Barbosa Alexandre2016-12-201-1/+1
|
* Merge branch '22348-gitea-importer' into 'master' Rémy Coutable2016-12-201-0/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It adds a brand new importer for Gitea! This is a continuation of !6945 started by @bkc. Gitea aims to be 100% GitHub-compatible but there's a few differences: - Gitea is not an OAuth provider (yet): https://github.com/go-gitea/gitea/issues/27 - This means we cannot map Gitea users given an assignee ID => assignees are not set on imported issues and merge requests - No releases API for now: https://github.com/go-gitea/gitea/issues/330 - API version is `v1` (GitHub is `v3`) - The IID field for milestones is `id` compared to `number` in GitHub. - Issues, PRs, milestones, labels don't have a `url` field (the importer now fallback to `''` in that case) **Known issues:** - Comments are not imported because comments JSON always have a blank `html_url`/`issue_url`/`pull_request_url`, so the IID cannot be extracted and the issuable cannot be found... :( This is tracked in https://github.com/go-gitea/gitea/issues/401, and solved by https://github.com/gogits/gogs/pull/3624 but this needs to be submitted / merged in Gitea. This is noted in the documentation. ## Are there points in the code the reviewer needs to double check? 1. I've made `Import::GiteaController` inherit from `Import::GithubController` since both controllers should be identical in the long-term and their current differences are small. 1. I've added a base `IssuableFormatter` class from which `IssueFormatter` & `PullRequestFormatter` inherit 1. I've added shared examples for GitHub/Gitea importer classes 1. I've made `Gitlab::ImportSources` more robust and tested! :christmas_tree: 1. I've added routing specs for import routes! :christmas_tree: Closes #22348 See merge request !8116
| * Add Project#gitea_import?22348-gitea-importerRémy Coutable2016-12-191-0/+12
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'zj-kamil-slack-slash-commands' into 'master' Grzegorz Bizon2016-12-201-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slack slash commands ## What does this MR do? Implement Slack Slash Commands by utilizing generalized Mattermost presenter to fulfill Slack requirements. ## Why was this MR needed? We want to expose Slack Slash Commands as a first-class service. ## What are the relevant issue numbers? Supersedes !8007 Closes #22182 See merge request !8126
| * Fix spec failuresKamil Trzcinski2016-12-181-1/+1
| |
* | Merge branch 'expose-deployment-variables' into 'master' 25743-clean-up-css-for-project-alerts-and-flash-notificationsKamil Trzciński2016-12-161-0/+20
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass variables from deployment project services to CI runner ## What does this MR do? This commit introduces the concept of deployment variables - variables that are collected from deployment services and passed to CI runner during a deployment build. Deployment services specify the variables by overriding "predefined_variables" method. This commit also configures variables for KubernetesService ## Why was this MR needed? We need these values for https://gitlab.com/gitlab-org/gitlab-ce/issues/23580 ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - ~~[ ] API support added~~ - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Refers to https://gitlab.com/gitlab-org/gitlab-ce/issues/23580 See merge request !8107
| * Pass variables from deployment project services to CI runnerexpose-deployment-variablesAdam Niedzielski2016-12-161-0/+20
| | | | | | | | | | | | | | | | | | | | This commit introduces the concept of deployment variables - variables that are collected from deployment services and passed to CI runner during a deployment build. Deployment services specify the variables by overriding "predefined_variables" method. This commit also configures variables for KubernetesService
* | Change SlackService to SlackNotificationsServiceissue_22269_fix_eeissue_22269Felipe Artur2016-12-151-2/+2
| |
* | Mattermost Notifications ServiceFelipe Artur2016-12-151-0/+1
|/
* Merge branch 'dz-nested-groups' into 'master' Douwe Maan2016-12-091-62/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add nested groups support on data level ## What does this MR do? - [x] Add `parent_id` field to `Namespace`model. - [x] Create new database table `routes` that keeps information about full path to each group or project - [x] Remove uniq index from `namespaces.path` - [x] Add uniq index on `routes.path` - [x] Fill routes table with path data from namespaces and projects - [x] Change Namespace/Project URL lookup by routes table - [x] Rename related routes (nested groups, projects) when parent path changes This is solely backend preparation. UI, Permissions and API support will be added in separate merge request. ## Are there points in the code the reviewer needs to double check? migrations, Route model, Routable concern Will require downtime. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7121#note_19490281 discussion ## Why was this MR needed? One step further to full nested groups support ## Screenshots (if relevant) No UI changes in this merge request so far ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added~~ - ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/2772 See merge request !7121
| * Add nested groups support on data leveldz-nested-groupsDmitriy Zaporozhets2016-12-081-62/+0
| | | | | | | | | | | | | | | | * add parent_id field to namespaces table to store relation with nested groups * create routes table to keep information about full path of every group and project * project/group lookup by full path from routes table Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Merge branch '25209-improve-length-validators' into 'master' Rémy Coutable2016-12-071-3/+7
|\ \ | |/ |/| | | | | | | | | Use :maximum instead of :within for length validators with a 0..N range Closes #25209 See merge request !7894
| * Use :maximum instead of :within for length validators with a 0..N range25209-improve-length-validatorsRémy Coutable2016-12-061-3/+7
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Add shorthand support to gitlab markdown referencesOswaldo Ferreira2016-12-021-3/+63
|/
* Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' Douwe Maan2016-11-281-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace issue access checks with use of IssuableFinder Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867 ## Which fixes are in this MR? :warning: - Potentially untested :bomb: - No test coverage :traffic_light: - Test coverage of some sort exists (a test failed when error raised) :vertical_traffic_light: - Test coverage of return value (a test failed when nil used) :white_check_mark: - Permissions check tested ### Issue lookup with access check Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells). - [x] :vertical_traffic_light: app/finders/notes_finder.rb:15 [`visible_to_user`] - [x] :traffic_light: app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`] - [x] :white_check_mark: app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`] - [x] :white_check_mark: lib/api/issues.rb:112 [`visible_to_user`] - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone - [x] :white_check_mark: lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too? - [x] :white_check_mark: lib/gitlab/search_results.rb:53 [`visible_to_user`] ### Previous discussions - [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126 - [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87 See merge request !2031
* Drop Project#authorized_for_user? in favor of ProjectTeam#member?Ahmad Sherif2016-11-231-51/+0
| | | | Closes #23938
* Merge branch 'rs-project-team-helpers' into 'master' Sean McGivern2016-11-221-0/+7
|\ | | | | | | | | | | | | Add shortcuts for adding users to a project team with a specific role Closes #20944 See merge request !7565
| * Add shortcuts for adding users to a project team with a specific rolers-project-team-helpersRobert Speicher2016-11-181-0/+7
| | | | | | | | | | | | | | | | | | | | This also updates _some_ specs to use these new methods, just to serve as an example for others going forward, but by no means is this exhaustive. Original implementations at !5992 and !6012. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20944
* | Refactor cache refreshing/expiringYorick Peterse2016-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactors repository caching so it's possible to selectively refresh certain caches, instead of just expiring and refreshing everything. To allow this the various methods that were cached (e.g. "tag_count" and "readme") use a similar pattern that makes expiring and refreshing their data much easier. In this new setup caches are refreshed as follows: 1. After a commit (but before running ProjectCacheWorker) we expire some basic caches such as the commit count and repository size. 2. ProjectCacheWorker will recalculate the commit count, repository size, then refresh a specific set of caches based on the list of files changed in a push payload. This requires a bunch of changes to the various methods that may be cached. For one, data should not be cached if a branch used or the entire repository does not exist. To prevent all these methods from handling this manually this is taken care of in Repository#cache_method_output. Some methods still manually check for the existence of a repository but this result is also cached. With selective flushing implemented ProjectCacheWorker no longer uses an exclusive lease for all of its work. Instead this worker only uses a lease to limit the number of times the repository size is updated as this is a fairly expensive operation.
* | Merge branch 'feature/precalculate-authorized-projects' into 'master' Douwe Maan2016-11-181-2/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Precalculate authorized projects in database ## What does this MR do? It caches user's authorized projects in database instead of using multiple unions, which should simplify and speed-up things since this operation (getting authorized projects) is used a lot. ## Are there points in the code the reviewer needs to double check? Did we miss a scenario where we need to refresh the list of projects? ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [ ] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? #23150 See merge request !6839
| * | Precalculate user's authorized projects in databaseAhmad Sherif2016-11-181-2/+4
| |/ | | | | | | Closes #23150
* | Merge branch 'zj-slash-commands-mattermost' into 'master' Kamil Trzciński2016-11-181-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slash command for mattermost Closes #22540 ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) See merge request !7438
| * | Rename mattermost_command to mattermost_slash_commandszj-slash-commands-mattermostKamil Trzcinski2016-11-181-1/+1
| | |