diff options
author | James Lopez <james@jameslopez.es> | 2017-02-17 16:56:13 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-03-01 14:02:02 +0300 |
commit | a0101ebf84ed397899df8f3a017d2b25dc45db57 (patch) | |
tree | 0f41c1773ff4c04260ea3fcf63bd09f56e33a783 /app/services | |
parent | c8f981964af6b32b9166b91cfc211b41150c6add (diff) |
Update occurrences of MWBS to MWPS
Rename column in the database
Rename fields related to import/export feature
Rename API endpoints
Rename documentation links
Rename the rest of occurrences in the code
Replace the images that contain the words "build succeeds" and docs referencing to them
Make sure pipeline is green and nothing is missing.
updated doc images
renamed only_allow_merge_if_build_succeeds in projects and fixed references
more updates
fix some spec failures
fix rubocop offences
fix v3 api spec
fix MR specs
fixed issues with partials
fix MR spec
fix alignment
add missing v3 to v4 doc
wip - refactor v3 endpoints
fix specs
fix a few typos
fix project specs
copy entities fully to V3
fix entity error
more fixes
fix failing specs
fixed missing entities in V3 API
remove comment
updated code based on feedback
typo
fix spec
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/merge_when_pipeline_succeeds_service.rb | 18 | ||||
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 6 | ||||
-rw-r--r-- | app/services/notification_service.rb | 2 | ||||
-rw-r--r-- | app/services/slash_commands/interpret_service.rb | 2 | ||||
-rw-r--r-- | app/services/system_note_service.rb | 4 | ||||
-rw-r--r-- | app/services/todo_service.rb | 6 |
6 files changed, 19 insertions, 19 deletions
diff --git a/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb b/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb index 5081dd5a0c4..aed5287940e 100644 --- a/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb +++ b/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb @@ -1,18 +1,18 @@ module MergeRequests class MergeWhenPipelineSucceedsService < MergeRequests::BaseService - # Marks the passed `merge_request` to be merged when the build succeeds or + # Marks the passed `merge_request` to be merged when the pipeline succeeds or # updates the params for the automatic merge def execute(merge_request) merge_request.merge_params.merge!(params) # The service is also called when the merge params are updated. - already_approved = merge_request.merge_when_build_succeeds? + already_approved = merge_request.merge_when_pipeline_succeeds? unless already_approved - merge_request.merge_when_build_succeeds = true - merge_request.merge_user = @current_user + merge_request.merge_when_pipeline_succeeds = true + merge_request.merge_user = @current_user - SystemNoteService.merge_when_build_succeeds(merge_request, @project, @current_user, merge_request.diff_head_commit) + SystemNoteService.merge_when_pipeline_succeeds(merge_request, @project, @current_user, merge_request.diff_head_commit) end merge_request.save @@ -23,7 +23,7 @@ module MergeRequests return unless pipeline.success? pipeline_merge_requests(pipeline) do |merge_request| - next unless merge_request.merge_when_build_succeeds? + next unless merge_request.merge_when_pipeline_succeeds? unless merge_request.mergeable? todo_service.merge_request_became_unmergeable(merge_request) @@ -36,9 +36,9 @@ module MergeRequests # Cancels the automatic merge def cancel(merge_request) - if merge_request.merge_when_build_succeeds? && merge_request.open? - merge_request.reset_merge_when_build_succeeds - SystemNoteService.cancel_merge_when_build_succeeds(merge_request, @project, @current_user) + if merge_request.merge_when_pipeline_succeeds? && merge_request.open? + merge_request.reset_merge_when_pipeline_succeeds + SystemNoteService.cancel_merge_when_pipeline_succeeds(merge_request, @project, @current_user) success else diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index 581d18032e6..1131d6f4913 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -11,7 +11,7 @@ module MergeRequests # empty diff during a manual merge close_merge_requests reload_merge_requests - reset_merge_when_build_succeeds + reset_merge_when_pipeline_succeeds mark_pending_todos_done cache_merge_requests_closing_issues @@ -78,8 +78,8 @@ module MergeRequests end end - def reset_merge_when_build_succeeds - merge_requests_for_source_branch.each(&:reset_merge_when_build_succeeds) + def reset_merge_when_pipeline_succeeds + merge_requests_for_source_branch.each(&:reset_merge_when_pipeline_succeeds) end def mark_pending_todos_done diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 3734e3c4253..fbad85d310e 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -135,7 +135,7 @@ class NotificationService merge_request.target_project, current_user, :merged_merge_request_email, - skip_current_user: !merge_request.merge_when_build_succeeds? + skip_current_user: !merge_request.merge_when_pipeline_succeeds? ) end diff --git a/app/services/slash_commands/interpret_service.rb b/app/services/slash_commands/interpret_service.rb index 3e0a85cf059..33a94d9731e 100644 --- a/app/services/slash_commands/interpret_service.rb +++ b/app/services/slash_commands/interpret_service.rb @@ -59,7 +59,7 @@ module SlashCommands @updates[:state_event] = 'reopen' end - desc 'Merge (when build succeeds)' + desc 'Merge (when the pipeline succeeds)' condition do last_diff_sha = params && params[:merge_request_diff_head_sha] issuable.is_a?(MergeRequest) && diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 55b548a12f9..db6a092d8fc 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -187,14 +187,14 @@ module SystemNoteService end # Called when 'merge when pipeline succeeds' is executed - def merge_when_build_succeeds(noteable, project, author, last_commit) + def merge_when_pipeline_succeeds(noteable, project, author, last_commit) body = "enabled an automatic merge when the pipeline for #{last_commit.to_reference(project)} succeeds" create_note(noteable: noteable, project: project, author: author, note: body) end # Called when 'merge when pipeline succeeds' is canceled - def cancel_merge_when_build_succeeds(noteable, project, author) + def cancel_merge_when_pipeline_succeeds(noteable, project, author) body = 'canceled the automatic merge' create_note(noteable: noteable, project: project, author: author, note: body) diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index ad86b4f9f42..8787a1c93a9 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -103,7 +103,7 @@ class TodoService # def merge_request_build_failed(merge_request) create_build_failed_todo(merge_request, merge_request.author) - create_build_failed_todo(merge_request, merge_request.merge_user) if merge_request.merge_when_build_succeeds? + create_build_failed_todo(merge_request, merge_request.merge_user) if merge_request.merge_when_pipeline_succeeds? end # When a new commit is pushed to a merge request we should: @@ -121,7 +121,7 @@ class TodoService # def merge_request_build_retried(merge_request) mark_pending_todos_as_done(merge_request, merge_request.author) - mark_pending_todos_as_done(merge_request, merge_request.merge_user) if merge_request.merge_when_build_succeeds? + mark_pending_todos_as_done(merge_request, merge_request.merge_user) if merge_request.merge_when_pipeline_succeeds? end # When a merge request could not be automatically merged due to its unmergeable state we should: @@ -129,7 +129,7 @@ class TodoService # * create a todo for a merge_user # def merge_request_became_unmergeable(merge_request) - create_unmergeable_todo(merge_request, merge_request.merge_user) if merge_request.merge_when_build_succeeds? + create_unmergeable_todo(merge_request, merge_request.merge_user) if merge_request.merge_when_pipeline_succeeds? end # When create a note we should: |