chore: pass integrer value of global_user_id instead of raw user_id billing events
What does this merge request do and why?
This MR send global user id instead of raw user id
Ref - https://gitlab.com/groups/gitlab-org/-/epics/18586#note_2871390830
How to set up and validate locally
-
Enable snowplow micro.
-
Apply below patch in gitlab monolith, this will enable gitlab agentic chat in the local gdk.
diff --git a/ee/app/models/concerns/ai/user_authorizable.rb b/ee/app/models/concerns/ai/user_authorizable.rb
index 2d976c5ab0a8..cdfd83299fd2 100644
--- a/ee/app/models/concerns/ai/user_authorizable.rb
+++ b/ee/app/models/concerns/ai/user_authorizable.rb
@@ -101,6 +101,10 @@ def any_group_with_ai_available?
end
def allowed_to_use?(ai_feature, unit_primitive_name: nil, licensed_feature: :ai_features)
+ if Rails.env.development? && [:duo_chat, :duo_agentic_chat].include?(ai_feature)
+ return true
+ end
+
allowed_to_use(ai_feature, unit_primitive_name: unit_primitive_name, licensed_feature: licensed_feature)
.allowed?
end
diff --git a/workhorse/internal/ai_assist/duoworkflow/handler.go b/workhorse/internal/ai_assist/duoworkflow/handler.go
index 37ba485cb5fc..5f8e3cf6df90 100644
--- a/workhorse/internal/ai_assist/duoworkflow/handler.go
+++ b/workhorse/internal/ai_assist/duoworkflow/handler.go
@@ -11,7 +11,11 @@ import (
"github.com/gorilla/websocket"
)
-var upgrader = websocket.Upgrader{}
+var upgrader = websocket.Upgrader{
+ CheckOrigin: func(r *http.Request) bool {
+ return true
+ },
+}
// Handler creates an HTTP handler for Duo Workflow WebSocket connections.
func Handler(rails *api.API) http.Handler {
On finishing of the workflow, billing event will be fired.
Verify that subject field is dertministic hash if it is GitLab team member. Numbered steps to set up and validate the change are strongly suggested.
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed. -
If this change requires executor implementation: verified that issues/MRs exist for both Go executor and Node executor or confirmed that changes are backward-compatible and don't break existing executor functionality.
Edited by Ankit Panchal
