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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce68b4df4c7271218f295ea79084122c5cd769228a9c92b5994087161ea134b3
4
- data.tar.gz: 5973154677445535b60f5f9c955cd0fe85a0756df77392d3d61b3e1f1c10ed35
3
+ metadata.gz: bcd25a4f654ae48504ded55c5f5b9f6e7d4fbea9e4e8e32d359652545019d4e8
4
+ data.tar.gz: 9bda6ec64ed3526f8def063d463ad79cacb67c598a57b6aa4a3c3233b24d2850
5
5
  SHA512:
6
- metadata.gz: eae458b55276c458a49505b667a836ed961e40a68bc61f143a03f7cfea3e41b9cad6063c9626fb3bb8a3ed8410f48858faab789bb4e30fd4f929fe4212be5319
7
- data.tar.gz: eeab5e3e6fd3795731cd9fa996494bd2b444076a9096abdc33463a50288b5b2953df18d91550e8de67cb87d504204139280b781aeca2a50efabaaaa000f351aa
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.7
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: 2025-10-16 00:00:00.000000000 Z
11
+ date: 2026-01-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: