summaryrefslogtreecommitdiff
path: root/spec/models
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into 'dz-remove-namespaces-path-uniq'Dmitriy Zaporozhets2016-12-148-35/+137
|\ | | | | | | | | | | Merge Request - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8013 # Conflicts: # db/schema.rb
| * Merge branch 'build-statuses' into 'master' Rémy Coutable2016-12-145-19/+121
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detailed build statuses ## What does this MR do? Implements detailed statuses for `Ci::Builds` and `CommitStatus`. It also adds a new icon for manual build. ## Screenshots ![manual_builds_icon](/uploads/22b5c594350856c85398ef705a635f8b/manual_builds_icon.png) ## What are the relevant issue numbers? See #24273, closes #22642 See merge request !7989
| | * Add some missing tests for detailed status methodsbuild-statusesGrzegorz Bizon2016-12-143-2/+32
| | |
| | * Add missing tests for build `cancelable?` methodGrzegorz Bizon2016-12-131-0/+36
| | |
| | * Make it possible to retry build that was canceledGrzegorz Bizon2016-12-131-0/+8
| | |
| | * Make build retryable only if complete and executedGrzegorz Bizon2016-12-131-8/+30
| | |
| | * Fix detailed status specs for pipeline stage modelGrzegorz Bizon2016-12-121-1/+3
| | |
| | * Fix pipeline specs for detailed statusesGrzegorz Bizon2016-12-121-8/+12
| | | | | | | | | | | | [ci skip]
| * | Merge branch '25482-fix-api-sudo' into 'master' Sean McGivern2016-12-131-11/+0
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | API: Memoize the current_user so that the sudo can work properly Closes #25482 See merge request !8017
| | * | Be smarter when finding a sudoed user in API::Helpers25482-fix-api-sudoRémy Coutable2016-12-131-11/+0
| | |/ | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | Rename Routable.where_paths_in to Routable.where_full_path_indz-nested-group-improvements-2Dmitriy Zaporozhets2016-12-111-5/+5
| | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | Create nested group factoryDmitriy Zaporozhets2016-12-111-0/+7
| | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | Validate presence of route by Routable concernDmitriy Zaporozhets2016-12-111-0/+4
| |/ | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Modify namespace name and path validationdz-remove-namespaces-path-uniqDmitriy Zaporozhets2016-12-122-7/+2
|/ | | | | | | | | | | Currently namespace name and path have uniq validaiton which does not allow us to use same group name/path inside different groups. This commit changes validation in next way: * Allow same namespace name with different parent_id * Allow same namespace path. Uniq validation should be handled by routes table Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branch 'dz-nested-groups' into 'master' Douwe Maan2016-12-094-62/+104
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-084-62/+104
| | | | | | | | | | | | | | | | * 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 'jej-23867-use-mr-finder-instead-of-access-check' into 'security'Douwe Maan2016-12-082-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MR access checks with use of MergeRequestsFinder Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867 :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 - [x] :bomb: app/finders/notes_finder.rb:17 - [x] :warning: app/views/layouts/nav/_project.html.haml:80 [`.count`] - [x] :bomb: app/controllers/concerns/creates_commit.rb:84 - [x] :traffic_light: app/controllers/projects/commits_controller.rb:24 - [x] :traffic_light: app/controllers/projects/compare_controller.rb:56 - [x] :vertical_traffic_light: app/controllers/projects/discussions_controller.rb:29 - [x] :white_check_mark: app/controllers/projects/todos_controller.rb:27 - [x] :vertical_traffic_light: app/models/commit.rb:268 - [x] :white_check_mark: lib/gitlab/search_results.rb:71 - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_267_266 Memoize ` merged_merge_request(current_user)` - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_248_247 Expected side effect for `merged_merge_request!`, consider `skip_authorization: true`. - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_269_269 Scary use of unchecked `merged_merge_request?` See merge request !2033
* | Merge branch 'pipeline-stage' into 'master' Rémy Coutable2016-12-084-54/+181
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refine pipeline stages ## What does this MR do? Introduces a concept of `Ci::Stage` to make it easier to have detailed statuses. ## Why was this MR needed? This is needed to simplify the handling of `Ci::Statuses` and make the `Stage` actual concept in code: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7889 See merge request !7927
| * | Added Ci::Stage specsKamil Trzcinski2016-12-062-0/+137
| | |
| * | Fix handling of allowed to failure jobsKamil Trzcinski2016-12-063-54/+44
| | |
* | | Merge branch 'fix-visible-content-spec-message' into 'master' Yorick Peterse2016-12-071-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Update outdated visible content spec descriptions This fixes some spec descriptions that were not fixed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7947. See merge request !7971
| * | | Update outdated visible content spec descriptionsfix-visible-content-spec-messageYorick Peterse2016-12-071-2/+2
| | |/ | |/|
* | | Merge branch '25209-improve-length-validators' into 'master' Rémy Coutable2016-12-078-14/+56
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 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-068-14/+56
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'remove-has-visible-content-caching' into 'master' Douwe Maan2016-12-071-29/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Remove caching of Repository#has_visible_content? This MR removes the caching of `Repository#has_visible_content?`. The cache for this method is no longer necessary and this should solve the problem described in https://gitlab.com/gitlab-org/gitlab-ce/issues/25278. See merge request !7947
| * | | Remove caching of Repository#has_visible_content?remove-has-visible-content-cachingYorick Peterse2016-12-061-29/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This method already uses the cached method Repository#branch_count so there's no point in also caching has_visible_content?. Fixes gitlab-org/gitlab-ce#25278
* | | | Merge branch '23589-open-issue-for-mr' into 'master' Sean McGivern2016-12-062-0/+49
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | Create an issue for all unresolved discussions in an MR See merge request !7180
| * | | Feature: delegate all open discussions to IssueBob Van Landuyt2016-12-052-0/+49
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a merge request can only be merged when all discussions are resolved. This feature allows to easily delegate those discussions to a new issue, while marking them as resolved in the merge request. The user is presented with a new issue, prepared with mentions of all unresolved discussions, including the first unresolved note of the discussion, time and link to the note. When the issue is created, the discussions in the merge request will get a system note directing the user to the newly created issue.
* | | Merge branch 'refine-ci-statuses' into 'master' Kamil Trzciński2016-12-061-0/+70
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refine CI Statuses ## What does this MR do? This MR introduces classes for each relevant CI status. ## What are the relevant issue numbers? Closes #24273 See merge request !7889
| * | | Expose pipeline detailed status using status factoryGrzegorz Bizon2016-12-051-0/+70
| | |/ | |/|
* | | Merge branch 'glm-shorthand-reference' into 'master' Sean McGivern2016-12-069-27/+137
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | GLM shorthand reference for projects from the same namespace Closes #21679 See merge request !7255
| * | Add shorthand support to gitlab markdown referencesOswaldo Ferreira2016-12-029-27/+137
| |/
* | Merge branch 'fix/rename-mwbs-to-merge-when-pipeline-succeeds' into 'master' Kamil Trzciński2016-12-051-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename MWBS service to Merge When Pipeline Succeeds ## What does this MR do? This MR renames Merge When Build Succeeds feature to Merge When Pipeline Succeeds, because we recently changed the behavior, see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6675. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] All builds are passing ## What are the relevant issue numbers? Closes #23354 See merge request !7135
| * \ Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeedsGrzegorz Bizon2016-11-3014-38/+116
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (110 commits) Rewrite an HTTP link to use HTTPS Edit /spec/features/profiles/preferences_spec.rb to match changes in 084d90ac Add blue back to sub nav active Remove JSX/React eslint plugins. Fix a transient spec failure Adds hoverstates for collapsed Issue/Merge Request sidebar Moved groups above projects Add StackProf to the Gemfile, along with a utility to get a profile for a spec Update Sidekiq-cron to fix compatibility issues with Sidekiq 4.2.1 Add a CHANGELOG entry Alert user when logged in user email is not the same as the invitation Expose timestamp in build entity used by serializer Rename `MergeRequest#pipeline` to `head_pipeline` Remove unnecessary database indexes CE-specific changes gitlab-org/gitlab-ee#1137 Fixing typo & Clarifying Key name fix started_at check fix blob controller spec failure - updated not to use file-path- fix blob controller spec failure Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security' ... Conflicts: app/controllers/projects/merge_requests_controller.rb lib/api/merge_requests.rb spec/requests/api/merge_requests_spec.rb
| * \ \ Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeedsGrzegorz Bizon2016-11-2515-294/+770
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (312 commits) Fix bad selection on dropdown menu for tags filter Fixed issue boards scrolling with a lot of lists & issues You can only assign default_branch when editing a project ... Don't convert data which already is the target type Stop supporting Google and Azure as backup strategies renames some of the specs and adds changelog entry Fixed dragging issue moving wrong issue after multiple drags of issue Fixed issue boards issue sorting when dragging issue into list Rephrase some system notes to be compatible with new system note style Add missing JIRA file that redirects to the new location Fix documentation to create the `pg_trm` extension before creating the DB Document that we always use `do...end` for `before` in RSpec Backport Note#commands_changes from EE Log mv_namespace parameters Add default_branch attr to Project API payload in docs. Fix title case to sentence case properly escape username validation error message flash Remove header ids from University docs Add missing documentation. Added test that checks the correct select box is there for the LFS ... ... Conflicts: app/services/system_note_service.rb spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb spec/services/system_note_service_spec.rb
| * | | | Update some docs to reflect MWPS name changeGrzegorz Bizon2016-11-211-1/+1
| | | | |
* | | | | Merge branch '24921-hide-prompt-to-add-ssh-key-if-ssh-protocol-is-disabled' ↵Sean McGivern2016-12-031-0/+17
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 'master' If SSH prototol is disabled don't say the user requires SSH keys Closes #24921 See merge request !7840
| * | | | Test all values for `enabled_git_access_protocol`Andrew Smith2016-12-021-9/+14
| | | | |
| * | | | If SSH prototol is disabled don't say the user requires SSH keysAndrew Smith2016-12-011-0/+12
| | | | |
* | | | | Merge branch 'process-commit-worker-improvements' into 'master' Douwe Maan2016-12-021-0/+17
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass commit data to ProcessCommitWorker This changes `ProcessCommitWorker` so that it takes a Hash containing commit data instead of a commit SHA. This means the worker doesn't have to access Git just to process a commit message (and other data it may use). This in turn should solve the problem of ending up with 15 000-something jobs in the `process_commit` queue that take forever to process. See merge request !7744
| * | | | | Pass commit data to ProcessCommitWorkerprocess-commit-worker-improvementsYorick Peterse2016-12-011-0/+17
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By passing commit data to this worker we remove the need for querying the Git repository for every job. This in turn reduces the time spent processing each job. The migration included migrates jobs from the old format to the new format. For this to work properly it requires downtime as otherwise workers may start producing errors until they're using a newer version of the worker code.
* | | | | Merge branch 'use-st-commits-where-possible' into 'master' Yorick Peterse2016-12-013-26/+45
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | Replace references to MergeRequestDiff#commits with st_commits when we care only about the number of commits See merge request !7668
| * | | | Replace references to MergeRequestDiff#commits with st_commitsuse-st-commits-where-possibleAdam Niedzielski2016-12-013-26/+45
| | |_|/ | |/| | | | | | | | | | | | | | | | | | when we care only about the number of commits We do not have to instantiate all objects in this case.
* | | | Merge branch 'rs-include-emailhelpers' into 'master' Rémy Coutable2016-12-012-0/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Only include EmailHelpers in mailer specs and specs using them See merge request !7836
| * | | | Only include EmailHelpers in mailer specs and specs using themrs-include-emailhelpersRobert Speicher2016-12-012-0/+4
| |/ / /
* | | | Refactor JiraService by moving code out of JiraService#execute methodclean-up-jira-serviceAdam Niedzielski2016-12-011-14/+26
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | The implicit interface of project services states that the "execute" method is meant to be called when project hooks are executed. Currently JiraService does not support any project events even though JiraService#supported_events says that "commit" and "merge_request" are supported. They are only used to render correct options in JIRA configuration screen, but they are not supported. Because of that, this commit makes "execute" method a no-op.
* | | Rename `MergeRequest#pipeline` to `head_pipeline`fix/rename-merge-request-head-pipelineGrzegorz Bizon2016-11-291-9/+9
| | |
* | | Merge branch 'hoopes/gitlab-ce-21027-add-diff-hunks-to-notification-emails' ↵Douwe Maan2016-11-291-0/+19
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 'master' Add diff hunks to notification emails Add diff hunks to notification emails. Continued from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5855 - thanks @hoopes! This also fixes an issue where the + / - prefixes were missing from diffs in emails. Screenshots (from my browser) of the HTML emails, along with text screenshots :stuck_out_tongue: ![image](/uploads/cb31400becf5149d40c8bb98a655aa93/image.png) ``` New comment for Merge Request !1 on app/views/admin/builds/index.html.haml: http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1023 > Finished This is a comment at the top of a match section. ``` ![image](/uploads/704dd3845797530697a27f5c1953c053/image.png) ``` New comment for Merge Request !1 on app/views/admin/builds/index.html.haml: http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1022 > Finished > %span.badge.js-running-count= @all_builds.finished.count(:id) > > - %li{class: ('active' if @scope == 'all')} > - = link_to admin_builds_path(scope: :all) do > - All > - %span.badge.js-totalbuilds-count= @all_builds.count(:id) > - > .gray-content-block > #{(@scope || 'running').capitalize} builds > This is a comment at the bottom of a match section. ``` ![image](/uploads/4063f3d9738aea8ebf3c0e690d0eddee/image.png) ``` New comment for Merge Request !1 on app/views/admin/builds/index.html.haml: http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1024 > = link_to 'Cancel all', cancel_all_admin_builds_path, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post > > %ul.center-top-menu > - %li{class: ('active' if @scope.nil?)} > + %li{class: ('active' if @scope == 'all')} > = link_to admin_builds_path do > + All This is a comment with some deleted and added lines above it. ``` Closes #21027, closes #24340. See merge request !7660
| * | | Fix spec styleSean McGivern2016-11-281-10/+4
| | | |
| * | | Add keyword arguments to truncated_diff methodhhoopes2016-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | * Added keyword arguments to truncated_diff_lines method to allow for using highlighting or not (html templates vs. text) * Tweaked templates for consistency and format appropriateness