summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-09-21 10:35:56 +0200
committerDouwe Maan <douwe@gitlab.com>2015-09-21 10:35:56 +0200
commit0c833498678603e2fd222a2f6386418822ce0a19 (patch)
tree53eebd325693d42276392d44da6e2dd9f6eef768 /app
parentee028d9d60522f8993a0b2429ac8a0631d59229a (diff)
parentd2c90d7494e8ca6b37d4ce57b2bc08f8b1175c4b (diff)
downloadgitlab-ce-0c833498678603e2fd222a2f6386418822ce0a19.tar.gz
Merge branch 'master' into rename-reply-by-email
Diffstat (limited to 'app')
-rw-r--r--app/helpers/gitlab_markdown_helper.rb4
-rw-r--r--app/mailers/emails/notes.rb6
-rw-r--r--app/models/ci/commit.rb2
-rw-r--r--app/models/project.rb2
-rw-r--r--app/models/sent_notification.rb14
-rw-r--r--app/views/admin/application_settings/_form.html.haml2
-rw-r--r--app/views/ci/projects/disabled.html.haml2
7 files changed, 21 insertions, 11 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 1ebfd92f119..78bf25f55e7 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -45,7 +45,7 @@ module GitlabMarkdownHelper
end
def markdown(text, context = {})
- context.merge!(
+ context.reverse_merge!(
current_user: current_user,
path: @path,
project: @project,
@@ -59,7 +59,7 @@ module GitlabMarkdownHelper
# TODO (rspeicher): Remove all usages of this helper and just call `markdown`
# with a custom pipeline depending on the content being rendered
def gfm(text, options = {})
- options.merge!(
+ options.reverse_merge!(
current_user: current_user,
path: @path,
project: @project,
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index 63d4aca61af..87ba94a583d 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -12,7 +12,7 @@ module Emails
to: recipient(recipient_id),
subject: subject("#{@commit.title} (#{@commit.short_id})"))
- SentNotification.record(@commit, recipient_id, reply_key)
+ SentNotification.record_note(@note, recipient_id, reply_key)
end
def note_issue_email(recipient_id, note_id)
@@ -27,7 +27,7 @@ module Emails
to: recipient(recipient_id),
subject: subject("#{@issue.title} (##{@issue.iid})"))
- SentNotification.record(@issue, recipient_id, reply_key)
+ SentNotification.record_note(@note, recipient_id, reply_key)
end
def note_merge_request_email(recipient_id, note_id)
@@ -43,7 +43,7 @@ module Emails
to: recipient(recipient_id),
subject: subject("#{@merge_request.title} (##{@merge_request.iid})"))
- SentNotification.record(@merge_request, recipient_id, reply_key)
+ SentNotification.record_note(@note, recipient_id, reply_key)
end
end
end
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 23cd47dfe37..f102d0a7679 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -236,7 +236,7 @@ module Ci
end
def config_processor
- @config_processor ||= Ci::GitlabCiYamlProcessor.new(push_data[:ci_yaml_file] || project.generated_yaml_config)
+ @config_processor ||= Ci::GitlabCiYamlProcessor.new(push_data[:ci_yaml_file])
rescue Ci::GitlabCiYamlProcessor::ValidationError => e
save_yaml_error(e.message)
nil
diff --git a/app/models/project.rb b/app/models/project.rb
index 6e2f9645661..1a5c1c978c9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -428,7 +428,7 @@ class Project < ActiveRecord::Base
end
def gitlab_ci?
- gitlab_ci_service && gitlab_ci_service.active
+ gitlab_ci_service && gitlab_ci_service.active && gitlab_ci_project.present?
end
def ci_services
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb
index 2724af8e613..3eed5c16e45 100644
--- a/app/models/sent_notification.rb
+++ b/app/models/sent_notification.rb
@@ -8,6 +8,7 @@
# noteable_type :string(255)
# recipient_id :integer
# commit_id :string(255)
+# line_code :string(255)
# reply_key :string(255) not null
#
@@ -21,6 +22,7 @@ class SentNotification < ActiveRecord::Base
validates :noteable_id, presence: true, unless: :for_commit?
validates :commit_id, presence: true, if: :for_commit?
+ validates :line_code, format: { with: /\A[a-z0-9]+_\d+_\d+\Z/ }, allow_blank: true
class << self
def reply_key
@@ -33,7 +35,7 @@ class SentNotification < ActiveRecord::Base
find_by(reply_key: reply_key)
end
- def record(noteable, recipient_id, reply_key)
+ def record(noteable, recipient_id, reply_key, params = {})
return unless reply_key
noteable_id = nil
@@ -44,7 +46,7 @@ class SentNotification < ActiveRecord::Base
noteable_id = noteable.id
end
- create(
+ params.reverse_merge!(
project: noteable.project,
noteable_type: noteable.class.name,
noteable_id: noteable_id,
@@ -52,6 +54,14 @@ class SentNotification < ActiveRecord::Base
recipient_id: recipient_id,
reply_key: reply_key
)
+
+ create(params)
+ end
+
+ def record_note(note, recipient_id, reply_key, params = {})
+ params[:line_code] = note.line_code
+
+ record(note.noteable, recipient_id, reply_key, params)
end
end
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index 1476e29524c..143cd10c543 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -131,7 +131,7 @@
.checkbox
= f.label :ci_enabled do
= f.check_box :ci_enabled
- Enable Continuous Integration
+ Disable to prevent CI usage until rake ci:migrate is run (8.0 only)
.form-actions
= f.submit 'Save', class: 'btn btn-primary'
diff --git a/app/views/ci/projects/disabled.html.haml b/app/views/ci/projects/disabled.html.haml
index 95276d894ed..83b0d8329e1 100644
--- a/app/views/ci/projects/disabled.html.haml
+++ b/app/views/ci/projects/disabled.html.haml
@@ -1 +1 @@
-Continuous Integration has been disabled. Please ask your administrator to enable it.
+Continuous Integration has been disabled for time of the migration.