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
ce47e982
Commit
ce47e982
authored
Mar 23, 2022
by
Allen Cook
Committed by
Shinya Maeda
Mar 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure ci_environment_status always return latest deployment status
Changelog: fixed
parent
94f1cb1d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/models/environment_status.rb
app/models/environment_status.rb
+1
-1
spec/models/environment_status_spec.rb
spec/models/environment_status_spec.rb
+7
-0
No files found.
app/models/environment_status.rb
View file @
ce47e982
...
...
@@ -51,7 +51,7 @@ class EnvironmentStatus
def
deployment
strong_memoize
(
:deployment
)
do
Deployment
.
where
(
environment:
environment
).
find_by_sha
(
sha
)
Deployment
.
where
(
environment:
environment
).
ordered
.
find_by_sha
(
sha
)
end
end
...
...
spec/models/environment_status_spec.rb
View file @
ce47e982
...
...
@@ -34,6 +34,13 @@ RSpec.describe EnvironmentStatus do
subject
{
environment_status
.
deployment
}
it
{
is_expected
.
to
eq
(
deployment
)
}
context
'multiple deployments'
do
it
{
new_deployment
=
create
(
:deployment
,
:succeed
,
environment:
deployment
.
environment
,
sha:
deployment
.
sha
)
is_expected
.
to
eq
(
new_deployment
)
}
end
end
# $ git diff --stat pages-deploy-target...pages-deploy
...
...
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