summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Update Boards::CreateService to handle with the has_many associationDouglas Barbosa Alexandre2016-10-113-20/+15
|
* Restrict the number of permitted boards per project to oneDouglas Barbosa Alexandre2016-10-111-0/+9
|
* Allow projects to have many boardsDouglas Barbosa Alexandre2016-10-111-1/+1
|
* Merge branch 'sh-fix-issue-20776' into 'master' Robert Speicher2016-10-111-0/+10
|\ | | | | | | | | | | | | | | | | | | Fix Error 500 when viewing old merge requests with bad diff data Customers running old versions of GitLab may have MergeRequestDiffs with the text ["--broken diff"] due to text generated by gitlab_git 1.0.3. To avoid the Error 500, verify that each element is a type that gitlab_git will accept before attempting to create a DiffCollection. Closes #20776 See merge request !6754
| * Fix Error 500 when viewing old merge requests with bad diff datash-fix-issue-20776Stan Hu2016-10-101-0/+10
| | | | | | | | | | | | | | | | | | Customers running old versions of GitLab may have MergeRequestDiffs with the text ["--broken diff"] due to text generated by gitlab_git 1.0.3. To avoid the Error 500, verify that each element is a type that gitlab_git will accept before attempting to create a DiffCollection. Closes #20776
* | Merge branch 'new-gitlab-users-clear_all_authentication_tokens-task' into ↵Robert Speicher2016-10-111-0/+38
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Add a new gitlab:users:clear_all_authentication_tokens task ## What are the relevant issue numbers? Part of #22537. See merge request !6745
| * | Add a new gitlab:users:clear_all_authentication_tokens taskRémy Coutable2016-10-111-0/+38
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'precalculate-trending-projects' into 'master' Robert Speicher2016-10-114-70/+71
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Precalculate trending projects ## What does this MR do? This MR changes the trending projects code so that data is precalculated, removing the need for any complex caching mechanisms. ## Why was this MR needed? Caching of trending data didn't work properly, still leading to queries. Using caching in general would be very hard due to users being able to apply custom filters to the list of trending projects. See merge request !6749
| * | | Precalculate trending projectsprecalculate-trending-projectsYorick Peterse2016-10-104-70/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a Sidekiq worker that precalculates the list of trending projects on a daily basis. The resulting set is stored in a database table that is then queried by Project.trending. This setup means that Unicorn workers no longer _may_ have to calculate the list of trending projects. Furthermore it supports filtering without any complex caching mechanisms. The data in the "trending_projects" table is inserted in the same order as the project ranking. This means that getting the projects in the correct order is simply a matter of: SELECT projects.* FROM projects INNER JOIN trending_projects ON trending_projects.project_id = projects.id ORDER BY trending_projects.id ASC; Such a query will only take a few milliseconds at most (as measured on GitLab.com), opposed to a few seconds for the query used for calculating the project ranks. The migration in this commit does not require downtime and takes care of populating an initial list of trending projects.
* | | | Merge branch 'empty-mrs' into 'master' Rémy Coutable2016-10-111-2/+18
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | Allows empty merge requests for a workflow described in gitlab-org/gitlab-ce#14606 Closes gitlab-org/gitlab-ce#14606 See merge request !6384
| * | | Allow empty merge requestsArtem Sidorenko2016-10-111-2/+18
| | | |
* | | | Merge branch 'dz-cleanup-routing' into 'master' Dmitriy Zaporozhets2016-10-115-140/+42
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove NamespacesController * removes unnecessary NamespacesController. The main purpose of this controller was redirect to group or user page when URL like https://gitlab.com/gitlab-org was used. Now this functionality is handled by constrainers (like this https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/routes/user.rb#L17-21) and take user to correct controller right from the start. * serve non existing API routes like `/api/v3/whatever` with Grape instead of Rails. Before this change wrong API url was served by rails with not obvious 404, 405 & 500 errors See merge request !6733
| * | | Fix api users spec for post request with invalid idDmitriy Zaporozhets2016-10-101-4/+4
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | Replace undefined Grape routing code from 400 to 404Dmitriy Zaporozhets2016-10-102-26/+28
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | Fix API specs behaviour for invalid routingDmitriy Zaporozhets2016-10-102-20/+37
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | Catch any undefined API routing and return 400 Bad RequestDmitriy Zaporozhets2016-10-102-3/+5
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | Update git over http test to match new routingDmitriy Zaporozhets2016-10-101-3/+2
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | Remove NamespacesControllerDmitriy Zaporozhets2016-10-101-118/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The main purpose of this controller was redirect to group or user page when URL like https://gitlab.com/gitlab-org was used. Now this functionality is handled by contrainers and take user to correct controller right from the start Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | Merge branch 'fix-misnamed-constant' into 'master' Robert Speicher2016-10-101-1/+1
|\ \ \ | | | | | | | | | | | | | | | | Rename HTMLEntityFilter to HtmlEntityFilter to fix autoloading See merge request !6776
| * | | HTMLEntityFilter -> HtmlEntityFilterNick Thomas2016-10-101-1/+1
| | | |
* | | | Merge branch 'use-let-in-tests' into 'master' Stan Hu2016-10-101-1/+0
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use user from let instead recreate in before ## What does this MR do? It`s minor fix in tests. We can use factory from let instead recreate user before each test. ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? ## Screenshots (if relevant) No ## Does this MR meet the acceptance criteria? - [ ] [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 - [ ] 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) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !6762
| * | | Use user from let instead recreate in beforeSemyon Pupkov2016-10-091-1/+0
| | | |
* | | | Merge branch 'fix/async-pipeline-processing-stale-data' into 'master' Kamil Trzciński2016-10-101-5/+19
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix ci pipeline processing with async jobs ## What does this MR do? This MR fixes CI pipeline processing with asynchronous jobs called from `around_transition` provided by state machine. For details see https://github.com/pluginaweek/state_machine/issues/191 and commit f68acba. ## Why was this MR needed? Recently merged https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6650 introduced problem with asynchronous job being deployed when `around_transition` still held transaction, which caused race condition that prevented pipeline status to change in a proper way. ## What are the relevant issue numbers? Closes #23111 See merge request !6736
| * | | | Improve spec for merge when build succeeds featureGrzegorz Bizon2016-10-081-5/+19
| | | | |
* | | | | Merge branch 'namespace-validation-fixes' into 'master' Sean McGivern2016-10-102-1/+32
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct namespace validation to forbid bad names #21077 ## What does this MR do? Updates master namespace regex to forbid any namespace ending in `.git` or `.atom` and corrects and adds relevant tests ## Are there points in the code the reviewer needs to double check? I think it's all good. I could use help with the creation of tests for usernames with trailing `.atom` or `.git` as the testing framework is a bit over my head. ## Why was this MR needed? A group that ends in `.atom` will cause the relevent dashboard to crash if the user (ANY user, not just the creator) has visibility of the group until it is deleted through the admin panel (it cannot be renamed, the edit page will crash. It may be fixable through the API, that wasn't checked.) This allows a malicious user with group creation privileges to bulk add users to a group, rename the group to a bad name, and crash the groups dashboard for all members of the group. The same applies if the group is internal or public and users navigate to the explore tab of the groups dashboard. The same applies to usernames ending in `.atom`. In many places of the code, it implies that `.git` in not allowed at the end of namespaces, but many allowed it anyway. This MR forbids it everywhere to prevent potential issues (like the one with `.atom` going forward). ## What are the relevant issue numbers? Group path validation incomplete, crashes groups dashboard #21077 ## 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 [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [X] Branch has no merge conflicts with `master` (if you do - rebase it please) - [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5994
| * | | | Correct namespace validation to forbid bad names #21077Will Starms2016-10-072-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds .git and .atom to the master namespace regex Updates existing group tests and adds two new ones Updates path cleaning to also forbid .atom
* | | | | Merge branch 'adam-commit-search-case-insensitive' into 'master' Sean McGivern2016-10-101-5/+13
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make searching for commits case insensitive. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry 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 you do - 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? Fixes #21800 See merge request !6715
| * | | | | Make searching for commits case insensitive.Adam Niedzielski2016-10-101-5/+13
| | |_|/ / | |/| | | | | | | | | | | | | Fixes #21800.
* | | | | Merge branch 'tests-use-tmpfs' into 'master' Yorick Peterse2016-10-101-0/+5
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Try tmpfs for repository storage, etc See merge request !6730
| * | | | | Try tmpfs for repository storage, etcNick Thomas2016-10-061-0/+5
| | | | | |
* | | | | | Merge branch '22373-reduce-queries-in-api-helpers-find_project' into 'master' Yorick Peterse2016-10-101-16/+131
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | Improve project policy specs See merge request !6442
| * | | | | Improve project policy specAlejandro Rodríguez2016-10-061-16/+131
| | | | | |
* | | | | | Prevent conflict b/w search field and its dropdownBrennan Roberts2016-10-101-1/+20
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop the global search form's default "action" from fighting with dropdown items when using the keyboard to navigate the dropdown. `e.preventDefault()` is now called on the enter key when a dropdown item is already selected. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | Use Hash rocket syntax to maintain Ruby 2.1 compatibility in specStan Hu2016-10-081-1/+1
| |_|/ / |/| | |
* | | | Merge branch '23096-expire-artifacts-per-job' into 'master' Yorick Peterse2016-10-072-37/+83
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job… See merge request !6732
| * | | | ExpireBuildArtifactsWorker query builds table without ordering enqueuing one ↵23096-expire-artifacts-per-jobPaco Guzman2016-10-072-37/+83
| | | | | | | | | | | | | | | | | | | | | | | | | job per build to cleanup We use Sidekiq::Client.push_bulk to avoid Redis round trips
* | | | | Merge branch '22774-retouch-environments-deployments' into 'master' Jacob Schatz2016-10-071-0/+28
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve "Retouch environments list and deployments list" ## What does this MR do? #### Environments List - Fixes deployment ID - Removes bold styling from deployment ID - Changes Las Deployment Column to have '#ID by user' - Adds build column with link to the build - Adds external url to where the environment is hosted #### Environment Details - Add link to the build column and changes content to show "build (#id) by user" - Adds external link to the review app Adds tests ## Screenshots (if relevant) #### Environments List ![env_list](/uploads/6cfd737bb0d2f2853a610479877de5a3/env_list.png) #### Environments Details ![env_details](/uploads/70ec59d7d7de5c1ef57132c2ec9c1b8f/env_details.png) ## 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 - [ ] All builds are passing - [ ] 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 you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #22774 See merge request !6691
| * | | | | Deletes extra empty line breaking the buildFilipa Lacerda2016-10-071-1/+0
| | | | | |
| * | | | | Updates test in order to look for link22774-retouch-environments-deploymentsFilipa Lacerda2016-10-071-2/+3
| | | | | |
| * | | | | Adds test for external link in environment detailsFilipa Lacerda2016-10-061-0/+10
| | | | | |
| * | | | | Fixes external_url linkFilipa Lacerda2016-10-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds tests for: - external_url link in environmnets list - must show deployment internal id in environments list - must show build name and id in environments list
* | | | | | Merge branch 'rs-optimize-award_user_list-spec' into 'master' Rémy Coutable2016-10-071-13/+23
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize the `award_user_list` helper spec According to https://gitlab.com/gitlab-org/gitlab-ce/issues/23034#note_16586657, each test for this helper generated 1,833 queries. Now we only generate stubbed records, and only as many as we need for each test. This also corrects a slight logic bug in the helper itself. When the number of awards was greater than the limit (9 by default), _and_ the current user was one of them, we actually included 10 names, including "You", plus the remaining count. Now we return the correct number regardless. See merge request !6722
| * | | | | | Optimize the `award_user_list` helper specRobert Speicher2016-10-071-13/+23
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to https://gitlab.com/gitlab-org/gitlab-ce/issues/23034#note_16586657, each test for this helper generated 1,833 queries. Now we only generate stubbed records, and only as many as we need for each test. This also corrects a slight logic bug in the helper itself. When the number of awards was greater than the limit (9 by default), _and_ the current user was one of them, we actually included 10 names, including "You", plus the remaining count. Now we return the correct number regardless.
* | | | | | Merge branch 'sh-fix-events-update-spec' into 'master' Yorick Peterse2016-10-071-1/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Event#reset_project_activity updates See merge request !6729
| * | | | | | Fix Event#reset_project_activity updatessh-fix-events-update-specStan Hu2016-10-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | !6678 removed the lease from Event#reset_project_activity, but it wasn't actually updating the project's last_activity_at timestamp properly. The WHERE clause would always return no matching projects. The spec passed occasionally because the created_at timestamp was automatically set to last_activity_at.
* | | | | | | Merge branch 'memoize_shell_secret_token' into 'master' Rémy Coutable2016-10-071-3/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memoize Github::Shell's secret token ## What does this MR do? `API::Helpers#secret_token` was reading the secret file on every invocation. This MR reads the file in the `gitlab_shell_secret_token.rb` initializer and saves it as a class variable at `Gitlab::Shell.secret_token` ## Are there points in the code the reviewer needs to double check? - I'm not sure if the use of `cattr_accessor` is the best approach, or if should be moved into the `class << self` block? - Should `API::Helpers#secret_token` be removed in favor of using `Gitlab::Shell.secret_token`? ## Why was this MR needed? Performance optimization. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/22510 See merge request !6599
| * | | | | | | Call ensure_secret_token! in secret token test's before block since it would ↵Justin DiPierro2016-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be called in an initializer.
| * | | | | | | Load Github::Shell's secret token from file on initialization instead of ↵Justin DiPierro2016-10-061-3/+5
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | every request.
* | | | | | | Merge branch 'ben.boeckel/gitlab-ce-api-visible-projects' into 'master' Rémy Coutable2016-10-071-0/+30
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add visible projects API ## What does this MR do? Add a new `/projects/visible` API endpoint. Originally created by @ben.boeckel in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5970. ## Are there points in the code the reviewer needs to double check? Does the API make sense? ## Why was this MR needed? The `/projects` endpoint only returned projects the user was explicitly a member of. Closes #19361, #3119. See merge request !6681
| * | | | | | Update API docs and specs for /projects/visibleSean McGivern2016-10-041-2/+21
| | | | | | |