summaryrefslogtreecommitdiff
path: root/spec/services
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'mahcsig/gitlab-ce-17350-multi-file-commit'Rémy Coutable2016-10-061-2/+2
|\ | | | | | | See !6096.
| * multi-file commitMarc Siegfriedt2016-10-051-2/+2
| | | | | | | | | | | | add docs and tests - add additional validation allow move without content updated response
* | Merge commit 'dev/security' into 'master'Rémy Coutable2016-10-062-3/+24
|\ \ | |/ |/| | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * Enforce the fork_project permission in Projects::CreateServiceNick Thomas2016-09-272-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | Projects::ForkService delegates to this service almost entirely, but needed one small change so it would propagate create errors correctly. CreateService#execute needs significant refactoring; it is now right at the complexity limit set by Rubocop. I avoided doing so in this commit to keep the diff as small as possible. Several tests depend on the insecure behaviour of ForkService, so fi them up at the same time.
* | Merge branch 'all-skipped-equals-success' into 'master' Rémy Coutable2016-10-051-19/+82
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Skipped jobs should be considered successful ## What does this MR do? If all jobs in previous stage are all skipped, the next stage should consider previous stage succeeded. ## Why was this MR needed? Since for now we consider all manual jobs if skipped, should not block the next stage from running. Closes #22598 See also #20342 (because this merge request conflicts with it) See merge request !6604
| * \ Merge remote-tracking branch 'upstream/master' into all-skipped-equals-successLin Jen-Shin2016-10-044-39/+116
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (55 commits) Restrict failed login attempts for users with 2FA Update RuboCop to 0.43.0 and update configuration Use SELECT 1, instead SELECT COUNT(*) to ask for notes existency Simplify Mentionable concern instance methods Fix issues importing services via Import/Export deployment refs in own folder, new method for creating refs Update method name Save a fetchable ref per deployement GrapeDSL for Namespace endpoint Remove SCSS rules for short hex chars. Fix bug when trying to cache closed issues from external issue trackers Upgrade acts-as-taggable-on from 3.5.0 to 4.0.0. Remove useless code now that Member#add_user handles it Combine requestFileSuccess arguments into `opts` Append issue template to existing description Invert method's naming Fix a few things after the initial improvment to Members::DestroyService Improve Members::DestroyService Add Container Registry on/off status to admin area Enable Lint/StringConversionInInterpolation cop and autocorrect offenses ...
| * \ \ Merge branch 'master' into all-skipped-equals-successLin Jen-Shin2016-10-036-6/+134
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (103 commits) Fixes sidebar navigation. Convert "SSH Keys" Spinach features to RSpec Enable import/export back for non-admins Update gitlab-shell to 3.6.3 Updated artwork of empty group state. Better empty state for Groups view. Members::RequestAccessService is tricter on permissions Add a /wip slash command Link to the "What requires downtime?" page from the Migration Style Guide Fix RuboCop failure in app/services/notification_service.rb Add word-wrap to issue title on issue and milestone boards Fix page scrolling to top on sidebar toggle Changed zero padded days to no padded days in date_format GrapeDSL for Keys endpoint Remove duplicate test Add a spec to verify comparison context inclusion in path when a version is chosen to compare against Add flash containers and broadcast messages below subnav Add white background to create MR banner Move create MR banner below subnav Remove contianer from last push widget ...
| * | | | Add a test for on_failure jobs in the middleLin Jen-Shin2016-10-011-1/+18
| | | | |
| * | | | Should use eq because we want ordersLin Jen-Shin2016-10-011-6/+3
| | | | |
| * | | | We consider skipped = success, fixes #22598Lin Jen-Shin2016-09-301-0/+49
| | | | |
| * | | | Less confusing nameLin Jen-Shin2016-09-301-19/+19
| | | | |
* | | | | Fix project deletion when feature visibility is set to privatesh-fix-project-deletion-private-visibilityStan Hu2016-10-041-1/+22
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects that are destroyed are put in the pending_delete state. The ProjectDestroyWorker checks whether the current user has access, but since the ProjectFeature class uses the default scope of the Project, it will not be able to find the right project. This was a regression in 8.12 that caused the following stack trace: ``` NoMethodError: undefined method `team' for nil:NilClass from app/models/project_feature.rb:62:in `get_permission' from app/models/project_feature.rb:34:in `feature_available?' from app/models/project.rb:21:in `feature_available?' from app/policies/project_policy.rb:170:in `disabled_features!' from app/policies/project_policy.rb:29:in `rules' from app/policies/base_policy.rb:82:in `block in abilities' from app/policies/base_policy.rb:113:in `collect_rules' from app/policies/base_policy.rb:82:in `abilities' from app/policies/base_policy.rb:50:in `abilities' from app/models/ability.rb:64:in `uncached_allowed' from app/models/ability.rb:58:in `allowed' from app/models/ability.rb:49:in `allowed?' from app/services/base_service.rb:11:in `can?' from lib/gitlab/metrics/instrumentation.rb:155:in `block in can?' from lib/gitlab/metrics/method_call.rb:23:in `measure' from lib/gitlab/metrics/instrumentation.rb:155:in `can?' from app/services/projects/destroy_service.rb:18:in `execute' ``` Closes #22948
* | | | Merge branch 'issue_22446' into 'master' Sean McGivern2016-10-041-0/+36
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bug when trying to cache closed issues from external issue trackers fixes #22446 See merge request !6619
| * | | | Fix bug when trying to cache closed issues from external issue trackersissue_22446Felipe Artur2016-10-031-0/+36
| | | | |
* | | | | Merge branch 'rc-improve-members-destroy-service' into 'master' Robert Speicher2016-10-041-37/+78
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | Improve `Members::DestroyService` Part of #21979. See merge request !6267
| * | | | Fix a few things after the initial improvment to Members::DestroyServiceRémy Coutable2016-10-031-0/+9
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | | Improve Members::DestroyServiceRémy Coutable2016-10-031-40/+72
| | |/ / | |/| | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | Enable Lint/StringConversionInInterpolation cop and autocorrect offensesrs-string-conversion-in-interpolationRobert Speicher2016-10-032-2/+2
|/ / /
* | | Add a /wip slash commandThomas Balthazar2016-10-031-0/+27
| | | | | | | | | | | | It toggles the 'WIP' prefix in the MR title.
* | | Merge branch '22773-add-comparison-link-to-system-note' into 'master' Dmitriy Zaporozhets2016-10-031-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add link to comparison from system note, update changelog ## What does this MR do? Adds a link to the comparison between the previous and latest version. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? ## Screenshots (if relevant) ![Screen_Shot_2016-10-01_at_3.37.03_AM](/uploads/89b48dc1b2ed868cf5dd85300e6b37a0/Screen_Shot_2016-10-01_at_3.37.03_AM.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 - [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? Closes #22773 See merge request !6607
| * | | Refactor url_helpers for system note service and remove duplication of logic ↵Matthew Dodds2016-09-301-13/+5
| | | | | | | | | | | | | | | | in spec
| * | | Add link to comparison from system note, update changelogMatthew Dodds2016-09-291-3/+17
| | | |
* | | | Merge branch ↵Robert Speicher2016-10-021-0/+14
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'jimmykarily/gitlab-ce-notify_current_user_when_merging_an_mr_after_build_succeeds' into 'master' Notify current_user about automatic merge after successful build It enables notifications to the initiator of a merge when the MR is flagged as "Merge when build succeeds". Because when running Builds, quite some time passes between the user's action and the actual Merge so it is a good thing to notify the initiator of the Merge when it actually happens. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14409 See merge request !6534
| * | | | Notify current_user about automatic merge after successful buildDimitris Karakasilis2016-09-291-0/+14
| |/ / / | | | | | | | | | | | | Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/14409
* | | | Merge branch 'rc-new-members-request-access-service' into 'master' Robert Speicher2016-10-021-0/+57
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New `Members::RequestAccessService` Part of #21979. See merge request !6265
| * | | | New Members::RequestAccessServiceRémy Coutable2016-09-221-0/+57
| | |_|/ | |/| | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | Close todos when accepting a MR via the API.Tony Gambone2016-09-292-6/+30
| |_|/ |/| |
* | | fix broken repo 500 errors in UI and added relevant specsJames Lopez2016-09-291-0/+10
| |/ |/|
* | Fix permission for setting an issue's due dateRémy Coutable2016-09-283-51/+153
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'rc-new-members-approve-request-access-service' into 'master' Douwe Maan2016-09-271-0/+96
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New `Members::ApproveAccessRequestService` Part of #21979. ## Does this MR meet the acceptance criteria? - [x] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] 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 !6266
| * | Ensure Members::ApproveAccessRequestService can fin a requester by IDRémy Coutable2016-09-221-0/+8
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | New Members::ApproveAccessRequestServiceRémy Coutable2016-09-221-0/+88
| |/ | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Improve project_with_board factory to create the default listsimprovement/project-with-board-factoryDouglas Barbosa Alexandre2016-09-265-16/+12
|/
* Merge branch '21170-cycle-analytics' into 'master' Stan Hu2016-09-216-0/+236
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cycle Analytics: first iteration ## What does this MR do? - Implement the first iteration of the "Cycle Analytics" feature. ## What are the relevant issue numbers? - Closes #21170 ## Screenshots ![cycle_analytics_screencast.gif](/uploads/d23c3c912caa6935fd47b53ca3a56b97/cycle_analytics.gif) ## Backend Tasks - [x] Implementation - [x] Phases - [x] Issue (Tracker) - [x] Plan (Board) - [x] Code (IDE) - [x] Test (CI) - [x] Review (MR) - [x] Staging (CD) - [x] Production (Total) - [x] Make heuristics more modular - [x] Scope to project - [x] Date range (30 days, 90 days) - [x] Access restriction - [x] Test - [x] Find a better way to test these phases - [x] Phases - [x] Issue (Tracker) - [x] Plan (Board) - [x] Code (IDE) - [x] Test (CI) - [x] Review (MR) - [x] Staging (CD) - [x] Production (Total) - [x] Test for "end case happens before start case" - [x] Consolidate helper - [x] Miniboss review - [x] Performance testing with mock data - [x] Improve performance - [x] Pre-calculate "merge requests closing issues - [x] Pre-calculate everything else - [x] Test performance against 10k issues - [x] Test all pre-calculation code - [x] Ci::Pipeline -> build start/finish - [x] Ci::Pipeline#merge_requests - [x] Issue -> record default metrics after save - [x] MergeRequest -> record default metrics after save - [x] Deployment -> Update "first_deployed_to_production_at" for MR metrics - [x] Git Push -> Update "first commit mention" for issue metrics - [x] Merge request create/update/refresh -> Update "merge requests closing issues" - [x] Remove `MergeRequestsClosingIssues` when necessary - [x] Changes to unblock Fatih - [x] Add summary data - [x] `stats` should be array - [x] Let `stats` be `null` if all `stats` are null - [x] Indexes for "merge requests closing issues" - [x] Test summary data - [x] Scope everything to project - [x] Find out why tests were passing - [x] Filter should include issues/MRs which have made it to production within the range - [x] Don't create duplicate `MergeRequestsClosingIssues` - [x] Fix tests - [x] MySQL median - [x] Assign to Douwe for review - [x] Fix conflicts - [x] Implement suggestions from Yorick's review - [x] Test on PG - [x] Test on MySQL - [x] Refactor - [x] Cleanup - [x] What happens if we have no data at all? - [x] Extract common queries to methods / scopes - [x] Remove unused queries - [x] Downtime for foreign key migrations - [x] Find a way around "if issue.metrics.present?" all over the place - [x] Find a way around "if merge_request.metrics.present?" all over the place - [x] Test migrations on a fresh database - [x] MySQL - [x] Pg - [x] Access issues - While the project is public and the visibility is set to "Everyone with access", you cannot visit the cycle analytics page when signed out. - [x] CHANGELOG - [x] Implement suggestions from Douwe's review - [x] First set of comments - [x] Second set of comments - [x] Third set of comments - [x] Fourth set of comments - [x] Make sure build is green - [ ] Make issue for "polish" - [ ] EE MR See merge request !5986
| * Fix `CreateDeploymentService` spec.Timothy Andrew2016-09-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 1. The spec tests that if: - The merge request is merged - The target branch is deployed to production - The `first_deployed_to_production_at` metric is `nil` (for some reason) - The target branch is deployed to production again - The `first_deployed_to_production_at` metric stays as `nil` (and is not overwritten). 2. Failure only on MySQL due to some datetime weirdness.
| * Reload issues in spec to ensure label<->issue mapping properly loaded21170-cycle-analyticsStan Hu2016-09-201-0/+2
| |
| * Fix build.Timothy Andrew2016-09-212-5/+5
| |
| * Add a spec for merge request metric caching while refreshing a merge request ↵Timothy Andrew2016-09-213-11/+37
| | | | | | | | from a forked project.
| * Use the `IssuableBaseService` lifecycle hooks to cache ↵Timothy Andrew2016-09-213-5/+5
| | | | | | | | | | | | | | `MergeRequestsClosingIssues` - Instead of overriding `create` and `update` in `MergeRequests::BaseService` - Get all merge request service specs passing
| * Implement a second round of review comments from @DouweM.Timothy Andrew2016-09-213-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't use `TableReferences` - using `.arel_table` is shorter! - Move some database-related code to `Gitlab::Database` - Remove the `MergeRequest#issues_closed` and `Issue#closed_by_merge_requests` associations. They were either shadowing or were too similar to existing methods. They are not being used anywhere, so it's better to remove them to reduce confusion. - Use Rails 3-style validations - Index for `MergeRequest::Metrics#first_deployed_to_production_at` - Only include `CycleAnalyticsHelpers::TestGeneration` for specs that need it. - Other minor refactorings.
| * Fix rubocop spec.Timothy Andrew2016-09-201-1/+1
| | | | | | | | And `scss_lint`
| * Fix spec failures.Timothy Andrew2016-09-202-4/+4
| |
| * Merge remote-tracking branch 'origin/master' into 21170-cycle-analyticsTimothy Andrew2016-09-207-34/+166
| |\
| * | Test all cycle analytics pre-calculation code.Timothy Andrew2016-09-195-0/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the code that pre-calculates metrics for use in the cycle analytics page. - Ci::Pipeline -> build start/finish - Ci::Pipeline#merge_requests - Issue -> record default metrics after save - MergeRequest -> record default metrics after save - Deployment -> Update "first_deployed_to_production_at" for MR metrics - Git Push -> Update "first commit mention" for issue metrics - Merge request create/update/refresh -> Update "merge requests closing issues"
* | | Ensure we have a user before checking for their permission in ↵Rémy Coutable2016-09-201-0/+69
| |/ |/| | | | | | | | | Notes::SlashCommandsService Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'sh-prevent-duplicate-protected-branches-on-push' into 'master' Rémy Coutable2016-09-191-0/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Only create a protected branch upon a push to a new branch if a rule for that branch doesn't exist A customer ran into an issue where a Sidekiq task retried over and over, leading to duplicate master branches in their protected branch list. Closes #22177 See merge request !6399
| * | Only create a protected branch upon a push to a new branch if a rule for ↵sh-prevent-duplicate-protected-branches-on-pushStan Hu2016-09-171-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | that branch doesn't exist A customer ran into an issue where a Sidekiq task retried over and over, leading to duplicate master branches in their protected branch list. Closes #22177
* | | Merge branch 'master' into per-build-tokenKamil Trzcinski2016-09-193-3/+67
|\ \ \
| * \ \ Merge branch 'review-apps' into 'master' Rémy Coutable2016-09-191-3/+40
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for dynamic environments Implements proposal described in https://gitlab.com/gitlab-org/gitlab-ce/issues/21971. Specifically: - it adds a `.gitlab-ci.yml` configuration, - it allows environment name to have slashes, - it allows environment names to use CI predefined variables, - it allows to specify URL from `.gitlab-ci.yml`, - it allows the URL to use CI predefined variables, - it introduces `environment_type` to allow to easily group environments in the future See merge request !6323
| | * | | Fix specs failuresreview-appsKamil Trzcinski2016-09-191-1/+1
| | | | |