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
dbf7607a
Commit
dbf7607a
authored
Mar 18, 2021
by
Miguel Rincon
Committed by
Matthias Kaeppler
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove usage of legacy stages
This change removes legacy stages in the pipeline details view.
parent
549ea1d9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
12 deletions
+17
-12
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+4
-5
app/models/ci/stage.rb
app/models/ci/stage.rb
+7
-0
app/views/projects/pipelines/_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+2
-2
app/views/projects/pipelines/show.html.haml
app/views/projects/pipelines/show.html.haml
+1
-1
app/views/projects/stage/_stage.html.haml
app/views/projects/stage/_stage.html.haml
+2
-4
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-0
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
dbf7607a
...
...
@@ -97,7 +97,7 @@ class Projects::PipelinesController < Projects::ApplicationController
Gitlab
::
QueryLimiting
.
disable!
(
'https://gitlab.com/gitlab-org/gitlab/-/issues/26657'
)
respond_to
do
|
format
|
format
.
html
format
.
html
{
render_show
}
format
.
json
do
Gitlab
::
PollingInterval
.
set_header
(
response
,
interval:
POLLING_INTERVAL
)
...
...
@@ -187,10 +187,7 @@ class Projects::PipelinesController < Projects::ApplicationController
def
test_report
respond_to
do
|
format
|
format
.
html
do
render
'show'
end
format
.
html
{
render_show
}
format
.
json
do
render
json:
TestReportSerializer
.
new
(
current_user:
@current_user
)
...
...
@@ -219,6 +216,8 @@ class Projects::PipelinesController < Projects::ApplicationController
end
def
render_show
@stages
=
@pipeline
.
stages
.
with_latest_and_retried_statuses
respond_to
do
|
format
|
format
.
html
do
render
'show'
...
...
app/models/ci/stage.rb
View file @
dbf7607a
...
...
@@ -14,6 +14,7 @@ module Ci
has_many
:statuses
,
class_name:
'CommitStatus'
,
foreign_key: :stage_id
has_many
:latest_statuses
,
->
{
ordered
.
latest
},
class_name:
'CommitStatus'
,
foreign_key: :stage_id
has_many
:retried_statuses
,
->
{
ordered
.
retried
},
class_name:
'CommitStatus'
,
foreign_key: :stage_id
has_many
:processables
,
class_name:
'Ci::Processable'
,
foreign_key: :stage_id
has_many
:builds
,
foreign_key: :stage_id
has_many
:bridges
,
foreign_key: :stage_id
...
...
@@ -21,6 +22,12 @@ module Ci
scope
:ordered
,
->
{
order
(
position: :asc
)
}
scope
:in_pipelines
,
->
(
pipelines
)
{
where
(
pipeline:
pipelines
)
}
scope
:by_name
,
->
(
names
)
{
where
(
name:
names
)
}
scope
:with_latest_and_retried_statuses
,
->
do
includes
(
latest_statuses:
[
:pipeline
,
project: :namespace
],
retried_statuses:
[
:pipeline
,
project: :namespace
]
)
end
with_options
unless: :importing?
do
validates
:project
,
presence:
true
...
...
app/views/projects/pipelines/_with_tabs.html.haml
View file @
dbf7607a
...
...
@@ -28,7 +28,7 @@
#js-pipeline-graph-vue
#js-tab-builds
.tab-pane
-
if
pipeline
.
legacy_
stages
.
present?
-
if
stages
.
present?
.table-holder.pipeline-holder
%table
.table.ci-table.pipeline
%thead
...
...
@@ -39,7 +39,7 @@
%th
%th
=
_
(
'Coverage'
)
%th
=
render
partial:
"projects/stage/stage"
,
collection:
pipeline
.
legacy_
stages
,
as: :stage
=
render
partial:
"projects/stage/stage"
,
collection:
stages
,
as: :stage
-
if
@pipeline
.
failed_builds
.
present?
#js-tab-failures
.build-failures.tab-pane.build-page
...
...
app/views/projects/pipelines/show.html.haml
View file @
dbf7607a
...
...
@@ -24,6 +24,6 @@
-
lint_link_start
=
'<a href="%{url}">'
.
html_safe
%
{
url:
lint_link_url
}
=
s_
(
'You can also test your %{gitlab_ci_yml} in %{lint_link_start}CI Lint%{lint_link_end}'
).
html_safe
%
{
gitlab_ci_yml:
'.gitlab-ci.yml'
,
lint_link_start:
lint_link_start
,
lint_link_end:
'</a>'
.
html_safe
}
=
render
"projects/pipelines/with_tabs"
,
pipeline:
@pipeline
,
pipeline_has_errors:
pipeline_has_errors
=
render
"projects/pipelines/with_tabs"
,
pipeline:
@pipeline
,
stages:
@stages
,
pipeline_has_errors:
pipeline_has_errors
.js-pipeline-details-vue
{
data:
{
endpoint:
project_pipeline_path
(
@project
,
@pipeline
,
format: :json
),
metrics_path:
namespace_project_ci_prometheus_metrics_histograms_path
(
namespace_id:
@project
.
namespace
,
project_id:
@project
,
format: :json
),
pipeline_project_path:
@project
.
full_path
,
pipeline_iid:
@pipeline
.
iid
,
graphql_resource_etag:
graphql_etag_pipeline_path
(
@pipeline
)
}
}
app/views/projects/stage/_stage.html.haml
View file @
dbf7607a
-
stage
=
stage
.
present
(
current_user:
current_user
)
%tr
%th
{
colspan:
10
}
%strong
...
...
@@ -8,8 +6,8 @@
=
ci_icon_for_status
(
stage
.
status
)
=
stage
.
name
.
titleize
=
render
stage
.
latest_
ordered_
statuses
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
allow_retry:
true
=
render
stage
.
retried_
ordered_
statuses
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
retried:
true
=
render
stage
.
latest_statuses
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
allow_retry:
true
=
render
stage
.
retried_statuses
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
retried:
true
%tr
%td
{
colspan:
10
}
spec/lib/gitlab/import_export/all_models.yml
View file @
dbf7607a
...
...
@@ -269,6 +269,7 @@ stages:
-
builds
-
bridges
-
latest_statuses
-
retried_statuses
statuses
:
-
project
-
pipeline
...
...
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