@@ -46,6 +46,34 @@ def queue(args)
4646 )
4747 end
4848
49+ def connect
50+ git_adapter = KnapsackPro ::RepositoryAdapters ::GitAdapter . new
51+ repository_adapter = KnapsackPro ::RepositoryAdapterInitiator . call
52+
53+ request_hash = {
54+ attempt_connect_to_queue : true ,
55+ batch_uuid : SecureRandom . uuid ,
56+ branch : KnapsackPro ::Crypto ::BranchEncryptor . call ( repository_adapter . branch ) ,
57+ build_author : git_adapter . build_author ,
58+ can_initialize_queue : true ,
59+ commit_authors : git_adapter . commit_authors ,
60+ commit_hash : repository_adapter . commit_hash ,
61+ fixed_queue_split : KnapsackPro ::Config ::Env . fixed_queue_split_? ,
62+ node_index : KnapsackPro ::Config ::Env . ci_node_index ,
63+ node_total : KnapsackPro ::Config ::Env . ci_node_total ,
64+ node_uuid : SecureRandom . uuid ,
65+ skip_pull : true ,
66+ test_queue_id : KnapsackPro ::Config ::Env . test_queue_id ,
67+ user_seat : KnapsackPro ::Config ::Env . masked_user_seat ,
68+ }
69+
70+ action_class . new (
71+ endpoint_path : '/v2/queues/queue' ,
72+ http_method : :post ,
73+ request_hash : request_hash
74+ )
75+ end
76+
4977 def initialize ( paths )
5078 git_adapter = KnapsackPro ::RepositoryAdapters ::GitAdapter . new
5179 repository_adapter = KnapsackPro ::RepositoryAdapterInitiator . call
0 commit comments