Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
81b45046
Commit
81b45046
authored
Nov 28, 2018
by
Shinya Maeda
Committed by
Rémy Coutable
Nov 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return real deployment status to frontend
parent
f63ede5d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
app/models/environment_status.rb
app/models/environment_status.rb
+1
-16
changelogs/unreleased/remove-deployment-status-hack-from-backend.yml
...unreleased/remove-deployment-status-hack-from-backend.yml
+5
-0
spec/features/merge_request/user_sees_deployment_widget_spec.rb
...eatures/merge_request/user_sees_deployment_widget_spec.rb
+14
-1
No files found.
app/models/environment_status.rb
View file @
81b45046
...
...
@@ -8,6 +8,7 @@ class EnvironmentStatus
delegate
:id
,
to: :environment
delegate
:name
,
to: :environment
delegate
:project
,
to: :environment
delegate
:status
,
to: :deployment
,
allow_nil:
true
delegate
:deployed_at
,
to: :deployment
,
allow_nil:
true
def
self
.
for_merge_request
(
mr
,
user
)
...
...
@@ -43,22 +44,6 @@ class EnvironmentStatus
.
merge_request_diff_files
.
where
(
deleted_file:
false
)
end
##
# Since frontend has not supported all statuses yet, BE has to
# proxy some status to a supported status.
def
status
return
unless
deployment
case
deployment
.
status
when
'created'
'running'
when
'canceled'
'failed'
else
deployment
.
status
end
end
private
PAGE_EXTENSIONS
=
/\A\.(s?html?|php|asp|cgi|pl)\z/i
.
freeze
...
...
changelogs/unreleased/remove-deployment-status-hack-from-backend.yml
0 → 100644
View file @
81b45046
---
title
:
Return real deployment status to frontend
merge_request
:
23270
author
:
type
:
fixed
spec/features/merge_request/user_sees_deployment_widget_spec.rb
View file @
81b45046
...
...
@@ -65,7 +65,20 @@ describe 'Merge request > User sees deployment widget', :js do
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
expect
(
page
).
to
have_content
(
"Deploying to
#{
environment
.
name
}
"
)
expect
(
page
).
to
have_content
(
"Will deploy to
#{
environment
.
name
}
"
)
expect
(
page
).
not_to
have_css
(
'.js-deploy-time'
)
end
end
context
'when deployment was cancelled'
do
let
(
:build
)
{
create
(
:ci_build
,
:canceled
,
pipeline:
pipeline
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
:canceled
,
environment:
environment
,
sha:
sha
,
ref:
ref
,
deployable:
build
)
}
it
'displays that the environment name'
do
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
expect
(
page
).
to
have_content
(
"Failed to deploy to
#{
environment
.
name
}
"
)
expect
(
page
).
not_to
have_css
(
'.js-deploy-time'
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment