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
2f6374cd
Commit
2f6374cd
authored
Apr 18, 2022
by
huzaifaiftikhar1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle case when project statistics is nil
parent
9b47c95b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/project.rb
app/models/project.rb
+1
-1
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+2
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/models/project.rb
View file @
2f6374cd
...
...
@@ -2869,7 +2869,7 @@ class Project < ApplicationRecord
end
def
inactive?
statistics
.
storage_size
>
::
Gitlab
::
CurrentSettings
.
inactive_projects_min_size_mb
.
megabytes
&&
(
statistics
||
build_statistics
)
.
storage_size
>
::
Gitlab
::
CurrentSettings
.
inactive_projects_min_size_mb
.
megabytes
&&
last_activity_at
<
::
Gitlab
::
CurrentSettings
.
inactive_projects_send_warning_email_after_months
.
months
.
ago
end
...
...
ee/spec/models/project_spec.rb
View file @
2f6374cd
...
...
@@ -3357,14 +3357,14 @@ RSpec.describe Project do
context
'when project belongs to free namespace'
do
let_it_be
(
:no_plan_group
)
{
create
(
:group_with_plan
,
plan:
nil
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
no_plan_group
)
}
let_it_be
_with_reload
(
:project
)
{
create
(
:project
,
namespace:
no_plan_group
)
}
it_behaves_like
'returns true if project is inactive'
end
end
context
'when not Gitlab.com'
do
let_it_be
(
:project
)
{
create
(
:project
,
name:
'test-project'
)
}
let_it_be
_with_reload
(
:project
)
{
create
(
:project
,
name:
'test-project'
)
}
it_behaves_like
'returns true if project is inactive'
end
...
...
spec/models/project_spec.rb
View file @
2f6374cd
...
...
@@ -8179,7 +8179,7 @@ RSpec.describe Project, factory_default: :keep do
end
describe
'#inactive?'
do
let_it_be
(
:project
)
{
create
(
:project
,
name:
'test-project'
)
}
let_it_be
_with_reload
(
:project
)
{
create
(
:project
,
name:
'test-project'
)
}
it_behaves_like
'returns true if project is inactive'
end
...
...
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