Skip to content
Snippets Groups Projects
Commit e04863c7 authored by Robert Speicher's avatar Robert Speicher
Browse files

Merge remote-tracking branch 'ce/8-0-stable' into 8-0-stable-ee

parents d780cd0d 9683d1ef
No related branches found
No related tags found
No related merge requests found
Pipeline #
Please view this file on the master branch, on stable branches it's out of date.
 
v 8.0.3
- Fix URL shown in Slack notifications
- Fix bug where projects would appear to be stuck in the forked import state (Stan Hu)
- Fix Error 500 in creating merge requests with > 1000 diffs (Stan Hu)
v 8.0.2
- Fix default avatar not rendering in network graph (Stan Hu)
- Skip check_initd_configured_correctly on omnibus installs
Loading
Loading
Loading
Loading
@@ -123,6 +123,8 @@ end
 
# State machine
gem "state_machine", '~> 1.2.0'
# Run events after state machine commits
gem 'after_commit_queue'
 
# Issue tags
gem 'acts-as-taggable-on', '~> 3.4'
Loading
Loading
Loading
Loading
@@ -42,6 +42,8 @@ GEM
acts-as-taggable-on (3.5.0)
activerecord (>= 3.2, < 5)
addressable (2.3.8)
after_commit_queue (1.1.0)
rails (>= 3.0)
annotate (2.6.10)
activerecord (>= 3.2, <= 4.3)
rake (~> 10.4)
Loading
Loading
@@ -790,6 +792,7 @@ DEPENDENCIES
activerecord-session_store (~> 0.1.0)
acts-as-taggable-on (~> 3.4)
addressable (~> 2.3.8)
after_commit_queue
annotate (~> 2.6.0)
asana (~> 0.0.6)
asciidoctor (~> 1.5.2)
Loading
Loading
module Ci
module RoutesHelper
class Base
include Gitlab::Application.routes.url_helpers
def default_url_options
{
host: Settings.gitlab['host'],
protocol: Settings.gitlab['https'] ? "https" : "http",
port: Settings.gitlab['port']
}
end
end
def url_helpers
@url_helpers ||= Base.new
end
def self.method_missing(method, *args, &block)
@url_helpers ||= Base.new
if @url_helpers.respond_to?(method)
@url_helpers.send(method, *args, &block)
else
super method, *args, &block
end
end
end
end
Loading
Loading
@@ -123,12 +123,12 @@ def reload_diffs
if new_diffs.any?
if new_diffs.size > Commit::DIFF_HARD_LIMIT_FILES
self.state = :overflow_diff_files_limit
new_diffs = new_diffs.first[Commit::DIFF_HARD_LIMIT_LINES]
new_diffs = new_diffs.first(Commit::DIFF_HARD_LIMIT_LINES)
end
 
if new_diffs.sum { |diff| diff.diff.lines.count } > Commit::DIFF_HARD_LIMIT_LINES
self.state = :overflow_diff_lines_limit
new_diffs = new_diffs.first[Commit::DIFF_HARD_LIMIT_LINES]
new_diffs = new_diffs.first(Commit::DIFF_HARD_LIMIT_LINES)
end
end
 
Loading
Loading
Loading
Loading
@@ -39,6 +39,7 @@ class Project < ActiveRecord::Base
include Gitlab::VisibilityLevel
include Referable
include Sortable
include AfterCommitQueue
 
extend Gitlab::ConfigHelper
extend Enumerize
Loading
Loading
@@ -198,7 +199,7 @@ def set_last_activity_at
state :finished
state :failed
 
after_transition any => :started, do: :add_import_job
after_transition any => :started, do: :schedule_add_import_job
after_transition any => :finished, do: :clear_import_data
end
 
Loading
Loading
@@ -282,13 +283,17 @@ def saved?
id && persisted?
end
 
def schedule_add_import_job
run_after_commit(:add_import_job)
end
def add_import_job
if forked?
unless RepositoryForkWorker.perform_async(id, forked_from_project.path_with_namespace, self.namespace.path)
import_fail
end
else
RepositoryImportWorker.perform_in(2.seconds, id)
RepositoryImportWorker.perform_async(id)
end
end
 
