Commit 47f5da4f authored by Erick Castillo's avatar Erick Castillo

Fix archived corrupted projects not displaying on admin pnael with...

Fix archived corrupted projects not displaying on admin pnael with last_repository_check_failed param
parent e872ea0c
......@@ -9,6 +9,11 @@ class Admin::ProjectsController < Admin::ApplicationController
def index
params[:sort] ||= 'latest_activity_desc'
@sort = params[:sort]
if params[:last_repository_check_failed].present? && params[:archived].nil?
params[:archived] = true
end
@projects = Admin::ProjectsFinder.new(params: params, current_user: current_user).execute
respond_to do |format|
......
---
title: Fix archived corrupted projects not displaying in admin
merge_request: 25171
author: erickcspice
type: fixed
......@@ -24,6 +24,18 @@ describe Admin::ProjectsController do
expect(response.body).not_to match(project.name)
end
it 'retrieves archived and non archived corrupted projects when last_repository_check_failed is true' do
archived_corrupted_project = create(:project, :public, :archived, :last_repository_check_failed, name: 'CorruptedArchived', path: 'A')
corrupted_project = create(:project, :public, :last_repository_check_failed, name: 'CorruptedOnly', path: 'C')
get :index, params: { last_repository_check_failed: true }
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).not_to match(project.name)
expect(response.body).to match(archived_corrupted_project.name)
expect(response.body).to match(corrupted_project.name)
end
it 'does not respond with projects pending deletion' do
pending_delete_project = create(:project, pending_delete: true)
......
......@@ -114,6 +114,10 @@ FactoryBot.define do
archived { true }
end
trait :last_repository_check_failed do
last_repository_check_failed { true }
end
storage_version { Project::LATEST_STORAGE_VERSION }
trait :legacy_storage do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment