gitlab-username_bot_identifier 2.0.7 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitlab/username_bot_identifier.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bcd25a4f654ae48504ded55c5f5b9f6e7d4fbea9e4e8e32d359652545019d4e8
|
|
4
|
+
data.tar.gz: 9bda6ec64ed3526f8def063d463ad79cacb67c598a57b6aa4a3c3233b24d2850
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81dcff4b62c196e9ed174f4c405e4d6be2174cf0b54eaf4e076aae6bb344bfad381c84aa665f651b8aaf0c407d2912f9d26fd1b96fcfd8af71137f69fc0b80cf
|
|
7
|
+
data.tar.gz: 702df69d5c4135c7965a3d3146fb5d9d48f469e640e455be696b2748b3be8cb71ce168ad734ccbf9b5507557b72788d280cf401bda4aeaf14381baaba059c008
|
|
@@ -5,6 +5,7 @@ module Gitlab
|
|
|
5
5
|
class UsernameBotIdentifier
|
|
6
6
|
KNOWN_GITLAB_COM_BOT_USERNAMES = %w[
|
|
7
7
|
codeowner-maintainer-or-manager
|
|
8
|
+
contributors.gitlab.com
|
|
8
9
|
digitalexperience-service
|
|
9
10
|
duo-developer
|
|
10
11
|
employment-bot
|
|
@@ -43,6 +44,10 @@ module Gitlab
|
|
|
43
44
|
# Used as best practice by GitLab team members when creating "service accounts"
|
|
44
45
|
KNOWN_SERVICE_ACCOUNT_REGEX = /^gl-service-[-\w]+$/.freeze
|
|
45
46
|
|
|
47
|
+
# GitLab Duo and AI agent accounts start with duo-, duo_, ai-, or ai_
|
|
48
|
+
# Examples: duo-developer-gitlab-com, duo_fix_ci_cd_pipeline, ai-code-reviewer, ai_assistant
|
|
49
|
+
GITLAB_DUO_AGENT_REGEX = /^(duo[-_]|ai[-_])/.freeze
|
|
50
|
+
|
|
46
51
|
def initialize(username)
|
|
47
52
|
@username = username
|
|
48
53
|
end
|
|
@@ -80,6 +85,10 @@ module Gitlab
|
|
|
80
85
|
username.match?(SERVICE_ACCOUNT_REGEX)
|
|
81
86
|
end
|
|
82
87
|
|
|
88
|
+
def gitlab_duo_service_account?
|
|
89
|
+
username.match?(GITLAB_DUO_AGENT_REGEX)
|
|
90
|
+
end
|
|
91
|
+
|
|
83
92
|
def project_or_group_access_token?
|
|
84
93
|
project_access_token? ||
|
|
85
94
|
group_access_token?
|
|
@@ -89,7 +98,8 @@ module Gitlab
|
|
|
89
98
|
known_bot? ||
|
|
90
99
|
known_service_account? ||
|
|
91
100
|
project_or_group_access_token? ||
|
|
92
|
-
service_account?
|
|
101
|
+
service_account? ||
|
|
102
|
+
gitlab_duo_service_account?
|
|
93
103
|
end
|
|
94
104
|
|
|
95
105
|
def ignorable_account?
|
|
@@ -97,7 +107,8 @@ module Gitlab
|
|
|
97
107
|
ghost? ||
|
|
98
108
|
known_service_account? ||
|
|
99
109
|
project_or_group_access_token? ||
|
|
100
|
-
service_account?
|
|
110
|
+
service_account? ||
|
|
111
|
+
gitlab_duo_service_account?
|
|
101
112
|
end
|
|
102
113
|
end
|
|
103
114
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-username_bot_identifier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lee Tickett
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|