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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
81b45046
Commit
81b45046
authored
6 years ago
by
Shinya Maeda
Committed by
Rémy Coutable
6 years ago
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
...
@@ -8,6 +8,7 @@ class EnvironmentStatus
delegate
:id
,
to: :environment
delegate
:id
,
to: :environment
delegate
:name
,
to: :environment
delegate
:name
,
to: :environment
delegate
:project
,
to: :environment
delegate
:project
,
to: :environment
delegate
:status
,
to: :deployment
,
allow_nil:
true
delegate
:deployed_at
,
to: :deployment
,
allow_nil:
true
delegate
:deployed_at
,
to: :deployment
,
allow_nil:
true
def
self
.
for_merge_request
(
mr
,
user
)
def
self
.
for_merge_request
(
mr
,
user
)
...
@@ -43,22 +44,6 @@ class EnvironmentStatus
...
@@ -43,22 +44,6 @@ class EnvironmentStatus
.
merge_request_diff_files
.
where
(
deleted_file:
false
)
.
merge_request_diff_files
.
where
(
deleted_file:
false
)
end
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
private
PAGE_EXTENSIONS
=
/\A\.(s?html?|php|asp|cgi|pl)\z/i
.
freeze
PAGE_EXTENSIONS
=
/\A\.(s?html?|php|asp|cgi|pl)\z/i
.
freeze
...
...
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
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
...
@@ -65,7 +65,20 @@ describe 'Merge request > User sees deployment widget', :js do
visit
project_merge_request_path
(
project
,
merge_request
)
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
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'
)
expect
(
page
).
not_to
have_css
(
'.js-deploy-time'
)
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
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