diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-07-16 18:18:28 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-07-16 18:18:28 +0300 |
commit | 68ddb4c7353e6994dca5c9e08adb9fa4c842ff11 (patch) | |
tree | 5840812732984ddc13291dd3fa0d0befe37fe59a /app/models | |
parent | 551955b57f9f66cc66bed2d7c668b2d5ed4c017d (diff) | |
parent | a73f480715f086e86d781e22d8a76b71c3b0680a (diff) |
Merge remote-tracking branch 'upstream/master' into 14995-custom_wiki_sidebar
* upstream/master: (53 commits)
Fix invalid link to GitLab.com architecture.md
i18n: externalize strings from 'app/views/import'
Remove Repository#lookup and unreachable rugged code
refactor code based on feedback
Trigger rails5 tests either by variable or ref name
Fix link in help doc which was linking to old mono-repo, now in its own repo
Allow Danger step to fail
update webpack to v4.16
Backport logger changes from EE
Add the CI Job trigger as the build trigger
Remove flaky and redundant expectations
use fileuploader dynamic path method in uploads manager and add spec
fix typo in uploads manager
add small comment to download method in uploads manager
refactor uploads manager
Update 10.6-to-10.7.md
Lazy-load performance bar UI
Update .gitlab-ci.yml
fixed test to correctly text relative URLs doesnt add query param if source & target projects match
Add changelog entry
...
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 1 | ||||
-rw-r--r-- | app/models/deployment.rb | 4 | ||||
-rw-r--r-- | app/models/environment.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 6 |
4 files changed, 6 insertions, 7 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index d8ddb4bc667..db86400128c 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -653,6 +653,7 @@ module Ci variables.append(key: 'CI_JOB_NAME', value: name) variables.append(key: 'CI_JOB_STAGE', value: stage) variables.append(key: 'CI_COMMIT_SHA', value: sha) + variables.append(key: 'CI_COMMIT_BEFORE_SHA', value: before_sha) variables.append(key: 'CI_COMMIT_REF_NAME', value: ref) variables.append(key: 'CI_COMMIT_REF_SLUG', value: ref_slug) variables.append(key: "CI_COMMIT_TAG", value: ref) if tag? diff --git a/app/models/deployment.rb b/app/models/deployment.rb index ac86e9e8de0..687246b47b2 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -92,10 +92,6 @@ class Deployment < ActiveRecord::Base @stop_action ||= manual_actions.find_by(name: on_stop) end - def stop_action? - stop_action.present? - end - def formatted_deployment_time created_at.to_time.in_time_zone.to_s(:medium) end diff --git a/app/models/environment.rb b/app/models/environment.rb index 8d523dae324..4856d313318 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -117,7 +117,7 @@ class Environment < ActiveRecord::Base external_url.gsub(%r{\A.*?://}, '') end - def stop_action? + def stop_action_available? available? && stop_action.present? end diff --git a/app/models/project.rb b/app/models/project.rb index 1894de6ceed..e29bca365a4 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -368,8 +368,10 @@ class Project < ActiveRecord::Base chronic_duration_attr :build_timeout_human_readable, :build_timeout, default: 3600 validates :build_timeout, allow_nil: true, - numericality: { greater_than_or_equal_to: 600, - message: 'needs to be at least 10 minutes' } + numericality: { greater_than_or_equal_to: 10.minutes, + less_than: 1.month, + only_integer: true, + message: 'needs to be beetween 10 minutes and 1 month' } # Returns a collection of projects that is either public or visible to the # logged in user. |