diff --git a/aggregatedpool/activity.go b/aggregatedpool/activity.go index 11c3102f..2451ebdc 100644 --- a/aggregatedpool/activity.go +++ b/aggregatedpool/activity.go @@ -7,10 +7,10 @@ import ( "unsafe" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/goridge/v3/pkg/frame" - "github.com/roadrunner-server/pool/payload" - "github.com/temporalio/roadrunner-temporal/v5/api" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/roadrunner-server/goridge/v4/pkg/frame" + "github.com/roadrunner-server/pool/v2/payload" + "github.com/temporalio/roadrunner-temporal/v6/api" + "github.com/temporalio/roadrunner-temporal/v6/internal" commonpb "go.temporal.io/api/common/v1" tActivity "go.temporal.io/sdk/activity" "go.temporal.io/sdk/temporal" diff --git a/aggregatedpool/handler.go b/aggregatedpool/handler.go index 3afce609..e373c325 100644 --- a/aggregatedpool/handler.go +++ b/aggregatedpool/handler.go @@ -8,9 +8,9 @@ import ( "time" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/goridge/v3/pkg/frame" - "github.com/roadrunner-server/pool/payload" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/roadrunner-server/goridge/v4/pkg/frame" + "github.com/roadrunner-server/pool/v2/payload" + "github.com/temporalio/roadrunner-temporal/v6/internal" commonpb "go.temporal.io/api/common/v1" bindings "go.temporal.io/sdk/internalbindings" "go.temporal.io/sdk/temporal" diff --git a/aggregatedpool/interceptor.go b/aggregatedpool/interceptor.go index 4da55d3c..59e3e355 100644 --- a/aggregatedpool/interceptor.go +++ b/aggregatedpool/interceptor.go @@ -3,7 +3,7 @@ package aggregatedpool import ( "context" - "github.com/temporalio/roadrunner-temporal/v5/api" + "github.com/temporalio/roadrunner-temporal/v6/api" "go.temporal.io/sdk/interceptor" ) diff --git a/aggregatedpool/local_activity.go b/aggregatedpool/local_activity.go index ebd3fe1c..46627f42 100644 --- a/aggregatedpool/local_activity.go +++ b/aggregatedpool/local_activity.go @@ -7,10 +7,10 @@ import ( "github.com/google/uuid" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/goridge/v3/pkg/frame" - "github.com/roadrunner-server/pool/payload" - "github.com/temporalio/roadrunner-temporal/v5/api" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/roadrunner-server/goridge/v4/pkg/frame" + "github.com/roadrunner-server/pool/v2/payload" + "github.com/temporalio/roadrunner-temporal/v6/api" + "github.com/temporalio/roadrunner-temporal/v6/internal" commonpb "go.temporal.io/api/common/v1" tActivity "go.temporal.io/sdk/activity" "go.temporal.io/sdk/temporal" diff --git a/aggregatedpool/workers.go b/aggregatedpool/workers.go index fcbc9c45..c4d41f33 100644 --- a/aggregatedpool/workers.go +++ b/aggregatedpool/workers.go @@ -6,8 +6,8 @@ import ( "github.com/google/uuid" "github.com/roadrunner-server/errors" - "github.com/temporalio/roadrunner-temporal/v5/api" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/temporalio/roadrunner-temporal/v6/api" + "github.com/temporalio/roadrunner-temporal/v6/internal" tActivity "go.temporal.io/sdk/activity" temporalClient "go.temporal.io/sdk/client" "go.temporal.io/sdk/converter" diff --git a/aggregatedpool/workers_test.go b/aggregatedpool/workers_test.go index a98c3e0d..be378ba3 100644 --- a/aggregatedpool/workers_test.go +++ b/aggregatedpool/workers_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/temporalio/roadrunner-temporal/v5/api" + "github.com/temporalio/roadrunner-temporal/v6/api" commonpb "go.temporal.io/api/common/v1" "go.temporal.io/sdk/converter" sdkinterceptor "go.temporal.io/sdk/interceptor" diff --git a/aggregatedpool/workflow.go b/aggregatedpool/workflow.go index 3d43d8bd..93f0ecc3 100644 --- a/aggregatedpool/workflow.go +++ b/aggregatedpool/workflow.go @@ -9,12 +9,12 @@ import ( "time" "github.com/google/uuid" - "github.com/roadrunner-server/pool/payload" - "github.com/temporalio/roadrunner-temporal/v5/api" - "github.com/temporalio/roadrunner-temporal/v5/canceller" - "github.com/temporalio/roadrunner-temporal/v5/internal" - "github.com/temporalio/roadrunner-temporal/v5/queue" - "github.com/temporalio/roadrunner-temporal/v5/registry" + "github.com/roadrunner-server/pool/v2/payload" + "github.com/temporalio/roadrunner-temporal/v6/api" + "github.com/temporalio/roadrunner-temporal/v6/canceller" + "github.com/temporalio/roadrunner-temporal/v6/internal" + "github.com/temporalio/roadrunner-temporal/v6/queue" + "github.com/temporalio/roadrunner-temporal/v6/registry" commonpb "go.temporal.io/api/common/v1" enumspb "go.temporal.io/api/enums/v1" temporalClient "go.temporal.io/sdk/client" diff --git a/api/interfaces.go b/api/interfaces.go index 7abb0e19..c6dc3190 100644 --- a/api/interfaces.go +++ b/api/interfaces.go @@ -4,15 +4,15 @@ import ( "context" "time" - "github.com/roadrunner-server/pool/payload" - "github.com/roadrunner-server/pool/pool" - "github.com/roadrunner-server/pool/state/process" - "github.com/roadrunner-server/pool/worker" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/roadrunner-server/pool/v2/payload" + "github.com/roadrunner-server/pool/v2/pool" + "github.com/roadrunner-server/pool/v2/state/process" + "github.com/roadrunner-server/pool/v2/worker" + "github.com/temporalio/roadrunner-temporal/v6/internal" "go.temporal.io/sdk/interceptor" "go.uber.org/zap" - staticPool "github.com/roadrunner-server/pool/pool/static_pool" + staticPool "github.com/roadrunner-server/pool/v2/pool/static_pool" ) type Interceptor interface { diff --git a/config.go b/config.go index 9ac789e4..6eda6301 100644 --- a/config.go +++ b/config.go @@ -6,7 +6,7 @@ import ( "time" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/pool/pool" + "github.com/roadrunner-server/pool/v2/pool" ) // Config of the temporal client and dependent services. diff --git a/go.mod b/go.mod index bdf5a930..244bff3d 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,20 @@ -module github.com/temporalio/roadrunner-temporal/v5 +module github.com/temporalio/roadrunner-temporal/v6 -go 1.26.3 +go 1.26.4 require ( github.com/goccy/go-json v0.10.6 github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect - github.com/roadrunner-server/api/v4 v4.24.0 github.com/roadrunner-server/endure/v2 v2.6.2 github.com/roadrunner-server/errors v1.5.0 github.com/roadrunner-server/events v1.0.1 - github.com/roadrunner-server/pool v1.1.3 github.com/stretchr/testify v1.11.1 github.com/uber-go/tally/v4 v4.1.17 - go.temporal.io/api v1.62.13 + go.temporal.io/api v1.62.14 go.temporal.io/sdk v1.44.1 go.temporal.io/sdk/contrib/tally v0.2.0 - go.temporal.io/server v1.31.0 + go.temporal.io/server v1.31.1 go.uber.org/zap v1.28.0 google.golang.org/protobuf v1.36.11 ) @@ -39,7 +37,6 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.68.1 // indirect github.com/prometheus/procfs v0.20.1 // indirect - github.com/roadrunner-server/goridge/v3 v3.8.3 github.com/robfig/cron v1.2.0 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect @@ -50,17 +47,25 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/net v0.56.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/text v0.38.0 // indirect golang.org/x/time v0.15.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad // indirect google.golang.org/grpc v1.81.1 gopkg.in/yaml.v3 v3.0.1 // indirect ) +require ( + connectrpc.com/connect v1.20.0 + github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12.0.20260610203904-09df89976edc + github.com/roadrunner-server/api-plugins/v6 v6.0.0-beta.2 + github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2 + github.com/roadrunner-server/pool/v2 v2.0.0-beta.1 +) + require ( github.com/nexus-rpc/nexus-proto-annotations v0.1.0 // indirect go.opentelemetry.io/otel v1.44.0 // indirect diff --git a/go.sum b/go.sum index 25ecf3ee..994a85b3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +connectrpc.com/connect v1.20.0 h1:6TNDAB+WeNd2uolWNlYczB5E0KNNaVMNUEx8JEUsPmQ= +connectrpc.com/connect v1.20.0/go.mod h1:A2ygJrukXwWy32vkCAAHNVguZrqZ+jeZ9rGRnGR4dN4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -173,18 +175,20 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= -github.com/roadrunner-server/api/v4 v4.24.0 h1:99lN8nu7aD76d1fru4+MZkf9m8+YJ22Jy+qVoDwn4OY= -github.com/roadrunner-server/api/v4 v4.24.0/go.mod h1:O0LputszJr6NXMw0SKyWaiS/C9K6JVh9HV2BHKXeosA= +github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12.0.20260610203904-09df89976edc h1:tJhOZ31bN0HVO4JTgkcjHK1MLu8Waee+rFnbx5AjXyQ= +github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12.0.20260610203904-09df89976edc/go.mod h1:prGWJ2GoF5YD5PIG7Tb6VKulU3bWoFwr9DCwgxheb80= +github.com/roadrunner-server/api-plugins/v6 v6.0.0-beta.2 h1:GqsZzWQ5jMXRF1O/b8IqFz9PLpS7Ui0K4OyACLql2MI= +github.com/roadrunner-server/api-plugins/v6 v6.0.0-beta.2/go.mod h1:2v4yUK5Kvbvq8C3IkDoBkuamq9h+7i/JLjyf7k1j5JM= github.com/roadrunner-server/endure/v2 v2.6.2 h1:sIB4kTyE7gtT3fDhuYWUYn6Vt/dcPtiA6FoNS1eS+84= github.com/roadrunner-server/endure/v2 v2.6.2/go.mod h1:t/2+xpNYgGBwhzn83y2MDhvhZ19UVq1REcvqn7j7RB8= github.com/roadrunner-server/errors v1.5.0 h1:unG7LKIZrSzkCCF3YLRLA5VyqE0KKomofXVJUXJe00g= github.com/roadrunner-server/errors v1.5.0/go.mod h1:g9fo/T2C13cWRDR9PW1r0ZAOSQfNhWAZawyfkGiaHuI= github.com/roadrunner-server/events v1.0.1 h1:waCkKhxhzdK3VcI1xG22l+h+0J+Nfdpxjhyy01Un+kI= github.com/roadrunner-server/events v1.0.1/go.mod h1:WZRqoEVaFm209t52EuoT7ISUtvX6BrCi6bI/7pjkVC0= -github.com/roadrunner-server/goridge/v3 v3.8.3 h1:XmjrOFnI6ZbQTPaP39DEk8KwLUNTgjluK3pcZaW6ixQ= -github.com/roadrunner-server/goridge/v3 v3.8.3/go.mod h1:4TZU8zgkKIZCsH51qwGMpvyXCT59u/8z6q8sCe4ZGAQ= -github.com/roadrunner-server/pool v1.1.3 h1:KMsiL6yuYBWGk73bdO0akwP+fJ63bxDF972JukCGsxI= -github.com/roadrunner-server/pool v1.1.3/go.mod h1:8ceC7NvZKJRciv+KJmcyk5CeDugoel6GD+crm5kBFW0= +github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2 h1:MgH6oiSgcl+vphsQ6JpyedkXQ/DPf8zVpn0z7rdBp10= +github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2/go.mod h1:Wv9CBO9VIU92e5iZIuehLHKakXgMkOzxoT4/oHDjIUA= +github.com/roadrunner-server/pool/v2 v2.0.0-beta.1 h1:jpYXFtdD6QGAdAGPgMxrNi3j1CegCRpb2y+A+3GnXFA= +github.com/roadrunner-server/pool/v2 v2.0.0-beta.1/go.mod h1:Bo1wT7RtL3eyQHXBUohNhtj/yAmRt6Rq8smuBg5pWkY= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -241,15 +245,15 @@ go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/ go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.temporal.io/api v1.5.0/go.mod h1:BqKxEJJYdxb5dqf0ODfzfMxh8UEQ5L3zKS51FiIYYkA= -go.temporal.io/api v1.62.13 h1:xMa8Nt5oAMX+LvlCJA44wjTCc1H09i2rG9poB1/xvH4= -go.temporal.io/api v1.62.13/go.mod h1:0k75tRljEuELWGeXjEZZO7zYqBln4+1FrG6+IMOMy7Q= +go.temporal.io/api v1.62.14 h1:Tree3eqoKRt5Vv+nvYHMPp/ROiGmSOTtFUD9d0w8yJE= +go.temporal.io/api v1.62.14/go.mod h1:0k75tRljEuELWGeXjEZZO7zYqBln4+1FrG6+IMOMy7Q= go.temporal.io/sdk v1.12.0/go.mod h1:lSp3lH1lI0TyOsus0arnO3FYvjVXBZGi/G7DjnAnm6o= go.temporal.io/sdk v1.44.1 h1:Mt2OZLZpqkzDIdg9YyQzO0Rb/HqCDnnqHlIAGAJ5gqM= go.temporal.io/sdk v1.44.1/go.mod h1:vkApR12F9/Y8OR+hkxe7WyXQFuCX6clhzqnAk6rzDAM= go.temporal.io/sdk/contrib/tally v0.2.0 h1:XnTJIQcjOv+WuCJ1u8Ve2nq+s2H4i/fys34MnWDRrOo= go.temporal.io/sdk/contrib/tally v0.2.0/go.mod h1:1kpSuCms/tHeJQDPuuKkaBsMqfHnIIRnCtUYlPNXxuE= -go.temporal.io/server v1.31.0 h1:FKLodreaMXUxYc3zr6xxwxtpGz1WH/t7O0IWxV1d1x0= -go.temporal.io/server v1.31.0/go.mod h1:MTQAw8uMU3ooSHyg/62JsNu/j8lK34SfKMTXkexYcw8= +go.temporal.io/server v1.31.1 h1:3rxA0Ls21hLOseKsyzm7e+IrVLuaDsuri0DGX+chIqU= +go.temporal.io/server v1.31.1/go.mod h1:kOOpZs6WMcLuVmlu0uH+dVD2Ul1d4hGjmGpHjxfz2EI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -297,8 +301,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -311,8 +315,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -334,8 +338,8 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -343,8 +347,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= @@ -375,10 +379,10 @@ google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad h1:3iLyITS/sySRwbUKoC7ogfj2Yr1Cjs0pfaRKj5U5HEw= +google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad/go.mod h1:KdNqO+rCIWgFumrNBSEDlDNrkrQnpkax7Tv1WxNY8V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad h1:45WmJvIV6C2+O/jjLkPUH+F3aOj/1miDoU2DD0+NWbg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= diff --git a/go.work b/go.work index a819d87f..3ca56c09 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.26.3 +go 1.26.4 use ( . diff --git a/go.work.sum b/go.work.sum index 9d485283..24084c55 100644 --- a/go.work.sum +++ b/go.work.sum @@ -595,6 +595,8 @@ codeberg.org/go-latex/latex v0.1.0 h1:hoGO86rIbWVyjtlDLzCqZPjNykpWQ9YuTZqAzPcfL3 codeberg.org/go-latex/latex v0.1.0/go.mod h1:LA0q/AyWIYrqVd+A9Upkgsb+IqPcmSTKc9Dny04MHMw= codeberg.org/go-pdf/fpdf v0.10.0 h1:u+w669foDDx5Ds43mpiiayp40Ov6sZalgcPMDBcZRd4= codeberg.org/go-pdf/fpdf v0.10.0/go.mod h1:Y0DGRAdZ0OmnZPvjbMp/1bYxmIPxm0ws4tfoPOc4LjU= +connectrpc.com/connect v1.19.2 h1:McQ83FGdzL+t60peksi0gXC7MQ/iLKgLduAnThbM0mo= +connectrpc.com/connect v1.19.2/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= contrib.go.opencensus.io/exporter/stackdriver v0.13.15-0.20230702191903-2de6d2748484 h1:xRc46S76eyn4ZF3jWX8I+aUSKVLw5EQ1aDvHwfV5W1o= contrib.go.opencensus.io/exporter/stackdriver v0.13.15-0.20230702191903-2de6d2748484/go.mod h1:uxw+4/0SiKbbVSD/F2tk5pJTdVcfIBBcsQ8gwcu4X+E= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= diff --git a/info.go b/info.go index e4d5592c..5623cb4e 100644 --- a/info.go +++ b/info.go @@ -5,10 +5,10 @@ import ( "time" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/goridge/v3/pkg/frame" - "github.com/roadrunner-server/pool/payload" - "github.com/temporalio/roadrunner-temporal/v5/api" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/roadrunner-server/goridge/v4/pkg/frame" + "github.com/roadrunner-server/pool/v2/payload" + "github.com/temporalio/roadrunner-temporal/v6/api" + "github.com/temporalio/roadrunner-temporal/v6/internal" ) func WorkerInfo(c api.Codec, p api.Pool, rrVersion string, wwPID int) ([]*internal.WorkerInfo, error) { diff --git a/internal.go b/internal.go index 16584226..3982613f 100644 --- a/internal.go +++ b/internal.go @@ -7,11 +7,11 @@ import ( "time" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/pool/pool" - "github.com/temporalio/roadrunner-temporal/v5/aggregatedpool" - "github.com/temporalio/roadrunner-temporal/v5/dataconverter" - "github.com/temporalio/roadrunner-temporal/v5/internal/codec/proto" - "github.com/temporalio/roadrunner-temporal/v5/internal/logger" + "github.com/roadrunner-server/pool/v2/pool" + "github.com/temporalio/roadrunner-temporal/v6/aggregatedpool" + "github.com/temporalio/roadrunner-temporal/v6/dataconverter" + "github.com/temporalio/roadrunner-temporal/v6/internal/codec/proto" + "github.com/temporalio/roadrunner-temporal/v6/internal/logger" tclient "go.temporal.io/sdk/client" "go.temporal.io/sdk/converter" "go.temporal.io/sdk/worker" @@ -19,7 +19,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" - staticPool "github.com/roadrunner-server/pool/pool/static_pool" + staticPool "github.com/roadrunner-server/pool/v2/pool/static_pool" ) const ( diff --git a/internal/codec/proto/proto.go b/internal/codec/proto/proto.go index d3e4a7e9..8cf15a8e 100644 --- a/internal/codec/proto/proto.go +++ b/internal/codec/proto/proto.go @@ -4,10 +4,10 @@ import ( "sync" "github.com/goccy/go-json" - protocolV1 "github.com/roadrunner-server/api/v4/build/temporal/v1" + protocolV1 "github.com/roadrunner-server/api-go/v6/temporal/v1" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/pool/payload" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/roadrunner-server/pool/v2/payload" + "github.com/temporalio/roadrunner-temporal/v6/internal" "go.temporal.io/sdk/converter" "go.uber.org/zap" "google.golang.org/protobuf/proto" diff --git a/metrics.go b/metrics.go index c54c9347..33e7e186 100644 --- a/metrics.go +++ b/metrics.go @@ -8,8 +8,8 @@ import ( "github.com/cactus/go-statsd-client/v5/statsd" prom "github.com/prometheus/client_golang/prometheus" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/pool/fsm" - "github.com/roadrunner-server/pool/state/process" + "github.com/roadrunner-server/pool/v2/fsm" + "github.com/roadrunner-server/pool/v2/state/process" "github.com/uber-go/tally/v4" "github.com/uber-go/tally/v4/prometheus" tclient "go.temporal.io/sdk/client" diff --git a/plugin.go b/plugin.go index 340b4061..303282b4 100644 --- a/plugin.go +++ b/plugin.go @@ -11,20 +11,23 @@ import ( "sync/atomic" "time" + "net/http" + + "github.com/roadrunner-server/api-go/v6/temporal/v1/temporalV1connect" "github.com/roadrunner-server/endure/v2/dep" "github.com/roadrunner-server/errors" "github.com/roadrunner-server/events" - "github.com/roadrunner-server/pool/state/process" - "github.com/temporalio/roadrunner-temporal/v5/aggregatedpool" - "github.com/temporalio/roadrunner-temporal/v5/api" - "github.com/temporalio/roadrunner-temporal/v5/internal" - "github.com/temporalio/roadrunner-temporal/v5/internal/codec/proto" + "github.com/roadrunner-server/pool/v2/state/process" + "github.com/temporalio/roadrunner-temporal/v6/aggregatedpool" + "github.com/temporalio/roadrunner-temporal/v6/api" + "github.com/temporalio/roadrunner-temporal/v6/internal" + "github.com/temporalio/roadrunner-temporal/v6/internal/codec/proto" tclient "go.temporal.io/sdk/client" "go.temporal.io/sdk/converter" "go.temporal.io/sdk/worker" "go.uber.org/zap" - "github.com/roadrunner-server/pool/pool/static_pool" + "github.com/roadrunner-server/pool/v2/pool/static_pool" ) const ( @@ -417,8 +420,10 @@ func (p *Plugin) Name() string { return pluginName } -func (p *Plugin) RPC() any { - return &rpc{plugin: p, client: p.temporal.client} +// RPC returns the TemporalService connect handler mounted on the rpc plugin's +// server. +func (p *Plugin) RPC() (string, http.Handler) { + return temporalV1connect.NewTemporalServiceHandler(&rpc{plugin: p}) } func ptr[T any](v T) *T { diff --git a/queue/queue.go b/queue/queue.go index 2cee3810..6596718f 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -3,7 +3,7 @@ package queue import ( "sync" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/temporalio/roadrunner-temporal/v6/internal" "go.temporal.io/api/common/v1" "go.temporal.io/api/failure/v1" ) diff --git a/queue/queue_test.go b/queue/queue_test.go index 6ac14494..ee2b8a97 100644 --- a/queue/queue_test.go +++ b/queue/queue_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/temporalio/roadrunner-temporal/v5/internal" + "github.com/temporalio/roadrunner-temporal/v6/internal" "go.temporal.io/api/common/v1" "go.temporal.io/api/failure/v1" ) diff --git a/rpc.go b/rpc.go index abaf8fc0..a8f9ffe3 100644 --- a/rpc.go +++ b/rpc.go @@ -6,15 +6,16 @@ import ( "os" "time" - commonV1 "github.com/roadrunner-server/api/v4/build/common/v1" - protoApi "github.com/roadrunner-server/api/v4/build/temporal/v1" + "connectrpc.com/connect" + commonV1 "github.com/roadrunner-server/api-go/v6/common/v1" + protoApi "github.com/roadrunner-server/api-go/v6/temporal/v1" + "github.com/roadrunner-server/api-go/v6/temporal/v1/temporalV1connect" "github.com/roadrunner-server/errors" - "github.com/temporalio/roadrunner-temporal/v5/internal/logger" + "github.com/temporalio/roadrunner-temporal/v6/internal/logger" commonpb "go.temporal.io/api/common/v1" "go.temporal.io/api/enums/v1" "go.temporal.io/api/history/v1" "go.temporal.io/sdk/activity" - "go.temporal.io/sdk/client" "go.temporal.io/sdk/worker" "go.temporal.io/sdk/workflow" "go.uber.org/zap" @@ -23,56 +24,44 @@ import ( "google.golang.org/protobuf/proto" ) -/* -- the method's type is exported. -- the method is exported. -- the method has two arguments, both exported (or builtin) types. -- the method's second argument is a pointer. -- the method has return type error. -*/ +// rpc exposes the temporal plugin control API (temporal.v1.TemporalService) +// on the RoadRunner Connect-RPC plane. type rpc struct { plugin *Plugin - client client.Client } -// RecordHeartbeatRequest sent by activity to record current state. -type RecordHeartbeatRequest struct { - TaskToken []byte `json:"taskToken"` - Details []byte `json:"details"` -} +// Compile-time check that rpc implements the generated handler interface. +var _ temporalV1connect.TemporalServiceHandler = (*rpc)(nil) -// RecordHeartbeatResponse sent back to the worker to indicate that activity was canceled. -type RecordHeartbeatResponse struct { - Canceled bool `json:"canceled"` - Paused bool `json:"paused"` +// newStatus builds the soft-error status carried inside replay responses +// (kept in the response body for parity with the v5 RPC behavior). +func newStatus(code codes.Code, msg string) *commonV1.Status { + // gRPC status codes are tiny (0..16), the conversion cannot overflow + return &commonV1.Status{Code: int32(code), Message: msg} //nolint:gosec } -// RecordActivityHeartbeat records heartbeat for an activity. -// taskToken - is the value of the binary "TaskToken" field of the "ActivityInfo" struct retrieved inside the activity. -// details - is the progress you want to record along with heart beat for this activity. -// The errors it can return: -// - EntityNotExistsError -// - InternalServiceError -// - CanceledError -func (r *rpc) RecordActivityHeartbeat(in RecordHeartbeatRequest, out *RecordHeartbeatResponse) error { +// RecordActivityHeartbeat records a heartbeat for an activity. +// task_token - is the value of the binary "TaskToken" field of the "ActivityInfo" struct retrieved inside the activity. +// details - is the progress you want to record along with the heartbeat for this activity. +func (r *rpc) RecordActivityHeartbeat(_ context.Context, req *connect.Request[protoApi.RecordHeartbeatRequest]) (*connect.Response[protoApi.RecordHeartbeatResponse], error) { details := &commonpb.Payloads{} - if len(in.Details) != 0 { - if err := proto.Unmarshal(in.Details, details); err != nil { - return err + if len(req.Msg.GetDetails()) != 0 { + if err := proto.Unmarshal(req.Msg.GetDetails(), details); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) } } if r.plugin.getActDef() == nil { - return errors.Str("no activity definition registered") + return nil, connect.NewError(connect.CodeFailedPrecondition, errors.Str("no activity definition registered")) } // find running activity r.plugin.mu.RLock() - ctx, err := r.plugin.temporal.rrActivityDef.GetActivityContext(in.TaskToken) + ctx, err := r.plugin.temporal.rrActivityDef.GetActivityContext(req.Msg.GetTaskToken()) if err != nil { r.plugin.mu.RUnlock() - return err + return nil, err } r.plugin.mu.RUnlock() @@ -81,65 +70,60 @@ func (r *rpc) RecordActivityHeartbeat(in RecordHeartbeatRequest, out *RecordHear err = context.Cause(ctx) if err != nil { if stderr.Is(err, activity.ErrActivityPaused) { - *out = RecordHeartbeatResponse{Paused: true} - return nil + return connect.NewResponse(&protoApi.RecordHeartbeatResponse{Paused: true}), nil } } + out := &protoApi.RecordHeartbeatResponse{} select { case <-ctx.Done(): - *out = RecordHeartbeatResponse{Canceled: true} + out.Canceled = true default: - *out = RecordHeartbeatResponse{Canceled: false} + out.Canceled = false } - return nil + return connect.NewResponse(out), nil } -func (r *rpc) GetActivityNames(_ bool, out *[]string) error { +func (r *rpc) GetActivityNames(_ context.Context, _ *connect.Request[protoApi.GetNamesRequest]) (*connect.Response[protoApi.NamesList], error) { r.plugin.mu.RLock() defer r.plugin.mu.RUnlock() + + out := &protoApi.NamesList{Names: make([]string, 0, len(r.plugin.temporal.activities))} for k := range r.plugin.temporal.activities { - *out = append(*out, k) + out.Names = append(out.Names, k) } - return nil + + return connect.NewResponse(out), nil } -func (r *rpc) GetWorkflowNames(_ bool, out *[]string) error { +func (r *rpc) GetWorkflowNames(_ context.Context, _ *connect.Request[protoApi.GetNamesRequest]) (*connect.Response[protoApi.NamesList], error) { r.plugin.mu.RLock() defer r.plugin.mu.RUnlock() + out := &protoApi.NamesList{Names: make([]string, 0, len(r.plugin.temporal.workflows))} for k := range r.plugin.temporal.workflows { - *out = append(*out, k) + out.Names = append(out.Names, k) } - return nil + return connect.NewResponse(out), nil } -func (r *rpc) ReplayWorkflow(in *protoApi.ReplayRequest, out *protoApi.ReplayResponse) error { +func (r *rpc) ReplayWorkflow(_ context.Context, req *connect.Request[protoApi.ReplayRequest]) (*connect.Response[protoApi.ReplayResponse], error) { + in := req.Msg + out := &protoApi.ReplayResponse{} + r.plugin.log.Debug("replay workflow request", zap.String("run_id", in.GetWorkflowExecution().GetRunId()), zap.String("workflow_id", in.GetWorkflowExecution().GetWorkflowId()), zap.String("workflow_name", in.GetWorkflowType().GetName())) - if in.GetWorkflowExecution() == nil || in.GetWorkflowType() == nil { - out.Status = &commonV1.Status{ - Code: int32(codes.InvalidArgument), - Message: "run_id, workflow_id or workflow_name should not be empty", - } + if in.GetWorkflowExecution() == nil || in.GetWorkflowType() == nil || + in.GetWorkflowExecution().GetRunId() == "" || in.GetWorkflowExecution().GetWorkflowId() == "" || in.GetWorkflowType().GetName() == "" { + out.Status = newStatus(codes.InvalidArgument, "run_id, workflow_id or workflow_name should not be empty") r.plugin.log.Error("replay workflow request", zap.String("error", "run_id, workflow_id or workflow_name should not be empty")) - return nil - } - - if in.GetWorkflowExecution().GetRunId() == "" || in.GetWorkflowExecution().GetWorkflowId() == "" || in.GetWorkflowType().GetName() == "" { - out.Status = &commonV1.Status{ - Code: int32(codes.InvalidArgument), - Message: "run_id, workflow_id or workflow_name should not be empty", - } - - r.plugin.log.Error("replay workflow request", zap.String("error", "run_id, workflow_id or workflow_name should not be empty")) - return nil + return connect.NewResponse(out), nil } ctx, cancel := context.WithTimeout(context.Background(), time.Minute) @@ -150,24 +134,18 @@ func (r *rpc) ReplayWorkflow(in *protoApi.ReplayRequest, out *protoApi.ReplayRes for iter.HasNext() { event, err := iter.Next() if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.Internal), - Message: err.Error(), - } + out.Status = newStatus(codes.Internal, err.Error()) r.plugin.log.Error("history iteration error", zap.Error(err)) - return nil + return connect.NewResponse(out), nil } hist.Events = append(hist.Events, event) } if r.plugin.getWfDef() == nil { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: "workflow definition is not initialized, retry in a second", - } + out.Status = newStatus(codes.FailedPrecondition, "workflow definition is not initialized, retry in a second") - return nil + return connect.NewResponse(out), nil } replayer := worker.NewWorkflowReplayer() @@ -178,58 +156,42 @@ func (r *rpc) ReplayWorkflow(in *protoApi.ReplayRequest, out *protoApi.ReplayRes err := replayer.ReplayWorkflowHistory(logger.NewZapAdapter(r.plugin.log), &hist) if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: err.Error(), - } + out.Status = newStatus(codes.FailedPrecondition, err.Error()) r.plugin.log.Error("replay error", zap.Error(err)) - return nil + return connect.NewResponse(out), nil } - out.Status = &commonV1.Status{ - Code: int32(codes.OK), - } + out.Status = newStatus(codes.OK, "") r.plugin.log.Debug("replay workflow request finished successfully") - return nil + return connect.NewResponse(out), nil } -func (r *rpc) DownloadWorkflowHistory(in *protoApi.ReplayRequest, out *protoApi.ReplayResponse) error { +func (r *rpc) DownloadWorkflowHistory(_ context.Context, req *connect.Request[protoApi.ReplayRequest]) (*connect.Response[protoApi.ReplayResponse], error) { + in := req.Msg + out := &protoApi.ReplayResponse{} + r.plugin.log.Debug("replay workflow request", zap.String("run_id", in.GetWorkflowExecution().GetRunId()), zap.String("workflow_id", in.GetWorkflowExecution().GetWorkflowId()), zap.String("save_path", in.GetSavePath())) - if in.GetWorkflowExecution() == nil || in.GetWorkflowType() == nil || in.GetSavePath() == "" { - out.Status = &commonV1.Status{ - Code: int32(codes.InvalidArgument), - Message: "run_id, workflow_id or save_path should not be empty", - } - - return nil - } - - if in.GetWorkflowExecution().GetRunId() == "" || in.GetWorkflowExecution().GetWorkflowId() == "" || in.GetWorkflowType().GetName() == "" { - out.Status = &commonV1.Status{ - Code: int32(codes.InvalidArgument), - Message: "run_id, workflow_id or save_path should not be empty", - } + if in.GetWorkflowExecution() == nil || in.GetWorkflowType() == nil || in.GetSavePath() == "" || + in.GetWorkflowExecution().GetRunId() == "" || in.GetWorkflowExecution().GetWorkflowId() == "" || in.GetWorkflowType().GetName() == "" { + out.Status = newStatus(codes.InvalidArgument, "run_id, workflow_id or save_path should not be empty") r.plugin.log.Error("replay workflow request", zap.String("error", "run_id, workflow_id or save_path should not be empty")) - return nil + return connect.NewResponse(out), nil } file, err := os.Create(in.GetSavePath()) if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.Internal), - Message: err.Error(), - } + out.Status = newStatus(codes.Internal, err.Error()) r.plugin.log.Error("failed to create the file", zap.Error(err)) - return nil + return connect.NewResponse(out), nil } defer func() { @@ -248,13 +210,10 @@ func (r *rpc) DownloadWorkflowHistory(in *protoApi.ReplayRequest, out *protoApi. for iter.HasNext() { event, errn := iter.Next() if errn != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.Internal), - Message: errn.Error(), - } + out.Status = newStatus(codes.Internal, errn.Error()) r.plugin.log.Error("history iteration error", zap.Error(errn)) - return nil + return connect.NewResponse(out), nil } hist.Events = append(hist.Events, event) @@ -262,36 +221,31 @@ func (r *rpc) DownloadWorkflowHistory(in *protoApi.ReplayRequest, out *protoApi. data, err := protojson.Marshal(&hist) if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.Internal), - Message: err.Error(), - } + out.Status = newStatus(codes.Internal, err.Error()) r.plugin.log.Error("history marshal error", zap.Error(err)) - return nil + return connect.NewResponse(out), nil } _, err = file.Write(data) if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.Internal), - Message: err.Error(), - } + out.Status = newStatus(codes.Internal, err.Error()) r.plugin.log.Error("history marshal error", zap.Error(err)) - return nil + return connect.NewResponse(out), nil } - out.Status = &commonV1.Status{ - Code: int32(codes.OK), - } + out.Status = newStatus(codes.OK, "") r.plugin.log.Debug("history saved", zap.String("location", in.GetSavePath())) - return nil + return connect.NewResponse(out), nil } -func (r *rpc) ReplayFromJSON(in *protoApi.ReplayRequest, out *protoApi.ReplayResponse) error { +func (r *rpc) ReplayFromJSON(_ context.Context, req *connect.Request[protoApi.ReplayRequest]) (*connect.Response[protoApi.ReplayResponse], error) { + in := req.Msg + out := &protoApi.ReplayResponse{} + r.plugin.log.Debug("replay from JSON request", zap.String("workflow_name", in.GetWorkflowType().GetName()), zap.String("save_path", in.GetSavePath()), @@ -299,32 +253,23 @@ func (r *rpc) ReplayFromJSON(in *protoApi.ReplayRequest, out *protoApi.ReplayRes ) if in.GetWorkflowType() == nil || in.GetSavePath() == "" { - out.Status = &commonV1.Status{ - Code: int32(codes.InvalidArgument), - Message: "workflow_name and save_path should not be empty", - } + out.Status = newStatus(codes.InvalidArgument, "workflow_name and save_path should not be empty") r.plugin.log.Error("replay from JSON request", zap.String("error", "workflow_name and save_path should not be empty")) - return nil + return connect.NewResponse(out), nil } if in.GetWorkflowType().GetName() == "" { - out.Status = &commonV1.Status{ - Code: int32(codes.InvalidArgument), - Message: "workflow_name should not be empty", - } + out.Status = newStatus(codes.InvalidArgument, "workflow_name should not be empty") r.plugin.log.Error("replay from JSON request", zap.String("error", "workflow_name should not be empty")) - return nil + return connect.NewResponse(out), nil } if r.plugin.getWfDef() == nil { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: "workflow definition is not initialized, retry in a second", - } + out.Status = newStatus(codes.FailedPrecondition, "workflow definition is not initialized, retry in a second") - return nil + return connect.NewResponse(out), nil } replayer := worker.NewWorkflowReplayer() @@ -338,59 +283,48 @@ func (r *rpc) ReplayFromJSON(in *protoApi.ReplayRequest, out *protoApi.ReplayRes case 0: err := replayer.ReplayWorkflowHistoryFromJSONFile(logger.NewZapAdapter(r.plugin.log), in.GetSavePath()) if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: err.Error(), - } + out.Status = newStatus(codes.FailedPrecondition, err.Error()) r.plugin.log.Error("replay from JSON request", zap.Error(err)) - return nil + return connect.NewResponse(out), nil } default: // we have last event ID err := replayer.ReplayPartialWorkflowHistoryFromJSONFile(logger.NewZapAdapter(r.plugin.log), in.GetSavePath(), in.GetLastEventId()) if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: err.Error(), - } + out.Status = newStatus(codes.FailedPrecondition, err.Error()) r.plugin.log.Error("replay from JSON request (partial workflow history)", zap.Int64("id", in.GetLastEventId()), zap.Error(err)) - return nil + return connect.NewResponse(out), nil } } - out.Status = &commonV1.Status{ - Code: int32(codes.OK), - } + out.Status = newStatus(codes.OK, "") r.plugin.log.Debug("replay from JSON request finished successfully") - return nil + return connect.NewResponse(out), nil } -func (r *rpc) ReplayWorkflowHistory(in *protoApi.History, out *protoApi.ReplayResponse) error { +func (r *rpc) ReplayWorkflowHistory(_ context.Context, req *connect.Request[protoApi.History]) (*connect.Response[protoApi.ReplayResponse], error) { + in := req.Msg + out := &protoApi.ReplayResponse{} + r.plugin.log.Debug("replay from workflow history request", zap.String("workflow_name", in.GetWorkflowType().GetName()), ) if in.GetHistory() == nil || in.GetWorkflowType().GetName() == "" { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: "workflow_name and/or history should not be empty", - } + out.Status = newStatus(codes.FailedPrecondition, "workflow_name and/or history should not be empty") r.plugin.log.Error("workflow_name and/or history should not be empty") - return nil + return connect.NewResponse(out), nil } if r.plugin.getWfDef() == nil { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: "workflow definition is not initialized, retry in a second", - } + out.Status = newStatus(codes.FailedPrecondition, "workflow definition is not initialized, retry in a second") - return nil + return connect.NewResponse(out), nil } replayer := worker.NewWorkflowReplayer() @@ -401,31 +335,24 @@ func (r *rpc) ReplayWorkflowHistory(in *protoApi.History, out *protoApi.ReplayRe err := replayer.ReplayWorkflowHistory(logger.NewZapAdapter(r.plugin.log), in.GetHistory()) if err != nil { - out.Status = &commonV1.Status{ - Code: int32(codes.FailedPrecondition), - Message: err.Error(), - } + out.Status = newStatus(codes.FailedPrecondition, err.Error()) r.plugin.log.Error("replay workflow history", zap.Error(err)) - return nil + return connect.NewResponse(out), nil } - out.Status = &commonV1.Status{ - Code: int32(codes.OK), - } + out.Status = newStatus(codes.OK, "") r.plugin.log.Debug("replay workflow request finished successfully") - return nil + return connect.NewResponse(out), nil } -func (r *rpc) UpdateAPIKey(in *string, out *bool) error { - if in != nil && *in != "" { - r.plugin.apiKey.Store(in) - *out = true - return nil +func (r *rpc) UpdateAPIKey(_ context.Context, req *connect.Request[protoApi.UpdateAPIKeyRequest]) (*connect.Response[protoApi.UpdateAPIKeyResponse], error) { + if key := req.Msg.GetApiKey(); key != "" { + r.plugin.apiKey.Store(&key) + return connect.NewResponse(&protoApi.UpdateAPIKeyResponse{Ok: true}), nil } - *out = false - return nil + return connect.NewResponse(&protoApi.UpdateAPIKeyResponse{Ok: false}), nil } diff --git a/status.go b/status.go index 3b647eba..a87e8da0 100644 --- a/status.go +++ b/status.go @@ -3,9 +3,9 @@ package rrtemporal import ( "net/http" - "github.com/roadrunner-server/pool/fsm" + "github.com/roadrunner-server/pool/v2/fsm" - "github.com/roadrunner-server/api/v4/plugins/v1/status" + "github.com/roadrunner-server/api-plugins/v6/status" ) // Status return status of the particular plugin diff --git a/tests/general/disaster_test.go b/tests/general/disaster_test.go index 05f46d8c..c857ae5c 100644 --- a/tests/general/disaster_test.go +++ b/tests/general/disaster_test.go @@ -2,8 +2,6 @@ package tests import ( "context" - "net" - "net/rpc" "os" "sync" "syscall" @@ -12,8 +10,8 @@ import ( "tests/helpers" - goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" - "github.com/roadrunner-server/pool/state/process" + informerV1 "github.com/roadrunner-server/api-go/v6/informer/v1" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.temporal.io/sdk/client" @@ -238,19 +236,10 @@ func Test_WorkerError_DisasterRecovery_Heavy(t *testing.T) { // Makes worker pool unable to recover for some time require.NoError(t, os.Rename("../php_test_files/worker.php", "../php_test_files/worker.bak")) - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - // WorkerList contains list of workers. - list := struct { - // Workers is list of workers. - Workers []process.State `json:"workers"` - }{} - - err = c.Call("informer.Workers", "temporal", &list) + list, err := helpers.Workers(t.Context()) require.NoError(t, err) - p, err := os.FindProcess(int(list.Workers[0].Pid)) + p, err := os.FindProcess(int(list[0].GetPid())) assert.NoError(t, err) // must fully recover with new worker @@ -341,19 +330,10 @@ func Test_WorkerError_DisasterRecovery_HeavyLA(t *testing.T) { // Makes worker pool unable to recover for some time require.NoError(t, os.Rename("../php_test_files/worker-la.php", "../php_test_files/worker-la.bak")) - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - // WorkerList contains list of workers. - list := struct { - // Workers is list of workers. - Workers []process.State `json:"workers"` - }{} - - err = c.Call("informer.Workers", "temporal", &list) + list, err := helpers.Workers(t.Context()) require.NoError(t, err) - p, err := os.FindProcess(int(list.Workers[0].Pid)) + p, err := os.FindProcess(int(list[0].GetPid())) assert.NoError(t, err) // must fully recover with new worker @@ -585,30 +565,14 @@ func Test_ActivityErrorLA_DisasterRecoveryProto(t *testing.T) { wg.Wait() } -func getWorkers(t *testing.T) []process.State { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - // WorkerList contains list of workers. - list := struct { - // Workers is list of workers. - Workers []process.State `json:"workers"` - }{} - - err = c.Call("informer.Workers", "temporal", &list) +func getWorkers(t *testing.T) []*informerV1.ProcessState { + list, err := helpers.Workers(t.Context()) assert.NoError(t, err) - assert.Len(t, list.Workers, 5) + assert.Len(t, list, 5) - return list.Workers + return list } func reset(t *testing.T) { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - - var ret bool - err = c.Call("resetter.Reset", "temporal", &ret) - assert.NoError(t, err) - require.True(t, ret) + require.NoError(t, helpers.Reset(t.Context())) } diff --git a/tests/general/general_test.go b/tests/general/general_test.go index 133807a0..d6e79db1 100644 --- a/tests/general/general_test.go +++ b/tests/general/general_test.go @@ -3,18 +3,13 @@ package tests import ( "context" "io" - "net" "net/http" - "net/rpc" "sync" "testing" "time" "github.com/stretchr/testify/require" - goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" - "github.com/roadrunner-server/pool/state/process" - "tests/helpers" "github.com/stretchr/testify/assert" @@ -125,16 +120,7 @@ func Test_DisabledActivityWorkers(t *testing.T) { } func assertWorkers(t *testing.T, workers int) { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - // WorkerList contains list of workers. - list := struct { - // Workers is list of workers. - Workers []process.State `json:"workers"` - }{} - - err = c.Call("informer.Workers", "temporal", &list) + list, err := helpers.Workers(t.Context()) assert.NoError(t, err) - assert.Len(t, list.Workers, workers) + assert.Len(t, list, workers) } diff --git a/tests/general/hp_test.go b/tests/general/hp_test.go index a7b1edca..0903e223 100644 --- a/tests/general/hp_test.go +++ b/tests/general/hp_test.go @@ -5,15 +5,15 @@ import ( "crypto/rand" "crypto/sha512" "fmt" - "net" - "net/rpc" "strconv" "sync" "testing" "tests/helpers" "time" - goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" + protoApi "github.com/roadrunner-server/api-go/v6/temporal/v1" + + "connectrpc.com/connect" "github.com/stretchr/testify/require" "go.temporal.io/api/common/v1" @@ -869,27 +869,15 @@ func Test_SagaWorkflowLAProto(t *testing.T) { } func getActivities(t *testing.T) []string { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - - res := make([]string, 0, 10) - - err = c.Call("temporal.GetActivityNames", true, &res) + resp, err := helpers.TemporalClient().GetActivityNames(t.Context(), connect.NewRequest(&protoApi.GetNamesRequest{})) assert.NoError(t, err) - return res + return resp.Msg.GetNames() } func getWorkflows(t *testing.T) []string { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - - res := make([]string, 0, 10) - - err = c.Call("temporal.GetWorkflowNames", true, &res) + resp, err := helpers.TemporalClient().GetWorkflowNames(t.Context(), connect.NewRequest(&protoApi.GetNamesRequest{})) assert.NoError(t, err) - return res + return resp.Msg.GetNames() } diff --git a/tests/general/plugin_status_test.go b/tests/general/plugin_status_test.go index b0a1173a..cbeeaf26 100644 --- a/tests/general/plugin_status_test.go +++ b/tests/general/plugin_status_test.go @@ -18,7 +18,7 @@ import ( "github.com/roadrunner-server/server/v5" "github.com/roadrunner-server/status/v5" "github.com/stretchr/testify/require" - rrtemporal "github.com/temporalio/roadrunner-temporal/v5" + rrtemporal "github.com/temporalio/roadrunner-temporal/v6" "github.com/stretchr/testify/assert" ) diff --git a/tests/general/rpc_test.go b/tests/general/rpc_test.go index 74c6af13..0fb66a97 100644 --- a/tests/general/rpc_test.go +++ b/tests/general/rpc_test.go @@ -2,27 +2,20 @@ package tests import ( "context" - "net" - "net/rpc" "path" "sync" "testing" "tests/helpers" "time" - protoApi "github.com/roadrunner-server/api/v4/build/temporal/v1" - goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" + "connectrpc.com/connect" + protoApi "github.com/roadrunner-server/api-go/v6/temporal/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.temporal.io/api/common/v1" "go.temporal.io/sdk/client" ) -const ( - download string = "temporal.DownloadWorkflowHistory" - replay string = "temporal.ReplayFromJSON" -) - func Test_RPC_Methods(t *testing.T) { stopCh := make(chan struct{}, 1) wg := &sync.WaitGroup{} @@ -60,20 +53,16 @@ func Test_RPC_Methods(t *testing.T) { time.Sleep(time.Second) tmp := path.Join(t.TempDir(), "replay.json") - t.Run("downloadWFHistory", downloadWFHistory("127.0.0.1:6001", w.GetID(), w.GetRunID(), "HistoryLengthWorkflow", tmp)) - t.Run("replayFromJSON", replayFromJSON("127.0.0.1:6001", tmp, "HistoryLengthWorkflow")) + t.Run("downloadWFHistory", downloadWFHistory(w.GetID(), w.GetRunID(), "HistoryLengthWorkflow", tmp)) + t.Run("replayFromJSON", replayFromJSON(tmp, "HistoryLengthWorkflow")) stopCh <- struct{}{} wg.Wait() time.Sleep(time.Second) } -func downloadWFHistory(address, wid, rid, wname, path string) func(t *testing.T) { +func downloadWFHistory(wid, rid, wname, path string) func(t *testing.T) { return func(t *testing.T) { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", address) - require.NoError(t, err) - client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - req := &protoApi.ReplayRequest{ SavePath: path, WorkflowType: &common.WorkflowType{ @@ -84,26 +73,24 @@ func downloadWFHistory(address, wid, rid, wname, path string) func(t *testing.T) RunId: rid, }, } - resp := &protoApi.ReplayResponse{} - err = client.Call(download, req, resp) + + resp, err := helpers.TemporalClient().DownloadWorkflowHistory(t.Context(), connect.NewRequest(req)) require.NoError(t, err) + require.Zero(t, resp.Msg.GetStatus().GetCode()) } } -func replayFromJSON(address, path, wname string) func(t *testing.T) { +func replayFromJSON(path, wname string) func(t *testing.T) { return func(t *testing.T) { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", address) - require.NoError(t, err) - client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - req := &protoApi.ReplayRequest{ SavePath: path, WorkflowType: &common.WorkflowType{ Name: wname, }, } - resp := &protoApi.ReplayResponse{} - err = client.Call(replay, req, resp) + + resp, err := helpers.TemporalClient().ReplayFromJSON(t.Context(), connect.NewRequest(req)) require.NoError(t, err) + require.Zero(t, resp.Msg.GetStatus().GetCode()) } } diff --git a/tests/go.mod b/tests/go.mod index 17d9fe7e..fc514ca3 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -1,25 +1,24 @@ module tests -go 1.26.3 +go 1.26.4 require ( + connectrpc.com/connect v1.20.0 github.com/fatih/color v1.19.0 github.com/pborman/uuid v1.2.1 - github.com/roadrunner-server/api/v4 v4.24.0 + github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12.0.20260610203904-09df89976edc github.com/roadrunner-server/config/v5 v5.1.9 github.com/roadrunner-server/endure/v2 v2.6.2 - github.com/roadrunner-server/goridge/v3 v3.8.3 github.com/roadrunner-server/informer/v5 v5.1.9 github.com/roadrunner-server/logger/v5 v5.1.9 - github.com/roadrunner-server/pool v1.1.3 github.com/roadrunner-server/resetter/v5 v5.1.9 github.com/roadrunner-server/rpc/v5 v5.1.9 github.com/roadrunner-server/server/v5 v5.2.10 github.com/roadrunner-server/status/v5 v5.1.9 github.com/stretchr/testify v1.11.1 - github.com/temporalio/roadrunner-temporal/v5 v5.11.0 + github.com/temporalio/roadrunner-temporal/v6 v6.0.0-00010101000000-000000000000 go.opentelemetry.io/otel/sdk v1.44.0 - go.temporal.io/api v1.62.13 + go.temporal.io/api v1.62.14 go.temporal.io/sdk v1.44.1 go.temporal.io/sdk/contrib/opentelemetry v0.7.0 go.uber.org/zap v1.28.0 @@ -27,7 +26,7 @@ require ( replace github.com/uber-go/tally/v4 => github.com/uber-go/tally/v4 v4.1.10 -replace github.com/temporalio/roadrunner-temporal/v5 => ../ +replace github.com/temporalio/roadrunner-temporal/v6 => ../ require ( github.com/beorn7/perks v1.0.1 // indirect @@ -59,8 +58,14 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.68.1 // indirect github.com/prometheus/procfs v0.20.1 // indirect + github.com/roadrunner-server/api-plugins/v6 v6.0.0-beta.2 // indirect + github.com/roadrunner-server/api/v4 v4.24.0 // indirect github.com/roadrunner-server/errors v1.5.0 // indirect github.com/roadrunner-server/events v1.0.1 // indirect + github.com/roadrunner-server/goridge/v3 v3.8.3 // indirect + github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2 // indirect + github.com/roadrunner-server/pool v1.1.3 // indirect + github.com/roadrunner-server/pool/v2 v2.0.0-beta.1 // indirect github.com/roadrunner-server/tcplisten v1.5.2 // indirect github.com/robfig/cron v1.2.0 // indirect github.com/sagikazarmark/locafero v0.12.0 // indirect @@ -83,17 +88,17 @@ require ( go.opentelemetry.io/otel/metric v1.44.0 // indirect go.opentelemetry.io/otel/trace v1.44.0 // indirect go.temporal.io/sdk/contrib/tally v0.2.0 // indirect - go.temporal.io/server v1.31.0 // indirect + go.temporal.io/server v1.31.1 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/net v0.56.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/text v0.38.0 // indirect golang.org/x/time v0.15.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad // indirect google.golang.org/grpc v1.81.1 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/tests/go.sum b/tests/go.sum index b8d698c1..fc510768 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -1,5 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +connectrpc.com/connect v1.20.0 h1:6TNDAB+WeNd2uolWNlYczB5E0KNNaVMNUEx8JEUsPmQ= +connectrpc.com/connect v1.20.0/go.mod h1:A2ygJrukXwWy32vkCAAHNVguZrqZ+jeZ9rGRnGR4dN4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -191,6 +193,10 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= +github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12.0.20260610203904-09df89976edc h1:tJhOZ31bN0HVO4JTgkcjHK1MLu8Waee+rFnbx5AjXyQ= +github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12.0.20260610203904-09df89976edc/go.mod h1:prGWJ2GoF5YD5PIG7Tb6VKulU3bWoFwr9DCwgxheb80= +github.com/roadrunner-server/api-plugins/v6 v6.0.0-beta.2 h1:GqsZzWQ5jMXRF1O/b8IqFz9PLpS7Ui0K4OyACLql2MI= +github.com/roadrunner-server/api-plugins/v6 v6.0.0-beta.2/go.mod h1:2v4yUK5Kvbvq8C3IkDoBkuamq9h+7i/JLjyf7k1j5JM= github.com/roadrunner-server/api/v4 v4.24.0 h1:99lN8nu7aD76d1fru4+MZkf9m8+YJ22Jy+qVoDwn4OY= github.com/roadrunner-server/api/v4 v4.24.0/go.mod h1:O0LputszJr6NXMw0SKyWaiS/C9K6JVh9HV2BHKXeosA= github.com/roadrunner-server/config/v5 v5.1.9 h1:ReWwts/prEvuC4yVJ0BRDmY5sxw/1c+hGTSdJ71hIQU= @@ -203,12 +209,16 @@ github.com/roadrunner-server/events v1.0.1 h1:waCkKhxhzdK3VcI1xG22l+h+0J+Nfdpxjh github.com/roadrunner-server/events v1.0.1/go.mod h1:WZRqoEVaFm209t52EuoT7ISUtvX6BrCi6bI/7pjkVC0= github.com/roadrunner-server/goridge/v3 v3.8.3 h1:XmjrOFnI6ZbQTPaP39DEk8KwLUNTgjluK3pcZaW6ixQ= github.com/roadrunner-server/goridge/v3 v3.8.3/go.mod h1:4TZU8zgkKIZCsH51qwGMpvyXCT59u/8z6q8sCe4ZGAQ= +github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2 h1:MgH6oiSgcl+vphsQ6JpyedkXQ/DPf8zVpn0z7rdBp10= +github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2/go.mod h1:Wv9CBO9VIU92e5iZIuehLHKakXgMkOzxoT4/oHDjIUA= github.com/roadrunner-server/informer/v5 v5.1.9 h1:yl334LMqUoWXfeP4299HgY9G7mq6kX6FVCSwT+cYdfQ= github.com/roadrunner-server/informer/v5 v5.1.9/go.mod h1:JPzSsDjLHExdQ9SbT9e8H/oB7pajgCScL/G70saQzSA= github.com/roadrunner-server/logger/v5 v5.1.9 h1:3Kn+NYXF7Ww5LvkwMZwkv1q99t5qusIPBsreRJL08JI= github.com/roadrunner-server/logger/v5 v5.1.9/go.mod h1:hwct/TWTmxYsVzowLx4g9HkY5z2/gpYOC+UN8btsrAA= github.com/roadrunner-server/pool v1.1.3 h1:KMsiL6yuYBWGk73bdO0akwP+fJ63bxDF972JukCGsxI= github.com/roadrunner-server/pool v1.1.3/go.mod h1:8ceC7NvZKJRciv+KJmcyk5CeDugoel6GD+crm5kBFW0= +github.com/roadrunner-server/pool/v2 v2.0.0-beta.1 h1:jpYXFtdD6QGAdAGPgMxrNi3j1CegCRpb2y+A+3GnXFA= +github.com/roadrunner-server/pool/v2 v2.0.0-beta.1/go.mod h1:Bo1wT7RtL3eyQHXBUohNhtj/yAmRt6Rq8smuBg5pWkY= github.com/roadrunner-server/resetter/v5 v5.1.9 h1:rH1nxkgvItbMEp1/JFZqcijOkkav4zo0E4wcVXBcXa8= github.com/roadrunner-server/resetter/v5 v5.1.9/go.mod h1:P5TfzCGQMNsUDPTrjOU7XFLdRz+DtFH/FmRla+lUF94= github.com/roadrunner-server/rpc/v5 v5.1.9 h1:AbRd2xEkWY8N3J4GUhoDeL+pnfwzKHazV4k40jZ+YDk= @@ -290,8 +300,8 @@ go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/ go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.temporal.io/api v1.5.0/go.mod h1:BqKxEJJYdxb5dqf0ODfzfMxh8UEQ5L3zKS51FiIYYkA= -go.temporal.io/api v1.62.13 h1:xMa8Nt5oAMX+LvlCJA44wjTCc1H09i2rG9poB1/xvH4= -go.temporal.io/api v1.62.13/go.mod h1:0k75tRljEuELWGeXjEZZO7zYqBln4+1FrG6+IMOMy7Q= +go.temporal.io/api v1.62.14 h1:Tree3eqoKRt5Vv+nvYHMPp/ROiGmSOTtFUD9d0w8yJE= +go.temporal.io/api v1.62.14/go.mod h1:0k75tRljEuELWGeXjEZZO7zYqBln4+1FrG6+IMOMy7Q= go.temporal.io/sdk v1.12.0/go.mod h1:lSp3lH1lI0TyOsus0arnO3FYvjVXBZGi/G7DjnAnm6o= go.temporal.io/sdk v1.44.1 h1:Mt2OZLZpqkzDIdg9YyQzO0Rb/HqCDnnqHlIAGAJ5gqM= go.temporal.io/sdk v1.44.1/go.mod h1:vkApR12F9/Y8OR+hkxe7WyXQFuCX6clhzqnAk6rzDAM= @@ -299,8 +309,8 @@ go.temporal.io/sdk/contrib/opentelemetry v0.7.0 h1:GSna1HP+1ibNXZ9xlVdQU2zFVqdt5 go.temporal.io/sdk/contrib/opentelemetry v0.7.0/go.mod h1:oQJC6UIl3FbSYh4f2MlUAIYSE6FPw02X1Tw8/bOvfxg= go.temporal.io/sdk/contrib/tally v0.2.0 h1:XnTJIQcjOv+WuCJ1u8Ve2nq+s2H4i/fys34MnWDRrOo= go.temporal.io/sdk/contrib/tally v0.2.0/go.mod h1:1kpSuCms/tHeJQDPuuKkaBsMqfHnIIRnCtUYlPNXxuE= -go.temporal.io/server v1.31.0 h1:FKLodreaMXUxYc3zr6xxwxtpGz1WH/t7O0IWxV1d1x0= -go.temporal.io/server v1.31.0/go.mod h1:MTQAw8uMU3ooSHyg/62JsNu/j8lK34SfKMTXkexYcw8= +go.temporal.io/server v1.31.1 h1:3rxA0Ls21hLOseKsyzm7e+IrVLuaDsuri0DGX+chIqU= +go.temporal.io/server v1.31.1/go.mod h1:kOOpZs6WMcLuVmlu0uH+dVD2Ul1d4hGjmGpHjxfz2EI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -349,8 +359,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -363,8 +373,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -386,8 +396,8 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -395,8 +405,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= @@ -427,10 +437,10 @@ google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad h1:3iLyITS/sySRwbUKoC7ogfj2Yr1Cjs0pfaRKj5U5HEw= +google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad/go.mod h1:KdNqO+rCIWgFumrNBSEDlDNrkrQnpkax7Tv1WxNY8V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad h1:45WmJvIV6C2+O/jjLkPUH+F3aOj/1miDoU2DD0+NWbg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260610212136-7ab31c22f7ad/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= diff --git a/tests/helpers/helpers.go b/tests/helpers/helpers.go index 2707bfad..8cb89a0e 100644 --- a/tests/helpers/helpers.go +++ b/tests/helpers/helpers.go @@ -22,8 +22,8 @@ import ( "github.com/roadrunner-server/server/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - roadrunnerTemporal "github.com/temporalio/roadrunner-temporal/v5" - "github.com/temporalio/roadrunner-temporal/v5/dataconverter" + roadrunnerTemporal "github.com/temporalio/roadrunner-temporal/v6" + "github.com/temporalio/roadrunner-temporal/v6/dataconverter" "go.temporal.io/api/enums/v1" "go.temporal.io/api/history/v1" temporalClient "go.temporal.io/sdk/client" diff --git a/tests/helpers/rpc.go b/tests/helpers/rpc.go new file mode 100644 index 00000000..5181146f --- /dev/null +++ b/tests/helpers/rpc.go @@ -0,0 +1,42 @@ +package helpers + +import ( + "context" + "net/http" + + "connectrpc.com/connect" + informerV1 "github.com/roadrunner-server/api-go/v6/informer/v1" + "github.com/roadrunner-server/api-go/v6/informer/v1/informerV1connect" + resetterV1 "github.com/roadrunner-server/api-go/v6/resetter/v1" + "github.com/roadrunner-server/api-go/v6/resetter/v1/resetterV1connect" + "github.com/roadrunner-server/api-go/v6/temporal/v1/temporalV1connect" +) + +// RPCAddr is the base URL of the RoadRunner Connect-RPC plane started by the +// test configs (rpc plugin listening on 127.0.0.1:6001). +const RPCAddr = "http://127.0.0.1:6001" + +// TemporalClient returns a TemporalService client bound to the test rpc plane. +func TemporalClient() temporalV1connect.TemporalServiceClient { + return temporalV1connect.NewTemporalServiceClient(http.DefaultClient, RPCAddr) +} + +// Workers returns the temporal plugin's worker list via the informer service. +func Workers(ctx context.Context) ([]*informerV1.ProcessState, error) { + c := informerV1connect.NewInformerServiceClient(http.DefaultClient, RPCAddr) + + resp, err := c.GetWorkers(ctx, connect.NewRequest(&informerV1.GetWorkersRequest{Plugin: "temporal"})) + if err != nil { + return nil, err + } + + return resp.Msg.GetWorkers(), nil +} + +// Reset resets the temporal plugin's worker pools via the resetter service. +func Reset(ctx context.Context) error { + c := resetterV1connect.NewResetterServiceClient(http.DefaultClient, RPCAddr) + + _, err := c.Reset(ctx, connect.NewRequest(&resetterV1.ResetRequest{Plugin: "temporal"})) + return err +} diff --git a/tests/tls/disaster_tls_test.go b/tests/tls/disaster_tls_test.go index 857a7458..f0ddc6be 100644 --- a/tests/tls/disaster_tls_test.go +++ b/tests/tls/disaster_tls_test.go @@ -2,8 +2,6 @@ package tls import ( "context" - "net" - "net/rpc" "os" "sync" "syscall" @@ -12,8 +10,8 @@ import ( "tests/helpers" - goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" - "github.com/roadrunner-server/pool/state/process" + informerV1 "github.com/roadrunner-server/api-go/v6/informer/v1" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.temporal.io/sdk/client" @@ -238,19 +236,10 @@ func Test_WorkerError_DisasterRecovery_Heavy(t *testing.T) { // Makes worker pool unable to recover for some time require.NoError(t, os.Rename("../php_test_files/worker.php", "../php_test_files/worker.bak")) - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - // WorkerList contains list of workers. - list := struct { - // Workers is list of workers. - Workers []process.State `json:"workers"` - }{} - - err = c.Call("informer.Workers", "temporal", &list) + list, err := helpers.Workers(t.Context()) require.NoError(t, err) - p, err := os.FindProcess(int(list.Workers[0].Pid)) + p, err := os.FindProcess(int(list[0].GetPid())) assert.NoError(t, err) // must fully recover with new worker @@ -292,19 +281,10 @@ func Test_WorkerError_DisasterRecovery_HeavyLA(t *testing.T) { // Makes worker pool unable to recover for some time require.NoError(t, os.Rename("../php_test_files/worker-la.php", "../php_test_files/worker-la.bak")) - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - // WorkerList contains list of workers. - list := struct { - // Workers is list of workers. - Workers []process.State `json:"workers"` - }{} - - err = c.Call("informer.Workers", "temporal", &list) + list, err := helpers.Workers(t.Context()) require.NoError(t, err) - p, err := os.FindProcess(int(list.Workers[0].Pid)) + p, err := os.FindProcess(int(list[0].GetPid())) assert.NoError(t, err) // must fully recover with new worker @@ -585,30 +565,14 @@ func Test_ActivityErrorLA_DisasterRecoveryProto(t *testing.T) { wg.Wait() } -func getWorkers(t *testing.T) []process.State { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - // WorkerList contains list of workers. - list := struct { - // Workers is list of workers. - Workers []process.State `json:"workers"` - }{} - - err = c.Call("informer.Workers", "temporal", &list) +func getWorkers(t *testing.T) []*informerV1.ProcessState { + list, err := helpers.Workers(t.Context()) assert.NoError(t, err) - assert.Len(t, list.Workers, 5) + assert.Len(t, list, 5) - return list.Workers + return list } func reset(t *testing.T) { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - - var ret bool - err = c.Call("resetter.Reset", "temporal", &ret) - assert.NoError(t, err) - require.True(t, ret) + require.NoError(t, helpers.Reset(t.Context())) } diff --git a/tests/tls/hp_tls_test.go b/tests/tls/hp_tls_test.go index 6cd83492..7d590637 100644 --- a/tests/tls/hp_tls_test.go +++ b/tests/tls/hp_tls_test.go @@ -5,16 +5,16 @@ import ( "crypto/rand" "crypto/sha512" "fmt" - "net" - "net/rpc" "sync" "testing" "time" "tests/helpers" + protoApi "github.com/roadrunner-server/api-go/v6/temporal/v1" + + "connectrpc.com/connect" "github.com/fatih/color" - goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.temporal.io/api/common/v1" @@ -821,27 +821,15 @@ func Test_SagaWorkflowLAProto(t *testing.T) { } func getActivities(t *testing.T) []string { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - - res := make([]string, 0, 10) - - err = c.Call("temporal.GetActivityNames", true, &res) + resp, err := helpers.TemporalClient().GetActivityNames(t.Context(), connect.NewRequest(&protoApi.GetNamesRequest{})) assert.NoError(t, err) - return res + return resp.Msg.GetNames() } func getWorkflows(t *testing.T) []string { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", "127.0.0.1:6001") - assert.NoError(t, err) - c := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - - res := make([]string, 0, 10) - - err = c.Call("temporal.GetWorkflowNames", true, &res) + resp, err := helpers.TemporalClient().GetWorkflowNames(t.Context(), connect.NewRequest(&protoApi.GetNamesRequest{})) assert.NoError(t, err) - return res + return resp.Msg.GetNames() } diff --git a/tests/updates/updates_replay_test.go b/tests/updates/updates_replay_test.go index 39c6f561..765ef966 100644 --- a/tests/updates/updates_replay_test.go +++ b/tests/updates/updates_replay_test.go @@ -2,16 +2,14 @@ package updates import ( "context" - "net" - "net/rpc" "path" "sync" "testing" "tests/helpers" "time" - protoApi "github.com/roadrunner-server/api/v4/build/temporal/v1" - goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" + "connectrpc.com/connect" + protoApi "github.com/roadrunner-server/api-go/v6/temporal/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.temporal.io/api/common/v1" @@ -20,11 +18,6 @@ import ( "go.temporal.io/sdk/client" ) -const ( - download string = "temporal.DownloadWorkflowHistory" - replay string = "temporal.ReplayFromJSON" -) - func TestUpdatesReplay(t *testing.T) { stopCh := make(chan struct{}, 1) wg := &sync.WaitGroup{} @@ -75,20 +68,16 @@ func TestUpdatesReplay(t *testing.T) { time.Sleep(time.Second) tmp := path.Join(t.TempDir(), "replay.json") - t.Run("downloadWFHistory", downloadWFHistory("127.0.0.1:6001", w.GetID(), w.GetRunID(), updateGreetWF, tmp)) - t.Run("replayFromJSON", replayFromJSON("127.0.0.1:6001", tmp, updateGreetWF)) + t.Run("downloadWFHistory", downloadWFHistory(w.GetID(), w.GetRunID(), updateGreetWF, tmp)) + t.Run("replayFromJSON", replayFromJSON(tmp, updateGreetWF)) stopCh <- struct{}{} wg.Wait() time.Sleep(time.Second) } -func downloadWFHistory(address, wid, rid, wname, path string) func(t *testing.T) { +func downloadWFHistory(wid, rid, wname, path string) func(t *testing.T) { return func(t *testing.T) { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", address) - require.NoError(t, err) - client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - req := &protoApi.ReplayRequest{ SavePath: path, WorkflowType: &common.WorkflowType{ @@ -99,26 +88,22 @@ func downloadWFHistory(address, wid, rid, wname, path string) func(t *testing.T) RunId: rid, }, } - resp := &protoApi.ReplayResponse{} - err = client.Call(download, req, resp) + resp, err := helpers.TemporalClient().DownloadWorkflowHistory(t.Context(), connect.NewRequest(req)) require.NoError(t, err) + require.Zero(t, resp.Msg.GetStatus().GetCode()) } } -func replayFromJSON(address, path, wname string) func(t *testing.T) { +func replayFromJSON(path, wname string) func(t *testing.T) { return func(t *testing.T) { - conn, err := (&net.Dialer{}).DialContext(t.Context(), "tcp", address) - require.NoError(t, err) - client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) - req := &protoApi.ReplayRequest{ SavePath: path, WorkflowType: &common.WorkflowType{ Name: wname, }, } - resp := &protoApi.ReplayResponse{} - err = client.Call(replay, req, resp) + resp, err := helpers.TemporalClient().ReplayFromJSON(t.Context(), connect.NewRequest(req)) require.NoError(t, err) + require.Zero(t, resp.Msg.GetStatus().GetCode()) } }