summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 12:07:41 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 12:07:41 +0000
commit8cc5f2790908ba9bb8eecba2b78a3c5a88c77b90 (patch)
tree2d6211503a5111d43a9edce0c56b94fd1b347e1b /app/models
parent17b91a3c6ab73fff087e91665e9afb8046cbf045 (diff)
downloadgitlab-ce-8cc5f2790908ba9bb8eecba2b78a3c5a88c77b90.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/ci/persistent_ref.rb4
-rw-r--r--app/models/clusters/applications/elastic_stack.rb2
-rw-r--r--app/models/clusters/cluster.rb2
-rw-r--r--app/models/clusters/concerns/application_core.rb2
-rw-r--r--app/models/concerns/group_descendant.rb6
-rw-r--r--app/models/concerns/storage/legacy_namespace.rb6
-rw-r--r--app/models/merge_request.rb2
-rw-r--r--app/models/upload.rb6
-rw-r--r--app/models/uploads/local.rb3
10 files changed, 19 insertions, 16 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 21dbbae1747..2e6b5d68747 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -289,7 +289,7 @@ module Ci
begin
build.deployment.drop!
rescue => e
- Gitlab::Sentry.track_exception(e, extra: { build_id: build.id })
+ Gitlab::Sentry.track_and_raise_for_dev_exception(e, build_id: build.id)
end
true
diff --git a/app/models/ci/persistent_ref.rb b/app/models/ci/persistent_ref.rb
index 10d7795be2b..634c03e0326 100644
--- a/app/models/ci/persistent_ref.rb
+++ b/app/models/ci/persistent_ref.rb
@@ -27,7 +27,7 @@ module Ci
create_ref(sha, path)
rescue => e
Gitlab::Sentry
- .track_acceptable_exception(e, extra: { pipeline_id: pipeline.id })
+ .track_exception(e, pipeline_id: pipeline.id)
end
def delete
@@ -38,7 +38,7 @@ module Ci
# no-op
rescue => e
Gitlab::Sentry
- .track_acceptable_exception(e, extra: { pipeline_id: pipeline.id })
+ .track_exception(e, pipeline_id: pipeline.id)
end
def path
diff --git a/app/models/clusters/applications/elastic_stack.rb b/app/models/clusters/applications/elastic_stack.rb
index 8589f8c00cb..9854ad2ea3e 100644
--- a/app/models/clusters/applications/elastic_stack.rb
+++ b/app/models/clusters/applications/elastic_stack.rb
@@ -71,6 +71,8 @@ module Clusters
# `proxy_url` could raise an exception because gitlab can not communicate with the cluster.
# We check for a nil client in downstream use and behaviour is equivalent to an empty state
log_exception(error, :failed_to_create_elasticsearch_client)
+
+ nil
end
end
diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb
index 3742bbd8446..2d5b4905bf5 100644
--- a/app/models/clusters/cluster.rb
+++ b/app/models/clusters/cluster.rb
@@ -335,7 +335,7 @@ module Clusters
rescue Kubeclient::HttpError => e
kubeclient_error_status(e.message)
rescue => e
- Gitlab::Sentry.track_acceptable_exception(e, extra: { cluster_id: id })
+ Gitlab::Sentry.track_exception(e, cluster_id: id)
:unknown_failure
else
diff --git a/app/models/clusters/concerns/application_core.rb b/app/models/clusters/concerns/application_core.rb
index 21b98534808..cc9eafbcdd6 100644
--- a/app/models/clusters/concerns/application_core.rb
+++ b/app/models/clusters/concerns/application_core.rb
@@ -76,7 +76,7 @@ module Clusters
message: error.message
})
- Gitlab::Sentry.track_acceptable_exception(error, extra: { cluster_id: cluster&.id, application_id: id })
+ Gitlab::Sentry.track_exception(error, cluster_id: cluster&.id, application_id: id)
end
end
end
diff --git a/app/models/concerns/group_descendant.rb b/app/models/concerns/group_descendant.rb
index 7e6a20c27e8..18f6a7a9c58 100644
--- a/app/models/concerns/group_descendant.rb
+++ b/app/models/concerns/group_descendant.rb
@@ -48,11 +48,11 @@ module GroupDescendant
extras = {
parent: parent.inspect,
child: child.inspect,
- preloaded: preloaded.map(&:full_path)
+ preloaded: preloaded.map(&:full_path),
+ issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/49404'
}
- issue_url = 'https://gitlab.com/gitlab-org/gitlab-foss/issues/49404'
- Gitlab::Sentry.track_exception(exception, issue_url: issue_url, extra: extras)
+ Gitlab::Sentry.track_and_raise_for_dev_exception(exception, extras)
end
if parent.nil? && hierarchy_top.present?
diff --git a/app/models/concerns/storage/legacy_namespace.rb b/app/models/concerns/storage/legacy_namespace.rb
index 9c2b0372d54..b9081f9bbf2 100644
--- a/app/models/concerns/storage/legacy_namespace.rb
+++ b/app/models/concerns/storage/legacy_namespace.rb
@@ -37,8 +37,10 @@ module Storage
send_update_instructions
write_projects_repository_config
rescue => e
- # Raise if development/test environment, else just notify Sentry
- Gitlab::Sentry.track_exception(e, extra: { full_path_before_last_save: full_path_before_last_save, full_path: full_path, action: 'move_dir' })
+ Gitlab::Sentry.track_and_raise_for_dev_exception(e,
+ full_path_before_last_save: full_path_before_last_save,
+ full_path: full_path,
+ action: 'move_dir')
end
true # false would cancel later callbacks but not rollback
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index bbc54987407..1671b1e2d55 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -1514,7 +1514,7 @@ class MergeRequest < ApplicationRecord
end
end
rescue ActiveRecord::LockWaitTimeout => e
- Gitlab::Sentry.track_acceptable_exception(e)
+ Gitlab::Sentry.track_exception(e)
raise RebaseLockTimeout, REBASE_LOCK_MESSAGE
end
diff --git a/app/models/upload.rb b/app/models/upload.rb
index 650321e2793..12917f85431 100644
--- a/app/models/upload.rb
+++ b/app/models/upload.rb
@@ -103,10 +103,8 @@ class Upload < ApplicationRecord
# Help sysadmins find missing upload files
if persisted? && !exist
- if Gitlab::Sentry.enabled?
- Raven.capture_message(_("Upload file does not exist"), extra: self.attributes)
- end
-
+ exception = RuntimeError.new("Uploaded file does not exist")
+ Gitlab::Sentry.track_exception(exception, self.attributes)
Gitlab::Metrics.counter(:upload_file_does_not_exist_total, _('The number of times an upload record could not find its file')).increment
end
diff --git a/app/models/uploads/local.rb b/app/models/uploads/local.rb
index 2901c33c359..f1f25dfb584 100644
--- a/app/models/uploads/local.rb
+++ b/app/models/uploads/local.rb
@@ -23,7 +23,8 @@ module Uploads
unless in_uploads?(path)
message = "Path '#{path}' is not in uploads dir, skipping"
logger.warn(message)
- Gitlab::Sentry.track_exception(RuntimeError.new(message), extra: { uploads_dir: storage_dir })
+ Gitlab::Sentry.track_and_raise_for_dev_exception(
+ RuntimeError.new(message), uploads_dir: storage_dir)
return
end