Loading
Loading
module Ci
class HipChatMessage
include Gitlab::Application.routes.url_helpers
attr_reader :build
 
def initialize(build)
Loading
Loading
@@ -8,13 +10,13 @@ def initialize(build)
 
def to_s
lines = Array.new
lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_url(project)}\">#{project.name}</a> - ")
lines.push("<a href=\"#{ci_project_url(project)}\">#{project.name}</a> - ")
if commit.matrix?
lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_ref_commits_url(project, commit.ref, commit.sha)}\">Commit ##{commit.id}</a></br>")
lines.push("<a href=\"#{ci_project_ref_commits_url(project, commit.ref, commit.sha)}\">Commit ##{commit.id}</a></br>")
else
first_build = commit.builds_without_retry.first
lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_build_url(project, first_build)}\">Build '#{first_build.name}' ##{first_build.id}</a></br>")
lines.push("<a href=\"#{ci_project_build_url(project, first_build)}\">Build '#{first_build.name}' ##{first_build.id}</a></br>")
end
lines.push("#{commit.short_sha} #{commit.git_author_name} - #{commit.git_commit_message}</br>")
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@
 
module Ci
class SlackMessage
include Gitlab::Application.routes.url_helpers
def initialize(commit)
@commit = commit
end
Loading
Loading
@@ -27,7 +29,7 @@ def attachments
next unless build.failed?
fields << {
title: build.name,
value: "Build <#{Ci::RoutesHelper.ci_project_build_url(project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)."
value: "Build <#{ci_project_build_url(project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)."
}
end
end
Loading
Loading
@@ -44,12 +46,12 @@ def attachments
attr_reader :commit
 
def attachment_message
out = "<#{Ci::RoutesHelper.ci_project_url(project)}|#{project_name}>: "
out = "<#{ci_project_url(project)}|#{project_name}>: "
if commit.matrix?
out << "Commit <#{Ci::RoutesHelper.ci_project_ref_commits_url(project, commit.ref, commit.sha)}|\##{commit.id}> "
out << "Commit <#{ci_project_ref_commits_url(project, commit.ref, commit.sha)}|\##{commit.id}> "
else
build = commit.builds_without_retry.first
out << "Build <#{Ci::RoutesHelper.ci_project_build_path(project, build)}|\##{build.id}> "
out << "Build <#{ci_project_build_url(project, build)}|\##{build.id}> "
end
out << "(<#{commit_sha_link}|#{commit.short_sha}>) "
out << "of <#{commit_ref_link}|#{commit.ref}> "
Loading
Loading
Loading
Loading
@@ -19,6 +19,8 @@
#
 
class GitlabCiService < CiService
include Gitlab::Application.routes.url_helpers
after_save :compose_service_hook, if: :activated?
 
def compose_service_hook
Loading
Loading
@@ -92,7 +94,7 @@ def commit_coverage(sha, ref)
 
def build_page(sha, ref)
if project.gitlab_ci_project.present?
Ci::RoutesHelper.ci_project_ref_commits_path(project.gitlab_ci_project, ref, sha)
ci_project_ref_commits_url(project.gitlab_ci_project, ref, sha)
end
end
 
Loading
Loading
Loading
Loading
@@ -39,8 +39,8 @@
end
 
describe :build_page do
it { expect(@service.build_page("2ab7834c", 'master')).to eq("/ci/projects/#{@ci_project.id}/refs/master/commits/2ab7834c")}
it { expect(@service.build_page("issue#2", 'master')).to eq("/ci/projects/#{@ci_project.id}/refs/master/commits/issue%232")}
it { expect(@service.build_page("2ab7834c", 'master')).to eq("http://localhost/ci/projects/#{@ci_project.id}/refs/master/commits/2ab7834c")}
it { expect(@service.build_page("issue#2", 'master')).to eq("http://localhost/ci/projects/#{@ci_project.id}/refs/master/commits/issue%232")}
end
 
describe "execute" do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment