diff --git a/go.mod b/go.mod index 704f97fe6..bd77055bf 100644 --- a/go.mod +++ b/go.mod @@ -17,14 +17,14 @@ require ( github.com/stretchr/testify v1.11.1 github.com/temporalio/cli/cliext v0.0.0 github.com/temporalio/ui-server/v2 v2.52.0 - go.temporal.io/api v1.63.0 + go.temporal.io/api v1.63.4-0.20260716185437-1b343e37c63b go.temporal.io/sdk v1.45.0 go.temporal.io/sdk/contrib/envconfig v1.0.2 - go.temporal.io/server v1.32.0-158.0 - golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f - golang.org/x/mod v0.35.0 - golang.org/x/term v0.43.0 - golang.org/x/tools v0.44.0 + go.temporal.io/server v1.32.0-160.0-rc.20260717114948 + golang.org/x/exp v0.0.0-20260611194520-c48552f49976 + golang.org/x/mod v0.37.0 + golang.org/x/term v0.45.0 + golang.org/x/tools v0.47.0 google.golang.org/grpc v1.81.1 google.golang.org/protobuf v1.36.11 gopkg.in/yaml.v3 v3.0.1 @@ -78,6 +78,7 @@ require ( github.com/blang/semver/v4 v4.0.0 // indirect github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c // indirect github.com/cactus/go-statsd-client/v5 v5.1.0 // indirect + github.com/caio/go-tdigest/v5 v5.0.0 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect @@ -129,7 +130,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.9.2 // indirect + github.com/jackc/pgx/v5 v5.10.0 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/jmoiron/sqlx v1.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -182,17 +183,18 @@ require ( go.opentelemetry.io/contrib/detectors/gcp v1.43.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 // indirect - go.opentelemetry.io/otel v1.43.0 // indirect + go.opentelemetry.io/otel v1.44.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.57.0 // indirect - go.opentelemetry.io/otel/metric v1.43.0 // indirect + go.opentelemetry.io/otel/log v0.20.0 // indirect + go.opentelemetry.io/otel/metric v1.44.0 // indirect go.opentelemetry.io/otel/sdk v1.43.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect - go.opentelemetry.io/otel/trace v1.43.0 // indirect + go.opentelemetry.io/otel/trace v1.44.0 // indirect go.opentelemetry.io/proto/otlp v1.10.0 // indirect - go.temporal.io/auto-scaled-workers v0.0.0-20260622220320-9b1e3849116d // indirect + go.temporal.io/auto-scaled-workers v0.0.0-20260706201056-4320b34799ee // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/dig v1.19.0 // indirect go.uber.org/fx v1.24.0 // indirect @@ -201,12 +203,12 @@ require ( go.uber.org/zap v1.27.1 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.52.0 // indirect - golang.org/x/net v0.55.0 // indirect + golang.org/x/crypto v0.54.0 // indirect + golang.org/x/net v0.57.0 // indirect golang.org/x/oauth2 v0.36.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/sync v0.22.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.40.0 // indirect golang.org/x/time v0.15.0 // indirect google.golang.org/api v0.276.0 // indirect google.golang.org/genproto v0.0.0-20260420184626-e10c466a9529 // indirect diff --git a/go.sum b/go.sum index 783a6d133..e4a81ce8a 100644 --- a/go.sum +++ b/go.sum @@ -112,6 +112,8 @@ github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go. github.com/cactus/go-statsd-client/v4 v4.0.0/go.mod h1:m73kwJp6TN0Ja9P6ycdZhWM1MlfxY/95WZ//IptPQ+Y= github.com/cactus/go-statsd-client/v5 v5.1.0 h1:sbbdfIl9PgisjEoXzvXI1lwUKWElngsjJKaZeC021P4= github.com/cactus/go-statsd-client/v5 v5.1.0/go.mod h1:COEvJ1E+/E2L4q6QE5CkjWPi4eeDw9maJBMIuMPBZbY= +github.com/caio/go-tdigest/v5 v5.0.0 h1:XQKgYSazZPbWFDAJ51dKqoZoDrISmTrB8UcWwCmfo6Y= +github.com/caio/go-tdigest/v5 v5.0.0/go.mod h1:wI618wZoAYzIDZlpX2CfyTQdrdGtwEZOJuXdrI3zk/Y= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -268,8 +270,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.9.2 h1:3ZhOzMWnR4yJ+RW1XImIPsD1aNSz4T4fyP7zlQb56hw= -github.com/jackc/pgx/v5 v5.9.2/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= +github.com/jackc/pgx/v5 v5.10.0 h1:VhSvgU2jSli8o3AqIEOTJr7rZwAEUVo4E4XhR94Zfr0= +github.com/jackc/pgx/v5 v5.10.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -300,6 +302,8 @@ github.com/labstack/echo/v4 v4.13.4 h1:oTZZW+T3s9gAu5L8vmzihV7/lkXGZuITzTQkTEhcX github.com/labstack/echo/v4 v4.13.4/go.mod h1:g63b33BZ5vZzcIUF8AtRH40DrTlXnx4UMC8rBdndmjQ= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= +github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353 h1:X/79QL0b4YJVO5+OsPH9rF2u428CIrGL/jLmPsoOQQ4= +github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ= github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= @@ -447,8 +451,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0/go.mod h1:Sje3i3MjSPKTSPvVWCaL8ugBzJwik3u4smCjUeuupqg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 h1:CqXxU8VOmDefoh0+ztfGaymYbhdB/tT3zs79QaZTNGY= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0/go.mod h1:BuhAPThV8PBHBvg8ZzZ/Ok3idOdhWIodywz2xEcRbJo= -go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= -go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= +go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= +go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0 h1:8UQVDcZxOJLtX6gxtDt3vY2WTgvZqMQRzjsqiIHQdkc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0/go.mod h1:2lmweYCiHYpEjQ/lSJBYhj9jP1zvCvQW4BqL9dnT7FQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 h1:88Y4s2C8oTui1LGM6bTWkw0ICGcOLCAI5l6zsD1j20k= @@ -459,26 +463,28 @@ go.opentelemetry.io/otel/exporters/prometheus v0.57.0 h1:AHh/lAP1BHrY5gBwk8ncc25 go.opentelemetry.io/otel/exporters/prometheus v0.57.0/go.mod h1:QpFWz1QxqevfjwzYdbMb4Y1NnlJvqSGwyuU0B4iuc9c= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.43.0 h1:TC+BewnDpeiAmcscXbGMfxkO+mwYUwE/VySwvw88PfA= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.43.0/go.mod h1:J/ZyF4vfPwsSr9xJSPyQ4LqtcTPULFR64KwTikGLe+A= -go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM= -go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= +go.opentelemetry.io/otel/log v0.20.0 h1:/5i0vuHxCLWUfChWG41K9wkM0jafruPw9NU1/RCJirs= +go.opentelemetry.io/otel/log v0.20.0/go.mod h1:wOcMcjsZpG8x7Bak7IhSi/lg8wscV2C1VdrKCLPlt0E= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg= go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg= go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw= go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A= -go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= -go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= -go.temporal.io/api v1.63.0 h1:YZFOTA0/thRUIUC4qunAWdHhPh/IG4vy/+WjfEvT+ZE= -go.temporal.io/api v1.63.0/go.mod h1:0k75tRljEuELWGeXjEZZO7zYqBln4+1FrG6+IMOMy7Q= -go.temporal.io/auto-scaled-workers v0.0.0-20260622220320-9b1e3849116d h1:f7+FCJHSrYWz9zvJp2OxKo8Fu/dsBUdnZZA+m5CEOS0= -go.temporal.io/auto-scaled-workers v0.0.0-20260622220320-9b1e3849116d/go.mod h1:HOnbQTZCW18EPcutFHTkZrDcGO4tUjQ8N2pjDyrGhrY= +go.temporal.io/api v1.63.4-0.20260716185437-1b343e37c63b h1:mJ7IOw3GA2QG84zKIPizL8sRMv4bXhMO8oP7nJDK0qs= +go.temporal.io/api v1.63.4-0.20260716185437-1b343e37c63b/go.mod h1:SrlW2JMwVlDP4nRWSNznUFqnSHd+YeMDS1BkYo63HCQ= +go.temporal.io/auto-scaled-workers v0.0.0-20260706201056-4320b34799ee h1:y6A65Iml06cR3CpxW2Zn8FQLjniPDTnN4jtr69UZxXI= +go.temporal.io/auto-scaled-workers v0.0.0-20260706201056-4320b34799ee/go.mod h1:hhHijO9XRPIkAflLJJHix61M9FzbRPqk8fSydkcLkqw= go.temporal.io/sdk v1.45.0 h1:kvsczo3SHTS60+zBWH9lljLmBLWSXcyGkBxr88z8iQI= go.temporal.io/sdk v1.45.0/go.mod h1:vkApR12F9/Y8OR+hkxe7WyXQFuCX6clhzqnAk6rzDAM= go.temporal.io/sdk/contrib/envconfig v1.0.2 h1:MGHfsuPUtsf7X9M6WYn3zYJj/mWsuYHnA1uuiL0KEuE= go.temporal.io/sdk/contrib/envconfig v1.0.2/go.mod h1:MuMiH7hksps2uXnmKuAWaP9P6WbkSDy62kl64t1VJVg= -go.temporal.io/server v1.32.0-158.0 h1:M+rXAmFztzBrIXNYPZyUPJFZO6yHPKP1lRTrQNUKvbs= -go.temporal.io/server v1.32.0-158.0/go.mod h1:5HHOkpEzSikoCT1CL54dtJC+qpyAwHKz47bHZHJAIp4= +go.temporal.io/server v1.32.0-160.0-rc.20260717114948 h1:9k755bAA1+vT5mxgHRkhfongTISkOr9JV93kBbPSbKM= +go.temporal.io/server v1.32.0-160.0-rc.20260717114948/go.mod h1:YC1Ub+siR4CNFCMGoE554c/ol4tcue5mftX7iLgjDXs= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -509,15 +515,15 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= -golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= -golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= +golang.org/x/exp v0.0.0-20260611194520-c48552f49976 h1:X8Hz2ImujgbmetVuW+w2YkyZChE3cBpZi2P158rTG9M= +golang.org/x/exp v0.0.0-20260611194520-c48552f49976/go.mod h1:vnf4pv9iKZXY58sQE1L86zmNWJ4159e1RkcWiLCkeEY= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -530,8 +536,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -543,8 +549,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -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.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -553,8 +559,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/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.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -571,15 +577,15 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.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.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -587,8 +593,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -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.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= +golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -605,8 +611,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= +golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/temporalcli/commands.activity.go b/internal/temporalcli/commands.activity.go index b772869dd..1766c16c7 100644 --- a/internal/temporalcli/commands.activity.go +++ b/internal/temporalcli/commands.activity.go @@ -448,35 +448,10 @@ func printActivityDescription(cctx *CommandContext, resp *workflowservice.Descri if err := cctx.Printer.PrintStructured(d, printer.StructuredOptions{}); err != nil { return err } - return printActivityCallbacks(cctx, resp.GetCallbacks()) -} - -func printActivityCallbacks(cctx *CommandContext, callbacks []*activitypb.CallbackInfo) error { - if len(callbacks) == 0 { - return nil + if err := printLinks(cctx, info.GetLinks()); err != nil { + return err } - rows := make([]struct { - State string - Attempt int32 - RegistrationTime time.Time `cli:",cardOmitEmpty"` - NextAttemptScheduleTime time.Time `cli:",cardOmitEmpty"` - BlockedReason string `cli:",cardOmitEmpty"` - LastAttemptFailure string `cli:",cardOmitEmpty"` - }, len(callbacks)) - for i, cb := range callbacks { - info := cb.GetInfo() - rows[i].State = info.GetState().String() - rows[i].Attempt = info.GetAttempt() - rows[i].RegistrationTime = timestampToTime(info.GetRegistrationTime()) - rows[i].NextAttemptScheduleTime = timestampToTime(info.GetNextAttemptScheduleTime()) - rows[i].BlockedReason = info.GetBlockedReason() - if f := info.GetLastAttemptFailure(); f != nil { - rows[i].LastAttemptFailure = cctx.MarshalFriendlyFailureBodyText(f, " ") - } - } - cctx.Printer.Println() - cctx.Printer.Println(color.MagentaString("Callbacks:")) - return cctx.Printer.PrintStructured(rows, printer.StructuredOptions{Table: &printer.TableOptions{}}) + return printCallbacks(cctx, resp.GetCallbacks()) } func (c *TemporalActivityListCommand) run(cctx *CommandContext, args []string) error { diff --git a/internal/temporalcli/commands.go b/internal/temporalcli/commands.go index eaf08dbdf..f5acc4c98 100644 --- a/internal/temporalcli/commands.go +++ b/internal/temporalcli/commands.go @@ -22,10 +22,14 @@ import ( "github.com/temporalio/cli/cliext" "github.com/temporalio/cli/internal/printer" "github.com/temporalio/ui-server/v2/server/version" + activitypb "go.temporal.io/api/activity/v1" "go.temporal.io/api/common/v1" commonpb "go.temporal.io/api/common/v1" + "go.temporal.io/api/enums/v1" "go.temporal.io/api/failure/v1" + "go.temporal.io/api/temporalnexus" "go.temporal.io/api/temporalproto" + workflowpb "go.temporal.io/api/workflow/v1" "go.temporal.io/sdk/contrib/envconfig" "go.temporal.io/sdk/converter" "go.temporal.io/sdk/temporal" @@ -606,6 +610,123 @@ func timestampToTime(t *timestamppb.Timestamp) time.Time { return t.AsTime() } +// nexusLinkStrings converts Temporal common links into their Nexus link URL +// string representations, skipping any link variant that has no Nexus +// equivalent. The conversion helpers live in go.temporal.io/api/temporalnexus +// (previously in the Go SDK's temporalnexus package). +func nexusLinkStrings(links []*commonpb.Link) []string { + var out []string + for _, link := range links { + switch { + case link.GetWorkflowEvent() != nil: + out = append(out, temporalnexus.ConvertLinkWorkflowEventToNexusLink(link.GetWorkflowEvent()).URL.String()) + case link.GetNexusOperation() != nil: + out = append(out, temporalnexus.ConvertLinkNexusOperationToNexusLink(link.GetNexusOperation()).URL.String()) + case link.GetActivity() != nil: + out = append(out, temporalnexus.ConvertLinkActivityToNexusLink(link.GetActivity()).URL.String()) + } + } + return out +} + +// printLinks renders Temporal common links as a standalone Nexus links section. +// Nothing is printed when none of the links have a Nexus representation. +func printLinks(cctx *CommandContext, links []*commonpb.Link) error { + urls := nexusLinkStrings(links) + if len(urls) == 0 { + return nil + } + rows := make([]struct { + Link string + }, len(urls)) + for i, url := range urls { + rows[i].Link = url + } + cctx.Printer.Println() + cctx.Printer.Println(color.MagentaString("Links: %v", len(urls))) + cctx.Printer.Println() + return cctx.Printer.PrintStructured(rows, printer.StructuredOptions{}) +} + +// callbackInfoForPrint is the subset of accessors shared by workflow.v1.CallbackInfo +// and callback.v1.CallbackInfo (the latter nested inside activity.v1.CallbackInfo). +// It lets the workflow and activity describe commands render callbacks through a +// single code path (printCallbacks). +type callbackInfoForPrint interface { + GetCallback() *commonpb.Callback + GetState() enums.CallbackState + GetAttempt() int32 + GetRegistrationTime() *timestamppb.Timestamp + GetNextAttemptScheduleTime() *timestamppb.Timestamp + GetLastAttemptCompleteTime() *timestamppb.Timestamp + GetLastAttemptFailure() *failure.Failure + GetBlockedReason() string +} + +type callbackForPrint interface { + *workflowpb.CallbackInfo | *activitypb.CallbackInfo +} + +func normalizeCallbackForPrint[T callbackForPrint](cb T) (callbackInfoForPrint, string) { + switch cb := any(cb).(type) { + case *workflowpb.CallbackInfo: + trigger := "Unknown" + if cb.GetTrigger().GetWorkflowClosed() != nil { + trigger = "WorkflowClosed" + } + return cb, trigger + case *activitypb.CallbackInfo: + trigger := "Unknown" + if cb.GetTrigger().GetActivityClosed() != nil { + trigger = "ActivityClosed" + } + return cb.GetInfo(), trigger + default: + panic("unsupported callback type") + } +} + +// printCallbacks renders the "Callbacks: N" section shared by the workflow and +// activity describe commands. Nothing is printed when there are no callbacks. +// This is only reached for text output; JSON output prints the raw describe +// response instead. +func printCallbacks[T callbackForPrint](cctx *CommandContext, callbacks []T) error { + if len(callbacks) == 0 { + return nil + } + rows := make([]struct { + URL string + Links []string `cli:",cardOmitEmpty"` + Trigger string + State enums.CallbackState + Attempt int32 + RegistrationTime time.Time `cli:",cardOmitEmpty"` + NextAttemptScheduleTime time.Time `cli:",cardOmitEmpty"` + LastAttemptCompleteTime time.Time `cli:",cardOmitEmpty"` + BlockedReason string `cli:",cardOmitEmpty"` + LastAttemptFailure string `cli:",cardOmitEmpty"` + }, len(callbacks)) + for i, cb := range callbacks { + ci, trigger := normalizeCallbackForPrint(cb) + rows[i].URL = ci.GetCallback().GetNexus().GetUrl() + rows[i].Links = nexusLinkStrings(ci.GetCallback().GetLinks()) + rows[i].Trigger = trigger + rows[i].State = ci.GetState() + rows[i].Attempt = ci.GetAttempt() + rows[i].RegistrationTime = timestampToTime(ci.GetRegistrationTime()) + rows[i].NextAttemptScheduleTime = timestampToTime(ci.GetNextAttemptScheduleTime()) + rows[i].LastAttemptCompleteTime = timestampToTime(ci.GetLastAttemptCompleteTime()) + rows[i].BlockedReason = ci.GetBlockedReason() + if f := ci.GetLastAttemptFailure(); f != nil { + rows[i].LastAttemptFailure = cctx.MarshalFriendlyFailureBodyText(f, " ") + } + } + cctx.Printer.Println() + cctx.Printer.Println(color.MagentaString("Callbacks: %v", len(callbacks))) + cctx.Printer.Println() + return cctx.Printer.PrintStructured(rows, printer.StructuredOptions{}) +} + type nopWriter struct{} func (nopWriter) Write(b []byte) (int, error) { return len(b), nil } diff --git a/internal/temporalcli/commands.link_test.go b/internal/temporalcli/commands.link_test.go new file mode 100644 index 000000000..b6c782cd7 --- /dev/null +++ b/internal/temporalcli/commands.link_test.go @@ -0,0 +1,161 @@ +package temporalcli + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/require" + "github.com/temporalio/cli/internal/printer" + activitypb "go.temporal.io/api/activity/v1" + callbackpb "go.temporal.io/api/callback/v1" + commonpb "go.temporal.io/api/common/v1" + enumspb "go.temporal.io/api/enums/v1" + nexuspb "go.temporal.io/api/nexus/v1" + "go.temporal.io/api/workflowservice/v1" + "go.temporal.io/sdk/client" +) + +func workflowEventLink() *commonpb.Link { + return &commonpb.Link{ + Variant: &commonpb.Link_WorkflowEvent_{ + WorkflowEvent: &commonpb.Link_WorkflowEvent{ + Namespace: "ns", + WorkflowId: "wf-id", + RunId: "run-id", + Reference: &commonpb.Link_WorkflowEvent_EventRef{ + EventRef: &commonpb.Link_WorkflowEvent_EventReference{ + EventId: 1, + EventType: enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, + }, + }, + }, + }, + } +} + +// TestNexusLinkStrings verifies that nexusLinkStrings converts workflow-event, +// nexus-operation, and activity common links into their Nexus link URLs using +// the converters that now live in go.temporal.io/api/temporalnexus, and skips +// variants that have no Nexus equivalent. +func TestNexusLinkStrings(t *testing.T) { + activityLink := &commonpb.Link{ + Variant: &commonpb.Link_Activity_{ + Activity: &commonpb.Link_Activity{ + Namespace: "ns", + ActivityId: "act-id", + RunId: "run-id", + }, + }, + } + nexusOperationLink := &commonpb.Link{ + Variant: &commonpb.Link_NexusOperation_{ + NexusOperation: &commonpb.Link_NexusOperation{ + Namespace: "ns", + OperationId: "op-id", + RunId: "run-id", + }, + }, + } + // A link with an unset (unsupported) variant, which must be skipped. + otherLink := &commonpb.Link{} + + t.Run("nil and empty", func(t *testing.T) { + require.Nil(t, nexusLinkStrings(nil)) + require.Nil(t, nexusLinkStrings([]*commonpb.Link{})) + }) + + t.Run("workflow event link", func(t *testing.T) { + got := nexusLinkStrings([]*commonpb.Link{workflowEventLink()}) + require.Equal(t, []string{ + "temporal:///namespaces/ns/workflows/wf-id/run-id/history?eventID=1&eventType=WorkflowExecutionStarted&referenceType=EventReference", + }, got) + }) + + t.Run("activity and nexus operation links", func(t *testing.T) { + got := nexusLinkStrings([]*commonpb.Link{activityLink, nexusOperationLink}) + require.Len(t, got, 2) + require.Contains(t, got[0], "temporal://") + require.Contains(t, got[0], "act-id") + require.Contains(t, got[1], "temporal://") + require.Contains(t, got[1], "op-id") + }) + + t.Run("skips unsupported variants and preserves order", func(t *testing.T) { + got := nexusLinkStrings([]*commonpb.Link{otherLink, workflowEventLink(), otherLink}) + require.Len(t, got, 1) + require.Contains(t, got[0], "wf-id") + }) +} + +// TestPrintActivityDescription_LinksAndCallbacks verifies that activity describe +// renders the activity's Nexus links and its callbacks (including callback URL, +// links, and trigger) like workflow describe does. +func TestPrintActivityDescription_LinksAndCallbacks(t *testing.T) { + var buf bytes.Buffer + cctx := &CommandContext{Printer: &printer.Printer{Output: &buf}} + + resp := &workflowservice.DescribeActivityExecutionResponse{ + Info: &activitypb.ActivityExecutionInfo{ + ActivityId: "act-1", + RunId: "run-1", + ActivityType: &commonpb.ActivityType{Name: "MyActivity"}, + Status: enumspb.ACTIVITY_EXECUTION_STATUS_RUNNING, + TaskQueue: "tq", + Attempt: 1, + Links: []*commonpb.Link{workflowEventLink()}, + }, + Callbacks: []*activitypb.CallbackInfo{ + { + Trigger: &activitypb.CallbackInfo_Trigger{ + Variant: &activitypb.CallbackInfo_Trigger_ActivityClosed{ + ActivityClosed: &activitypb.CallbackInfo_ActivityClosed{}, + }, + }, + Info: &callbackpb.CallbackInfo{ + Callback: &commonpb.Callback{ + Variant: &commonpb.Callback_Nexus_{ + Nexus: &commonpb.Callback_Nexus{Url: "http://callback.example/cb"}, + }, + Links: []*commonpb.Link{workflowEventLink()}, + }, + State: enumspb.CALLBACK_STATE_SUCCEEDED, + Attempt: 2, + }, + }, + }, + } + + require.NoError(t, printActivityDescription(cctx, resp)) + out := buf.String() + + // Execution info. + require.Contains(t, out, "act-1") + require.Contains(t, out, "MyActivity") + // Top-level activity Links section. + require.Contains(t, out, "Links: 1") + require.Contains(t, out, "temporal:///namespaces/ns/workflows/wf-id/run-id/history") + // Callbacks section with URL, trigger, link, and state. + require.Contains(t, out, "Callbacks: 1") + require.Contains(t, out, "http://callback.example/cb") + require.Contains(t, out, "ActivityClosed") + require.Contains(t, out, "Succeeded") +} + +func TestPrintNexusOperationDescription_Links(t *testing.T) { + var buf bytes.Buffer + cctx := &CommandContext{Printer: &printer.Printer{Output: &buf}} + + desc := &client.NexusOperationExecutionDescription{ + RawInfo: &nexuspb.NexusOperationExecutionInfo{ + Links: []*commonpb.Link{workflowEventLink()}, + }, + } + desc.OperationID = "op-1" + desc.OperationRunID = "run-1" + + require.NoError(t, printNexusOperationDescription(cctx, desc)) + out := buf.String() + require.Contains(t, out, "op-1") + require.Contains(t, out, "Links: 1") + require.Contains(t, out, "temporal:///namespaces/ns/workflows/wf-id/run-id/history") +} diff --git a/internal/temporalcli/commands.nexus_operation.go b/internal/temporalcli/commands.nexus_operation.go index 6c0fcada3..b289e4456 100644 --- a/internal/temporalcli/commands.nexus_operation.go +++ b/internal/temporalcli/commands.nexus_operation.go @@ -302,7 +302,10 @@ func printNexusOperationDescription(cctx *CommandContext, desc *client.NexusOper Identity: desc.Identity, Summary: summary, } - return cctx.Printer.PrintStructured(d, printer.StructuredOptions{}) + if err := cctx.Printer.PrintStructured(d, printer.StructuredOptions{}); err != nil { + return err + } + return printLinks(cctx, desc.RawInfo.GetLinks()) } func (c *TemporalNexusOperationCancelCommand) run(cctx *CommandContext, args []string) error { diff --git a/internal/temporalcli/commands.workflow_view.go b/internal/temporalcli/commands.workflow_view.go index 7becc5af3..c44711a11 100644 --- a/internal/temporalcli/commands.workflow_view.go +++ b/internal/temporalcli/commands.workflow_view.go @@ -15,8 +15,6 @@ import ( "go.temporal.io/api/workflow/v1" "go.temporal.io/api/workflowservice/v1" "go.temporal.io/sdk/client" - - "go.temporal.io/sdk/temporalnexus" ) func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []string) error { @@ -251,44 +249,8 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin }, printer.StructuredOptions{}) } - if len(resp.Callbacks) > 0 { - cctx.Printer.Println() - cctx.Printer.Println(color.MagentaString("Callbacks: %v", len(resp.Callbacks))) - cctx.Printer.Println() - cbs := make([]struct { - URL string - Links []string - Trigger string - State enums.CallbackState - Attempt int32 - RegistrationTime time.Time `cli:",cardOmitEmpty"` - NextAttemptScheduleTime time.Time `cli:",cardOmitEmpty"` - LastAttemptCompleteTime time.Time `cli:",cardOmitEmpty"` - LastAttemptFailure *failure.Failure `cli:",cardOmitEmpty"` - BlockedReason string `cli:",cardOmitEmpty"` - }, len(resp.Callbacks)) - for i, cb := range resp.Callbacks { - cbs[i].URL = cb.GetCallback().GetNexus().GetUrl() - for _, link := range cb.GetCallback().GetLinks() { - if link.GetWorkflowEvent() != nil { - nexusLink := temporalnexus.ConvertLinkWorkflowEventToNexusLink(link.GetWorkflowEvent()) - cbs[i].Links = append(cbs[i].Links, nexusLink.URL.String()) - } - } - cbs[i].State = cb.GetState() - cbs[i].Attempt = cb.GetAttempt() - cbs[i].LastAttemptFailure = cb.LastAttemptFailure - cbs[i].LastAttemptCompleteTime = timestampToTime(cb.LastAttemptCompleteTime) - cbs[i].NextAttemptScheduleTime = timestampToTime(cb.NextAttemptScheduleTime) - cbs[i].RegistrationTime = timestampToTime(cb.RegistrationTime) - cbs[i].Trigger = "Unknown" - if cb.GetTrigger().GetWorkflowClosed() != nil { - cbs[i].Trigger = "WorkflowClosed" - } - cbs[i].BlockedReason = cb.GetBlockedReason() - } - _ = cctx.Printer.PrintStructured(cbs, printer.StructuredOptions{}) - cctx.Printer.Println() + if err := printCallbacks(cctx, resp.Callbacks); err != nil { + return err } if running {