summaryrefslogtreecommitdiff
path: root/app/models/ci
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-01-13 23:59:00 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2016-01-13 23:59:00 +0100
commit220c3a44c9fcbf2ac606cdbef4f5f50fd56939bd (patch)
tree01df508b48ef7299e04cb78f0dc1eb5e5cf0c4f9 /app/models/ci
parentf11ba743a58ce769cdf6ea7427392836355c067d (diff)
parentd139276a3757d3df45232b557e1bb388d21268d0 (diff)
downloadgitlab-ce-220c3a44c9fcbf2ac606cdbef4f5f50fd56939bd.tar.gz
Merge branch '8-4-stable' into ci/api-variables
* 8-4-stable: (285 commits) Add Changelog entry for build traces data integrity fix Update doc_styleguide.md [ci skip] Added hint that you can search users by name, username, or email. Add changelog Version 8.4.0.rc1 Randomize metrics sample intervals Make the metrics sampler interval configurable Don't automatically require awesome_print Disable colorization if STDOUT is not a tty Block the reported user before destroying the record changes `$quote-gray` to `$secondary-text` makes message plural for multiple MRs and removes from loop. Duh. Prepare Installation and Update docs for 8.4 RC1 Mention channel/key bug in irkerd docs Revert "Remove the `:coffee` and `:coffeescript` Haml filters" gets merge request discussion working again adds back in discussion.haml.html for issues commenting and closing/reopening properly. removing last chunk of MR ajax changes, rest will be in another MR reverting more MR ajax files, will appear in different commit reverting MR ajax changes, which will be in a different MR ...
Diffstat (limited to 'app/models/ci')
-rw-r--r--app/models/ci/build.rb9
-rw-r--r--app/models/ci/runner_project.rb11
-rw-r--r--app/models/ci/trigger.rb13
-rw-r--r--app/models/ci/variable.rb2
4 files changed, 18 insertions, 17 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 3e67b2771c1..a4779d06de8 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -29,6 +29,7 @@
# target_url :string(255)
# description :string(255)
# artifacts_file :text
+# gl_project_id :integer
#
module Ci
@@ -54,6 +55,8 @@ module Ci
# To prevent db load megabytes of data from trace
default_scope -> { select(Ci::Build.columns_without_lazy) }
+ before_destroy { project }
+
class << self
def columns_without_lazy
(column_names - LAZY_ATTRIBUTES).map do |column_name|
@@ -145,10 +148,6 @@ module Ci
end
end
- def project
- commit.project
- end
-
def project_id
commit.project.id
end
@@ -207,7 +206,7 @@ module Ci
def trace
trace = raw_trace
- if project && trace.present?
+ if project && trace.present? && project.runners_token.present?
trace.gsub(project.runners_token, 'xxxxxx')
else
trace
diff --git a/app/models/ci/runner_project.rb b/app/models/ci/runner_project.rb
index 93d9be144e8..7b16f207a26 100644
--- a/app/models/ci/runner_project.rb
+++ b/app/models/ci/runner_project.rb
@@ -2,11 +2,12 @@
#
# Table name: ci_runner_projects
#
-# id :integer not null, primary key
-# runner_id :integer not null
-# project_id :integer not null
-# created_at :datetime
-# updated_at :datetime
+# id :integer not null, primary key
+# runner_id :integer not null
+# project_id :integer
+# created_at :datetime
+# updated_at :datetime
+# gl_project_id :integer
#
module Ci
diff --git a/app/models/ci/trigger.rb b/app/models/ci/trigger.rb
index 23516709a41..bb98cd5c7da 100644
--- a/app/models/ci/trigger.rb
+++ b/app/models/ci/trigger.rb
@@ -2,12 +2,13 @@
#
# Table name: ci_triggers
#
-# id :integer not null, primary key
-# token :string(255)
-# project_id :integer not null
-# deleted_at :datetime
-# created_at :datetime
-# updated_at :datetime
+# id :integer not null, primary key
+# token :string(255)
+# project_id :integer
+# deleted_at :datetime
+# created_at :datetime
+# updated_at :datetime
+# gl_project_id :integer
#
module Ci
diff --git a/app/models/ci/variable.rb b/app/models/ci/variable.rb
index 1d9ee91a31c..e786bd7dd93 100644
--- a/app/models/ci/variable.rb
+++ b/app/models/ci/variable.rb
@@ -3,7 +3,7 @@
# Table name: ci_variables
#
# id :integer not null, primary key
-# project_id :integer not null
+# project_id :integer
# key :string(255)
# value :text
# encrypted_value :text