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
762f5222
Commit
762f5222
authored
Feb 03, 2020
by
Corinna Wiesner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude bot users from using a license seat
GitLab generated bot users do not use license seat.
parent
e01f24f8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
36 deletions
+53
-36
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+1
-1
ee/changelogs/unreleased/exclude_bots_from_license_seat_usage.yml
...elogs/unreleased/exclude_bots_from_license_seat_usage.yml
+5
-0
ee/spec/models/user_spec.rb
ee/spec/models/user_spec.rb
+47
-35
No files found.
ee/app/models/ee/user.rb
View file @
762f5222
...
...
@@ -275,7 +275,7 @@ module EE
def
using_license_seat?
return
false
unless
active?
return
false
if
support_bot?
||
ghost
?
return
false
if
internal
?
return
false
unless
License
.
current
if
License
.
current
.
exclude_guests_from_active_count?
...
...
ee/changelogs/unreleased/exclude_bots_from_license_seat_usage.yml
0 → 100644
View file @
762f5222
---
title
:
Exclude GitLab generated bot users from using a license seat
merge_request
:
24275
author
:
type
:
changed
ee/spec/models/user_spec.rb
View file @
762f5222
...
...
@@ -638,13 +638,22 @@ describe User do
end
context
'when user is active'
do
context
'when user is a support bot'
do
let
(
:user
)
{
create
(
:user
,
bot_type:
'support_bot'
)
}
context
'when user is internal'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:bot_type
)
do
User
.
bot_types
.
keys
end
with_them
do
context
'when user is a bot'
do
let
(
:user
)
{
create
(
:user
,
bot_type:
bot_type
)
}
it
'returns false'
do
expect
(
user
.
using_license_seat?
).
to
eq
false
end
end
end
context
'when user is a ghost'
do
let
(
:user
)
{
create
(
:user
,
ghost:
true
)
}
...
...
@@ -653,7 +662,9 @@ describe User do
expect
(
user
.
using_license_seat?
).
to
eq
false
end
end
end
context
'when user is not internal'
do
context
'when license is nil (core/free/default)'
do
before
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
...
...
@@ -697,6 +708,7 @@ describe User do
end
end
end
end
describe
'#using_gitlab_com_seat?'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
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