Skip to content
代码片段 群组 项目
提交 8c628138 编辑于 作者: Fabio Pitino's avatar Fabio Pitino
浏览文件

Merge branch '425137-remove-unused-job-values-fetched-in-controllers-2' into 'master'

Resolve "Remove unused job values fetched in controllers"

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131881



Merged-by: default avatarFabio Pitino <fpitino@gitlab.com>
Approved-by: default avatarFabio Pitino <fpitino@gitlab.com>
Approved-by: default avatarDrew Blessing <drew@gitlab.com>
Approved-by: default avatarSiddharth Dungarwal <sdungarwal@gitlab.com>
Co-authored-by: default avatarpanoskanell <pkanellidis@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -10,15 +10,7 @@ class Admin::JobsController < Admin::ApplicationController
push_frontend_feature_flag(:admin_jobs_filter_runner_type, type: :ops)
end
def index
# We need all builds for tabs counters
@all_builds = Ci::JobsFinder.new(current_user: current_user).execute
@scope = params[:scope]
@builds = Ci::JobsFinder.new(current_user: current_user, params: params).execute
@builds = @builds.eager_load_everything
@builds = @builds.page(params[:page]).per(BUILDS_PER_PAGE).without_count
end
def index; end
def cancel_all
Ci::Build.running_or_pending.each(&:cancel)
......
......@@ -27,15 +27,7 @@ class Projects::JobsController < Projects::ApplicationController
feature_category :continuous_integration
urgency :low
def index
# We need all builds for tabs counters
@all_builds = Ci::JobsFinder.new(current_user: current_user, project: @project).execute
@scope = params[:scope]
@builds = Ci::JobsFinder.new(current_user: current_user, project: @project, params: params).execute
@builds = @builds.eager_load_everything
@builds = @builds.page(params[:page]).per(30).without_count
end
def index; end
def show
if @build.instance_of?(::Ci::Bridge)
......
......@@ -14,8 +14,6 @@
get :index
expect(response).to have_gitlab_http_status(:ok)
expect(assigns(:builds)).to be_a(Kaminari::PaginatableWithoutCount)
expect(assigns(:builds).count).to be(1)
end
end
......
......@@ -47,7 +47,6 @@
it 'has only pending builds' do
expect(response).to have_gitlab_http_status(:ok)
expect(assigns(:builds).first.status).to eq('pending')
end
end
......@@ -60,7 +59,6 @@
it 'has only running jobs' do
expect(response).to have_gitlab_http_status(:ok)
expect(assigns(:builds).first.status).to eq('running')
end
end
......@@ -73,7 +71,6 @@
it 'has only finished jobs' do
expect(response).to have_gitlab_http_status(:ok)
expect(assigns(:builds).first.status).to eq('success')
end
end
......@@ -89,7 +86,6 @@
it 'redirects to the page' do
expect(response).to have_gitlab_http_status(:ok)
expect(assigns(:builds).current_page).to eq(last_page)
end
end
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册