Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-21 18:09:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-21 18:09:33 +0300
commitc39912f5538caca913374a8983adffc234b3f1c9 (patch)
tree8dfffd81aff7ba03c152991a0c825d9076dcf624 /lib/gitlab/data_builder
parentcd6e1ccea48e770d74296f4fdb8957d3cfb073f3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/data_builder')
-rw-r--r--lib/gitlab/data_builder/deployment.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/gitlab/data_builder/deployment.rb b/lib/gitlab/data_builder/deployment.rb
index 0e6841e10a7..a9c69e3f997 100644
--- a/lib/gitlab/data_builder/deployment.rb
+++ b/lib/gitlab/data_builder/deployment.rb
@@ -5,7 +5,8 @@ module Gitlab
module Deployment
extend self
- def build(deployment, status_changed_at)
+ # NOTE: Time-sensitive attributes should be explicitly passed as argument instead of reading from database.
+ def build(deployment, status, status_changed_at)
# Deployments will not have a deployable when created using the API.
deployable_url =
if deployment.deployable
@@ -22,9 +23,13 @@ module Gitlab
Gitlab::UrlBuilder.build(deployment.deployed_by)
end
+ # `status` argument could be `nil` during the upgrade. We can remove `deployment.status` in GitLab 15.5.
+ # See https://docs.gitlab.com/ee/development/multi_version_compatibility.html for more info.
+ deployment_status = status || deployment.status
+
{
object_kind: 'deployment',
- status: deployment.status,
+ status: deployment_status,
status_changed_at: status_changed_at,
deployment_id: deployment.id,
deployable_id: deployment.deployable_id,