summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 14:14:39 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 14:14:39 +0000
commit1eb82b65c554f21d83447f895a6208905fabe112 (patch)
treeab12f01b3dc46f11c02afea1e470a78f06ca70c2 /app/models/project.rb
parent4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff)
downloadgitlab-ce-stable-branch-foss-test.tar.gz
Add latest changes from gitlab-org/gitlab@12-3-auto-deploy-20190916stable-branch-foss-test
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 57f1ca98ee2..96c715095f6 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -58,7 +58,6 @@ class Project < ApplicationRecord
ACCESS_REQUEST_APPROVERS_TO_BE_NOTIFIED_LIMIT = 10
SORTING_PREFERENCE_FIELD = :projects_sort
- MAX_BUILD_TIMEOUT = 1.month
cache_markdown_field :description, pipeline: :description
@@ -431,7 +430,7 @@ class Project < ApplicationRecord
validates :build_timeout, allow_nil: true,
numericality: { greater_than_or_equal_to: 10.minutes,
- less_than: MAX_BUILD_TIMEOUT,
+ less_than: 1.month,
only_integer: true,
message: _('needs to be between 10 minutes and 1 month') }
@@ -753,15 +752,6 @@ class Project < ApplicationRecord
latest_successful_build_for_ref(job_name, ref) || raise(ActiveRecord::RecordNotFound.new("Couldn't find job #{job_name}"))
end
- def latest_pipeline_for_ref(ref = default_branch)
- ref = ref.presence || default_branch
- sha = commit(ref)&.sha
-
- return unless sha
-
- ci_pipelines.newest_first(ref: ref, sha: sha).first
- end
-
def merge_base_commit(first_commit_id, second_commit_id)
sha = repository.merge_base(first_commit_id, second_commit_id)
commit_by(oid: sha) if sha