summaryrefslogtreecommitdiff
path: root/spec/models
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo: not -> noLin Jen-Shin2017-06-011-1/+1
|
* Merge all environment url methods, introduce ensure_persisted_environmentLin Jen-Shin2017-06-011-25/+38
| | | | | To make sure that we're accessing the same instance, so ending up with `env.external` = `env.external_url` shall be fine.
* split tests for expanded_environment_urlLin Jen-Shin2017-06-011-4/+25
|
* Introduce ci_environment_url which would fallbackLin Jen-Shin2017-06-011-6/+18
| | | | | | to the external_url from persisted environment, and make the other utility methods private as we don't really need to use them outside of the job.
* Just use the url from options, not saving it as a columnLin Jen-Shin2017-06-011-4/+3
|
* Merge remote-tracking branch 'upstream/master' into 25680-CI_ENVIRONMENT_URLLin Jen-Shin2017-06-0116-286/+243
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (251 commits) Don't match email addresses or foo@bar as user references Revert "Update GITLAB_SHELL_VERSION" Update GITLAB_SHELL_VERSION Add feature toggles through Flipper Change no_limits to limits Move includes call to scope Add GitLab Resources to University Add Documentation for GIT_CHECKOUT variable Remove entry variable Do not try to preload Commits when using Note.includes(:noteable) Ui improvements for count badges and permission badges Rename the other jobs Update jobs_spec for changes from builds_spec Introduce source to pipeline entity Update docs related to protected actions Add changelog for protected branches abilities fix Ask for an example project for bug reports Center loading spinner in issuable filters Fix chat commands specs related to protected actions Fix builds controller specs related to protected actions ...
| * Merge branch 'dm-collapsed-blob' into 'master'Sean McGivern2017-06-012-51/+23
| |\ | | | | | | | | | | | | Consistent diff and blob size limit names See merge request !11776
| | * Fix Diff#too_large? and specsDouwe Maan2017-05-301-32/+4
| | |
| | * Consistent diff and blob size limit namesDouwe Maan2017-05-292-29/+29
| | |
| * | Merge branch 'master' into 'trigger-source'Grzegorz Bizon2017-05-313-20/+18
| |\ \ | | | | | | | | | | | | # Conflicts: # db/schema.rb
| | * \ Merge branch 'tc-improve-project-api-perf' into 'master'Douwe Maan2017-05-312-19/+14
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve /project API performance Closes #31855 and #31937 See merge request !11666
| | | * | Remove some deprecated methodstc-improve-project-api-perfToon Claes2017-05-301-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | To avoid the use of slow queries, remove some deprecated methods and encourage the use of ProjectFinder to find projects.
| | | * | Add starred_by scope to ProjectToon Claes2017-05-301-0/+14
| | | | | | | | | | | | | | | | | | | | Add a scope to search for the projects that are starred by a certain user.
| | * | | Fix environment model specs related to protected actionsGrzegorz Bizon2017-05-311-1/+4
| | |/ /
| * | | Introduce source to pipeline entitytrigger-sourceKamil Trzcinski2017-05-311-2/+24
| |/ /
| * | Merge branch '30410-revert-9347-and-10079' into 'master'Douwe Maan2017-05-302-27/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Resolve "Allow to disable username on checkout url" Closes #30410 and #30174 See merge request !11792
| | * | Don't allow to pass a user to ProjectWiki#http_url_to_repoRémy Coutable2017-05-301-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | This partially reverts be25bbc4d2c7e3d5cf3da6f51cb7f7355295ef52. Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | Revert "Merge branch '1937-https-clone-url-username' into 'master' "Rémy Coutable2017-05-301-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c425f366bfa84efab92b5d5e1d0721f16a2890bc, reversing changes made to 82f6c0f5ac4ed29390ed90592d2c431f3494d93f. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | Don’t create comment on JIRA if link already existsJarka Kadlecova2017-05-301-0/+1
| |/ /
| * | Merge branch '32790-pipeline_schedules-pages-throwing-error-500' into 'master'Kamil Trzciński2017-05-291-0/+8
| |\ \ | | |/ | |/| | | | | | | | | | | | | Resolve "pipeline_schedules pages throwing error 500" Closes #32790 See merge request !11706
| | * Add a test for deletion of importing_or_inactive?Shinya Maeda2017-05-291-0/+8
| | |
| * | Merge branch 'rework-authorizations-performance' into 'master'Douwe Maan2017-05-297-186/+124
| |\ \ | | | | | | | | | | | | | | | | Rework project authorizations and nested groups for better performance See merge request !10885
| | * | Use CTEs for nested groups and authorizationsYorick Peterse2017-05-177-186/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the usage of Common Table Expressions (CTEs) to efficiently retrieve nested group hierarchies, without having to rely on the "routes" table (which is an _incredibly_ inefficient way of getting the data). This requires a patch to ActiveRecord (found in the added initializer) to work properly as ActiveRecord doesn't support WITH statements properly out of the box. Unfortunately MySQL provides no efficient way of getting nested groups. For example, the old routes setup could easily take 5-10 seconds depending on the amount of "routes" in a database. Providing vastly different logic for both MySQL and PostgreSQL will negatively impact the development process. Because of this the various nested groups related methods return empty relations when used in combination with MySQL. For project authorizations the logic is split up into two classes: * Gitlab::ProjectAuthorizations::WithNestedGroups * Gitlab::ProjectAuthorizations::WithoutNestedGroups Both classes get the fresh project authorizations (= as they should be in the "project_authorizations" table), including nested groups if PostgreSQL is used. The logic of these two classes is quite different apart from their public interface. This complicates development a bit, but unfortunately there is no way around this. This commit also introduces Gitlab::GroupHierarchy. This class can be used to get the ancestors and descendants of a base relation, or both by using a UNION. This in turn is used by methods such as: * Namespace#ancestors * Namespace#descendants * User#all_expanded_groups Again this class relies on CTEs and thus only works on PostgreSQL. The Namespace methods will return an empty relation when MySQL is used, while User#all_expanded_groups will return only the groups a user is a direct member of. Performance wise the impact is quite large. For example, on GitLab.com Namespace#descendants used to take around 580 ms to retrieve data for a particular user. Using CTEs we are able to reduce this down to roughly 1 millisecond, returning the exact same data. == On The Fly Refreshing Refreshing of authorizations on the fly (= when users.authorized_projects_populated was not set) is removed with this commit. This simplifies the code, and ensures any queries used for authorizations are not mutated because they are executed in a Rails scope (e.g. Project.visible_to_user). This commit includes a migration to schedule refreshing authorizations for all users, ensuring all of them have their authorizations in place. Said migration schedules users in batches of 5000, with 5 minutes between every batch to smear the load around a bit. == Spec Changes This commit also introduces some changes to various specs. For example, some specs for ProjectTeam assumed that creating a personal project would _not_ lead to the owner having access, which is incorrect. Because we also no longer refresh authorizations on the fly for new users some code had to be added to the "empty_project" factory. This chunk of code ensures that the owner's permissions are refreshed after creating the project, something that is normally done in Projects::CreateService.
| * | | Fix: Milestone - Participants list is showing duplicate assigneesfix_duplicated_assignees_on_milestone_pageValery Sizov2017-05-291-0/+13
| | |/ | |/|
| * | Update spec to match latest EE changesStan Hu2017-05-261-2/+7
| | |
| * | Add missing project import job example from gitlab-eeAlejandro Rodríguez2017-05-261-0/+20
| | |
* | | Merge branch 'master' into '25680-CI_ENVIRONMENT_URL'Lin Jen-Shin (godfat)2017-05-2612-139/+277
|\ \ \ | |/ / | | | | | | # Conflicts: # db/schema.rb
| * | Add API URL to JIRA settings31448-jira-urlsJarka Kadlecova2017-05-261-38/+114
| | |
| * | Merge branch 'dm-diff-cleanup' into 'master'Robert Speicher2017-05-252-5/+5
| |\ \ | | | | | | | | | | | | | | | | Clean up diff rendering See merge request !11390
| | * | Pass fallback_diff_refs to Diff::File instead of using view helpersDouwe Maan2017-05-232-5/+5
| | | |
| * | | Merge branch 'winh-label-textcolor-default' into 'master'Grzegorz Bizon2017-05-251-0/+17
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide default for calculating label text color Closes #32728 See merge request !11681
| | * | | Add failing test for #32728winh2017-05-251-0/+17
| | | | |
| * | | | Merge branch 'revert-b0498c17' into 'master'Robert Speicher2017-05-252-4/+4
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Refactor `DynamicPathValidator` and `GitLab::Regex` some more See merge request !11693
| | * | | | Revert "Remove changes that are not absolutely necessary"Douwe Maan2017-05-242-4/+4
| | | | | | | | | | | | | | | | | | This reverts commit b0498c176fa134761d899c9b369be12f1ca789c5
| * | | | | Merge branch 'fix-kubernetes-namespace' into 'master'Grzegorz Bizon2017-05-251-1/+30
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix terminals support for Kubernetes service Closes #31754 See merge request !11653
| | * | | | | Fix terminals support for Kubernetes serviceKamil Trzcinski2017-05-251-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It was broken, because we introduced a default namespace, which was not used by terminal methods.
| * | | | | | Merge branch '17848-web-hook-logging' into 'master'Dmitriy Zaporozhets2017-05-255-91/+91
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement Web Hooks calls logging Closes #17848 See merge request !11027
| | * | | | | Implement web hooks loggingAlexander Randa2017-05-255-91/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implemented logging of project and system web hooks * implemented UI for user area (project hooks) * implemented UI for admin area (system hooks) * implemented retry of logged webhook * NOT imeplemented log remover
| * | | | | | ensure rss token on readAlexis Reigel2017-05-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we do this on attribute read since migrating all existing users is not a feasible solution.
| * | | | | | add missing spec for incoming email token presenceAlexis Reigel2017-05-241-0/+7
| | | | | | |
| * | | | | | add rss_token attribute to user modelAlexis Reigel2017-05-241-0/+7
| | |/ / / / | |/| | | |
* | | | | | Pass external_url from environment if job doesn't have oneLin Jen-Shin2017-05-251-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | Also update the document and add a changelog entry
* | | | | | Add tests for CI_ENVIRONMENT_URLLin Jen-Shin2017-05-251-6/+53
|/ / / / /
* | | | | Merge branch 'dm-outdated-system-note' into 'master'Grzegorz Bizon2017-05-243-3/+66
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add system note with link to diff comparison when MR discussion becomes outdated Closes #30058 See merge request !11584
| * | | | | Address reviewDouwe Maan2017-05-241-0/+26
| | | | | |
| * | | | | Add system note with link to diff comparison when MR discussion becomes outdatedDouwe Maan2017-05-232-3/+40
| | |_|/ / | |/| | |
* | | | | Merge branch 'dm-fix-routes' into 'master'Robert Speicher2017-05-241-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | Fix ambiguous routing issues by teaching router about reserved words See merge request !11570
| * | | | Remove changes that are not absolutely necessarydm-fix-routesDouwe Maan2017-05-232-4/+4
| | | | |
| * | | | Fix ambiguous routing issues by teaching router about reserved wordsDouwe Maan2017-05-232-5/+5
| | |/ / | |/| |
* | | | Merge branch 'issue_32225' into 'master'Robert Speicher2017-05-232-7/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Add transient head_pipeline_of to pipeline factories See merge request !11566