Commit cac7e03f authored by Bob Van Landuyt's avatar Bob Van Landuyt

Rename `build_events` to `job_events` in code

parent 6c6d2bf0
...@@ -300,8 +300,8 @@ module Ci ...@@ -300,8 +300,8 @@ module Ci
def execute_hooks def execute_hooks
return unless project return unless project
build_data = Gitlab::DataBuilder::Build.build(self) build_data = Gitlab::DataBuilder::Build.build(self)
project.execute_hooks(build_data.dup, :build_hooks) project.execute_hooks(build_data.dup, :job_hooks)
project.execute_services(build_data.dup, :build_hooks) project.execute_services(build_data.dup, :job_hooks)
PagesService.new(build_data).execute PagesService.new(build_data).execute
project.running_or_pending_build_count(force: true) project.running_or_pending_build_count(force: true)
end end
......
...@@ -5,7 +5,7 @@ class ProjectHook < WebHook ...@@ -5,7 +5,7 @@ class ProjectHook < WebHook
scope :confidential_issue_hooks, -> { where(confidential_issues_events: true) } scope :confidential_issue_hooks, -> { where(confidential_issues_events: true) }
scope :note_hooks, -> { where(note_events: true) } scope :note_hooks, -> { where(note_events: true) }
scope :merge_request_hooks, -> { where(merge_requests_events: true) } scope :merge_request_hooks, -> { where(merge_requests_events: true) }
scope :build_hooks, -> { where(build_events: true) } scope :job_hooks, -> { where(job_events: true) }
scope :pipeline_hooks, -> { where(pipeline_events: true) } scope :pipeline_hooks, -> { where(pipeline_events: true) }
scope :wiki_page_hooks, -> { where(wiki_page_events: true) } scope :wiki_page_hooks, -> { where(wiki_page_events: true) }
end end
...@@ -8,7 +8,7 @@ class WebHook < ActiveRecord::Base ...@@ -8,7 +8,7 @@ class WebHook < ActiveRecord::Base
default_value_for :note_events, false default_value_for :note_events, false
default_value_for :merge_requests_events, false default_value_for :merge_requests_events, false
default_value_for :tag_push_events, false default_value_for :tag_push_events, false
default_value_for :build_events, false default_value_for :job_events, false
default_value_for :pipeline_events, false default_value_for :pipeline_events, false
default_value_for :repository_update_events, false default_value_for :repository_update_events, false
default_value_for :enable_ssl_verification, true default_value_for :enable_ssl_verification, true
......
...@@ -12,7 +12,7 @@ class Service < ActiveRecord::Base ...@@ -12,7 +12,7 @@ class Service < ActiveRecord::Base
default_value_for :merge_requests_events, true default_value_for :merge_requests_events, true
default_value_for :tag_push_events, true default_value_for :tag_push_events, true
default_value_for :note_events, true default_value_for :note_events, true
default_value_for :build_events, true default_value_for :job_events, true
default_value_for :pipeline_events, true default_value_for :pipeline_events, true
default_value_for :wiki_page_events, true default_value_for :wiki_page_events, true
...@@ -40,7 +40,7 @@ class Service < ActiveRecord::Base ...@@ -40,7 +40,7 @@ class Service < ActiveRecord::Base
scope :confidential_issue_hooks, -> { where(confidential_issues_events: true, active: true) } scope :confidential_issue_hooks, -> { where(confidential_issues_events: true, active: true) }
scope :merge_request_hooks, -> { where(merge_requests_events: true, active: true) } scope :merge_request_hooks, -> { where(merge_requests_events: true, active: true) }
scope :note_hooks, -> { where(note_events: true, active: true) } scope :note_hooks, -> { where(note_events: true, active: true) }
scope :build_hooks, -> { where(build_events: true, active: true) } scope :job_hooks, -> { where(job_events: true, active: true) }
scope :pipeline_hooks, -> { where(pipeline_events: true, active: true) } scope :pipeline_hooks, -> { where(pipeline_events: true, active: true) }
scope :wiki_page_hooks, -> { where(wiki_page_events: true, active: true) } scope :wiki_page_hooks, -> { where(wiki_page_events: true, active: true) }
scope :external_issue_trackers, -> { issue_trackers.active.without_defaults } scope :external_issue_trackers, -> { issue_trackers.active.without_defaults }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
= link_to 'Remove', admin_hook_path(hook), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm' = link_to 'Remove', admin_hook_path(hook), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm'
.monospace= hook.url .monospace= hook.url
%div %div
- %w(repository_update_events push_events tag_push_events issues_events note_events merge_requests_events build_events).each do |trigger| - %w(repository_update_events push_events tag_push_events issues_events note_events merge_requests_events job_events).each do |trigger|
- if hook.send(trigger) - if hook.send(trigger)
%span.label.label-gray= trigger.titleize %span.label.label-gray= trigger.titleize
%span.label.label-gray SSL Verification: #{hook.enable_ssl_verification ? 'enabled' : 'disabled'} %span.label.label-gray SSL Verification: #{hook.enable_ssl_verification ? 'enabled' : 'disabled'}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.col-md-8.col-lg-7 .col-md-8.col-lg-7
%strong.light-header= hook.url %strong.light-header= hook.url
%div %div
- %w(push_events tag_push_events issues_events confidential_issues_events note_events merge_requests_events build_events pipeline_events wiki_page_events).each do |trigger| - %w(push_events tag_push_events issues_events confidential_issues_events note_events merge_requests_events job_events pipeline_events wiki_page_events).each do |trigger|
- if hook.send(trigger) - if hook.send(trigger)
%span.label.label-gray.deploy-project-label= trigger.titleize %span.label.label-gray.deploy-project-label= trigger.titleize
.col-md-4.col-lg-5.text-right-lg.prepend-top-5 .col-md-4.col-lg-5.text-right-lg.prepend-top-5
......
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
%p.light %p.light
This URL will be triggered when a merge request is created/updated/merged This URL will be triggered when a merge request is created/updated/merged
%li %li
= form.check_box :build_events, class: 'pull-left' = form.check_box :job_events, class: 'pull-left'
.prepend-left-20 .prepend-left-20
= form.label :build_events, class: 'list-label' do = form.label :job_events, class: 'list-label' do
%strong Jobs events %strong Job events
%p.light %p.light
This URL will be triggered when the job status changes This URL will be triggered when the job status changes
%li %li
......
...@@ -60,7 +60,7 @@ module API ...@@ -60,7 +60,7 @@ module API
class ProjectHook < Hook class ProjectHook < Hook
expose :project_id, :issues_events, :merge_requests_events expose :project_id, :issues_events, :merge_requests_events
expose :note_events, :pipeline_events, :wiki_page_events expose :note_events, :pipeline_events, :wiki_page_events
expose :build_events, as: :job_events expose :job_events
end end
class BasicProjectDetails < Grape::Entity class BasicProjectDetails < Grape::Entity
...@@ -470,7 +470,7 @@ module API ...@@ -470,7 +470,7 @@ module API
expose :id, :title, :created_at, :updated_at, :active expose :id, :title, :created_at, :updated_at, :active
expose :push_events, :issues_events, :merge_requests_events expose :push_events, :issues_events, :merge_requests_events
expose :tag_push_events, :note_events, :pipeline_events expose :tag_push_events, :note_events, :pipeline_events
expose :build_events, as: :job_events expose :job_events
# Expose serialized properties # Expose serialized properties
expose :properties do |service, options| expose :properties do |service, options|
field_names = service.fields. field_names = service.fields.
......
...@@ -54,7 +54,6 @@ module API ...@@ -54,7 +54,6 @@ module API
end end
post ":id/hooks" do post ":id/hooks" do
hook_params = declared_params(include_missing: false) hook_params = declared_params(include_missing: false)
hook_params[:build_events] = hook_params.delete(:job_events) { false }
hook = user_project.hooks.new(hook_params) hook = user_project.hooks.new(hook_params)
...@@ -78,7 +77,6 @@ module API ...@@ -78,7 +77,6 @@ module API
hook = user_project.hooks.find(params.delete(:hook_id)) hook = user_project.hooks.find(params.delete(:hook_id))
update_params = declared_params(include_missing: false) update_params = declared_params(include_missing: false)
update_params[:build_events] = update_params.delete(:job_events) if update_params[:job_events]
if hook.update_attributes(update_params) if hook.update_attributes(update_params)
present hook, with: Entities::ProjectHook present hook, with: Entities::ProjectHook
......
...@@ -238,7 +238,8 @@ module API ...@@ -238,7 +238,8 @@ module API
class ProjectService < Grape::Entity class ProjectService < Grape::Entity
expose :id, :title, :created_at, :updated_at, :active expose :id, :title, :created_at, :updated_at, :active
expose :push_events, :issues_events, :merge_requests_events expose :push_events, :issues_events, :merge_requests_events
expose :tag_push_events, :note_events, :build_events, :pipeline_events expose :tag_push_events, :note_events, :pipeline_events
expose :job_events, as: :build_events
# Expose serialized properties # Expose serialized properties
expose :properties do |service, options| expose :properties do |service, options|
field_names = service.fields. field_names = service.fields.
...@@ -250,7 +251,8 @@ module API ...@@ -250,7 +251,8 @@ module API
class ProjectHook < ::API::Entities::Hook class ProjectHook < ::API::Entities::Hook
expose :project_id, :issues_events, :merge_requests_events expose :project_id, :issues_events, :merge_requests_events
expose :note_events, :build_events, :pipeline_events, :wiki_page_events expose :note_events, :pipeline_events, :wiki_page_events
expose :job_events, as: :build_events
end end
class Issue < ::API::Entities::Issue class Issue < ::API::Entities::Issue
......
...@@ -14,7 +14,7 @@ FactoryGirl.define do ...@@ -14,7 +14,7 @@ FactoryGirl.define do
issues_events true issues_events true
confidential_issues_events true confidential_issues_events true
note_events true note_events true
build_events true job_events true
pipeline_events true pipeline_events true
wiki_page_events true wiki_page_events true
end end
......
...@@ -52,6 +52,7 @@ feature 'Integration settings', feature: true do ...@@ -52,6 +52,7 @@ feature 'Integration settings', feature: true do
fill_in 'hook_url', with: url fill_in 'hook_url', with: url
check 'Tag push events' check 'Tag push events'
check 'Enable SSL verification' check 'Enable SSL verification'
check 'Job events'
click_button 'Add webhook' click_button 'Add webhook'
...@@ -59,6 +60,7 @@ feature 'Integration settings', feature: true do ...@@ -59,6 +60,7 @@ feature 'Integration settings', feature: true do
expect(page).to have_content('SSL Verification: enabled') expect(page).to have_content('SSL Verification: enabled')
expect(page).to have_content('Push Events') expect(page).to have_content('Push Events')
expect(page).to have_content('Tag Push Events') expect(page).to have_content('Tag Push Events')
expect(page).to have_content('Job events')
end end
scenario 'edit existing webhook' do scenario 'edit existing webhook' do
......
...@@ -6997,7 +6997,7 @@ ...@@ -6997,7 +6997,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "TeamcityService", "type": "TeamcityService",
"category": "ci", "category": "ci",
"default": false, "default": false,
...@@ -7041,7 +7041,7 @@ ...@@ -7041,7 +7041,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "RedmineService", "type": "RedmineService",
"category": "issue_tracker", "category": "issue_tracker",
"default": false, "default": false,
...@@ -7063,7 +7063,7 @@ ...@@ -7063,7 +7063,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "PushoverService", "type": "PushoverService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7085,7 +7085,7 @@ ...@@ -7085,7 +7085,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "PivotalTrackerService", "type": "PivotalTrackerService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7108,7 +7108,7 @@ ...@@ -7108,7 +7108,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "JiraService", "type": "JiraService",
"category": "issue_tracker", "category": "issue_tracker",
"default": false, "default": false,
...@@ -7130,7 +7130,7 @@ ...@@ -7130,7 +7130,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "IrkerService", "type": "IrkerService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7174,7 +7174,7 @@ ...@@ -7174,7 +7174,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "GemnasiumService", "type": "GemnasiumService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7196,7 +7196,7 @@ ...@@ -7196,7 +7196,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "FlowdockService", "type": "FlowdockService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7218,7 +7218,7 @@ ...@@ -7218,7 +7218,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "ExternalWikiService", "type": "ExternalWikiService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7240,7 +7240,7 @@ ...@@ -7240,7 +7240,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "EmailsOnPushService", "type": "EmailsOnPushService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7262,7 +7262,7 @@ ...@@ -7262,7 +7262,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "DroneCiService", "type": "DroneCiService",
"category": "ci", "category": "ci",
"default": false, "default": false,
...@@ -7284,7 +7284,7 @@ ...@@ -7284,7 +7284,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "CustomIssueTrackerService", "type": "CustomIssueTrackerService",
"category": "issue_tracker", "category": "issue_tracker",
"default": false, "default": false,
...@@ -7306,7 +7306,7 @@ ...@@ -7306,7 +7306,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "CampfireService", "type": "CampfireService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7328,7 +7328,7 @@ ...@@ -7328,7 +7328,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "BuildkiteService", "type": "BuildkiteService",
"category": "ci", "category": "ci",
"default": false, "default": false,
...@@ -7350,7 +7350,7 @@ ...@@ -7350,7 +7350,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "BambooService", "type": "BambooService",
"category": "ci", "category": "ci",
"default": false, "default": false,
...@@ -7372,7 +7372,7 @@ ...@@ -7372,7 +7372,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "AssemblaService", "type": "AssemblaService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7394,7 +7394,7 @@ ...@@ -7394,7 +7394,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"type": "AssemblaService", "type": "AssemblaService",
"category": "common", "category": "common",
"default": false, "default": false,
...@@ -7416,7 +7416,7 @@ ...@@ -7416,7 +7416,7 @@
"merge_requests_events": true, "merge_requests_events": true,
"tag_push_events": true, "tag_push_events": true,
"note_events": true, "note_events": true,
"build_events": true, "job_events": true,
"category": "common", "category": "common",
"default": false, "default": false,
"wiki_page_events": true, "wiki_page_events": true,
......
...@@ -33,7 +33,7 @@ describe Gitlab::ImportExport::RelationFactory, lib: true do ...@@ -33,7 +33,7 @@ describe Gitlab::ImportExport::RelationFactory, lib: true do
'tag_push_events' => false, 'tag_push_events' => false,
'note_events' => true, 'note_events' => true,
'enable_ssl_verification' => true, 'enable_ssl_verification' => true,
'build_events' => false, 'job_events' => false,
'wiki_page_events' => true, 'wiki_page_events' => true,
'token' => token 'token' => token
} }
......
...@@ -292,7 +292,7 @@ Service: ...@@ -292,7 +292,7 @@ Service:
- tag_push_events - tag_push_events
- note_events - note_events
- pipeline_events - pipeline_events
- build_events - job_events
- category - category
- default - default
- wiki_page_events - wiki_page_events
...@@ -312,7 +312,7 @@ ProjectHook: ...@@ -312,7 +312,7 @@ ProjectHook:
- note_events - note_events
- pipeline_events - pipeline_events
- enable_ssl_verification - enable_ssl_verification
- build_events - job_events
- wiki_page_events - wiki_page_events
- token - token
- group_id - group_id
......
...@@ -60,7 +60,7 @@ describe API::ProjectHooks, 'ProjectHooks' do ...@@ -60,7 +60,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events) expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events)
expect(json_response['tag_push_events']).to eq(hook.tag_push_events) expect(json_response['tag_push_events']).to eq(hook.tag_push_events)
expect(json_response['note_events']).to eq(hook.note_events) expect(json_response['note_events']).to eq(hook.note_events)
expect(json_response['job_events']).to eq(hook.build_events) expect(json_response['job_events']).to eq(hook.job_events)
expect(json_response['pipeline_events']).to eq(hook.pipeline_events) expect(json_response['pipeline_events']).to eq(hook.pipeline_events)
expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events) expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events)
expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification) expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification)
...@@ -148,7 +148,7 @@ describe API::ProjectHooks, 'ProjectHooks' do ...@@ -148,7 +148,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events) expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events)
expect(json_response['tag_push_events']).to eq(hook.tag_push_events) expect(json_response['tag_push_events']).to eq(hook.tag_push_events)
expect(json_response['note_events']).to eq(hook.note_events) expect(json_response['note_events']).to eq(hook.note_events)
expect(json_response['job_events']).to eq(hook.build_events) expect(json_response['job_events']).to eq(hook.job_events)
expect(json_response['pipeline_events']).to eq(hook.pipeline_events) expect(json_response['pipeline_events']).to eq(hook.pipeline_events)
expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events) expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events)
expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification) expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification)
......
...@@ -58,7 +58,7 @@ describe API::ProjectHooks, 'ProjectHooks' do ...@@ -58,7 +58,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events) expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events)
expect(json_response['tag_push_events']).to eq(hook.tag_push_events) expect(json_response['tag_push_events']).to eq(hook.tag_push_events)
expect(json_response['note_events']).to eq(hook.note_events) expect(json_response['note_events']).to eq(hook.note_events)
expect(json_response['build_events']).to eq(hook.build_events) expect(json_response['build_events']).to eq(hook.job_events)
expect(json_response['pipeline_events']).to eq(hook.pipeline_events) expect(json_response['pipeline_events']).to eq(hook.pipeline_events)
expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events) expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events)
expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification) expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification)
...@@ -143,7 +143,7 @@ describe API::ProjectHooks, 'ProjectHooks' do ...@@ -143,7 +143,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events) expect(json_response['merge_requests_events']).to eq(hook.merge_requests_events)
expect(json_response['tag_push_events']).to eq(hook.tag_push_events) expect(json_response['tag_push_events']).to eq(hook.tag_push_events)
expect(json_response['note_events']).to eq(hook.note_events) expect(json_response['note_events']).to eq(hook.note_events)
expect(json_response['build_events']).to eq(hook.build_events) expect(json_response['build_events']).to eq(hook.job_events)
expect(json_response['pipeline_events']).to eq(hook.pipeline_events) expect(json_response['pipeline_events']).to eq(hook.pipeline_events)
expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events) expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events)
expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification) expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment