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
df8cc48b
Commit
df8cc48b
authored
Apr 14, 2022
by
Allen Cook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always select an environment's last deployment by deploy date
Changelog: fixed
parent
e377606b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/models/environment.rb
app/models/environment.rb
+1
-1
config/feature_flags/development/env_last_deployment_by_finished_at.yml
..._flags/development/env_last_deployment_by_finished_at.yml
+1
-1
No files found.
app/models/environment.rb
View file @
df8cc48b
...
@@ -26,7 +26,7 @@ class Environment < ApplicationRecord
...
@@ -26,7 +26,7 @@ class Environment < ApplicationRecord
has_many
:self_managed_prometheus_alert_events
,
inverse_of: :environment
has_many
:self_managed_prometheus_alert_events
,
inverse_of: :environment
has_many
:alert_management_alerts
,
class_name:
'AlertManagement::Alert'
,
inverse_of: :environment
has_many
:alert_management_alerts
,
class_name:
'AlertManagement::Alert'
,
inverse_of: :environment
has_one
:last_deployment
,
->
{
Feature
.
enabled?
(
:env_last_deployment_by_finished_at
)
?
success
.
ordered
:
success
.
distinct_on_environment
},
class_name:
'Deployment'
,
inverse_of: :environment
has_one
:last_deployment
,
->
{
Feature
.
enabled?
(
:env_last_deployment_by_finished_at
,
default_enabled: :yaml
)
?
success
.
ordered
:
success
.
distinct_on_environment
},
class_name:
'Deployment'
,
inverse_of: :environment
has_one
:last_visible_deployment
,
->
{
visible
.
distinct_on_environment
},
inverse_of: :environment
,
class_name:
'Deployment'
has_one
:last_visible_deployment
,
->
{
visible
.
distinct_on_environment
},
inverse_of: :environment
,
class_name:
'Deployment'
has_one
:last_visible_deployable
,
through: :last_visible_deployment
,
source:
'deployable'
,
source_type:
'CommitStatus'
,
disable_joins:
true
has_one
:last_visible_deployable
,
through: :last_visible_deployment
,
source:
'deployable'
,
source_type:
'CommitStatus'
,
disable_joins:
true
has_one
:last_visible_pipeline
,
through: :last_visible_deployable
,
source:
'pipeline'
,
disable_joins:
true
has_one
:last_visible_pipeline
,
through: :last_visible_deployable
,
source:
'pipeline'
,
disable_joins:
true
...
...
config/feature_flags/development/env_last_deployment_by_finished_at.yml
View file @
df8cc48b
...
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/357299
...
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/357299
milestone
:
'
14.10'
milestone
:
'
14.10'
type
:
development
type
:
development
group
:
group::release
group
:
group::release
default_enabled
:
fals
e
default_enabled
:
tru
e
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