diff --git a/.gitignore b/.gitignore index 14713bfa8..67040f2e7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ /.idea /.vscode /.zed +/.claude *~ diff --git a/go.mod b/go.mod index 1e12df649..d8eb430a8 100644 --- a/go.mod +++ b/go.mod @@ -16,10 +16,10 @@ require ( github.com/spf13/pflag v1.0.6 github.com/stretchr/testify v1.10.0 github.com/temporalio/ui-server/v2 v2.36.0 - go.temporal.io/api v1.46.0 - go.temporal.io/sdk v1.33.0 + go.temporal.io/api v1.50.0 + go.temporal.io/sdk v1.35.0 go.temporal.io/sdk/contrib/envconfig v0.1.0 - go.temporal.io/server v1.27.1 + go.temporal.io/server v1.28.0 google.golang.org/grpc v1.71.0 google.golang.org/protobuf v1.36.6 gopkg.in/yaml.v3 v3.0.1 @@ -35,10 +35,14 @@ require ( cloud.google.com/go/iam v1.4.2 // indirect cloud.google.com/go/monitoring v1.24.1 // indirect cloud.google.com/go/storage v1.51.0 // indirect + dario.cat/mergo v1.0.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/apache/thrift v0.21.0 // indirect github.com/aws/aws-sdk-go v1.55.6 // indirect github.com/benbjohnson/clock v1.3.5 // indirect @@ -76,6 +80,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/huandu/xstrings v1.5.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect @@ -92,7 +97,9 @@ require ( github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect github.com/olivere/elastic/v7 v7.0.32 // indirect @@ -110,15 +117,17 @@ require ( github.com/rivo/uniseg v0.4.7 // indirect github.com/robfig/cron v1.2.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/shopspring/decimal v1.4.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sony/gobreaker v1.0.0 // indirect + github.com/spf13/cast v1.7.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/temporalio/ringpop-go v0.0.0-20250130211428-b97329e994f7 // indirect github.com/temporalio/sqlparser v0.0.0-20231115171017-f4060bcfa6cb // indirect github.com/temporalio/tchannel-go v1.22.1-0.20240528171429-1db37fdea938 // indirect github.com/twmb/murmur3 v1.1.8 // indirect github.com/uber-common/bark v1.3.0 // indirect - github.com/uber-go/tally/v4 v4.1.17-0.20240412215630-22fe011f5ff0 // indirect + github.com/uber-go/tally/v4 v4.1.17 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect @@ -142,19 +151,18 @@ require ( go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.36.0 // indirect + golang.org/x/crypto v0.37.0 // indirect golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect - golang.org/x/net v0.38.0 // indirect + golang.org/x/net v0.39.0 // indirect golang.org/x/oauth2 v0.28.0 // indirect - golang.org/x/sync v0.12.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/text v0.23.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/text v0.24.0 // indirect golang.org/x/time v0.11.0 // indirect google.golang.org/api v0.228.0 // indirect google.golang.org/genproto v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect - gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/validator.v2 v2.0.1 // indirect modernc.org/cc/v4 v4.25.2 // indirect diff --git a/go.sum b/go.sum index b02078eac..ba109f2ec 100644 --- a/go.sum +++ b/go.sum @@ -21,6 +21,8 @@ cloud.google.com/go/storage v1.51.0 h1:ZVZ11zCiD7b3k+cH5lQs/qcNaoSz3U9I0jgwVzqDl cloud.google.com/go/storage v1.51.0/go.mod h1:YEJfu/Ki3i5oHC/7jyTgsGZwdQ8P9hqMqvpi5kRKGgc= cloud.google.com/go/trace v1.11.3 h1:c+I4YFjxRQjvAhRmSsmjpASUKq88chOX854ied0K/pE= cloud.google.com/go/trace v1.11.3/go.mod h1:pt7zCYiDSQjC9Y2oqCsh9jF4GStB/hmjrYLsxRR27q8= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -37,6 +39,12 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 h1:6/0iUd0xrnX7qt+mLNRwg5c0PGv8wpE8K90ryANQwMI= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0/go.mod h1:otE2jQekW/PqXk1Awf5lmfokJx4uwuqcj1ab5SpGeW0= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= +github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alitto/pond v1.9.2 h1:9Qb75z/scEZVCoSU+osVmQ0I0JOeLfdTDafrbcJ8CLs= github.com/alitto/pond v1.9.2/go.mod h1:xQn3P/sHTYcU/1BR3i86IGIrilcrGC2LiS+E2+CJWsI= @@ -111,6 +119,8 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-faker/faker/v4 v4.6.0 h1:6aOPzNptRiDwD14HuAnEtlTa+D1IfFuEHO8+vEFwjTs= github.com/go-faker/faker/v4 v4.6.0/go.mod h1:ZmrHuVtTTm2Em9e0Du6CJ9CADaLEzGXW62z1YqFH0m0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -181,6 +191,8 @@ github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -236,8 +248,12 @@ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6T github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= @@ -290,12 +306,16 @@ github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/samuel/go-thrift v0.0.0-20190219015601-e8b6b52668fe/go.mod h1:Vrkh1pnjV9Bl8c3P9zH0/D4NlOHWP5d4/hF4YTULaec= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/sirupsen/logrus v1.0.2-0.20170726183946-abee6f9b0679/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sony/gobreaker v1.0.0 h1:feX5fGGXSl3dYd4aHZItw+FpHLvvoaqkawKjVNiFMNQ= github.com/sony/gobreaker v1.0.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= @@ -326,8 +346,8 @@ github.com/uber-common/bark v1.0.0/go.mod h1:g0ZuPcD7XiExKHynr93Q742G/sbrdVQkghr github.com/uber-common/bark v1.3.0 h1:DkuZCBaQS9LWuNAPrCO6yQVANckIX3QI0QwLemUnzCo= github.com/uber-common/bark v1.3.0/go.mod h1:5fDe/YcIVP55XhFF9hUihX2lDsDcpFrTZEAwAVwtPDw= github.com/uber-go/tally v3.3.15+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU= -github.com/uber-go/tally/v4 v4.1.17-0.20240412215630-22fe011f5ff0 h1:z5IgRoL16N7tdzn5oikX2G4oVXopW+CWo3XRxx61OQo= -github.com/uber-go/tally/v4 v4.1.17-0.20240412215630-22fe011f5ff0/go.mod h1:ZdpiHRGSa3z4NIAc1VlEH4SiknR885fOIF08xmS0gaU= +github.com/uber-go/tally/v4 v4.1.17 h1:C+U4BKtVDXTszuzU+WH8JVQvRVnaVKxzZrROFyDrvS8= +github.com/uber-go/tally/v4 v4.1.17/go.mod h1:ZdpiHRGSa3z4NIAc1VlEH4SiknR885fOIF08xmS0gaU= github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM= github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= @@ -370,14 +390,14 @@ go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= -go.temporal.io/api v1.46.0 h1:O1efPDB6O2B8uIeCDIa+3VZC7tZMvYsMZYQapSbHvCg= -go.temporal.io/api v1.46.0/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM= -go.temporal.io/sdk v1.33.0 h1:T91UzeRdlHTiMGgpygsItOH9+VSkg+M/mG85PqNjdog= -go.temporal.io/sdk v1.33.0/go.mod h1:WwCmJZLy7zabz3ar5NRAQEygsdP8tgR9sDjISSHuWZw= +go.temporal.io/api v1.50.0 h1:7s8Cn+fKfNx9G0v2Ge9We6X2WiCA3JvJ9JryeNbx1Bc= +go.temporal.io/api v1.50.0/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM= +go.temporal.io/sdk v1.35.0 h1:lRNAQ5As9rLgYa7HBvnmKyzxLcdElTuoFJ0FXM/AsLQ= +go.temporal.io/sdk v1.35.0/go.mod h1:1q5MuLc2MEJ4lneZTHJzpVebW2oZnyxoIOWX3oFVebw= go.temporal.io/sdk/contrib/envconfig v0.1.0 h1:s+G/Ujph+Xl2jzLiiIm2T1vuijDkUL4Kse49dgDVGBE= go.temporal.io/sdk/contrib/envconfig v0.1.0/go.mod h1:FQEO3C56h9C7M6sDgSanB8HnBTmopw9qgVx4F1S6pJk= -go.temporal.io/server v1.27.1 h1:0dyBl25Ua7P4IOXifJg0xUXfnoYTNY1IlUFf1RL4OBo= -go.temporal.io/server v1.27.1/go.mod h1:ddxnsbsXvdZ/oRvjLHaL45NJUGMOPW+3RLkhpq9TOAs= +go.temporal.io/server v1.28.0 h1:1rLPrT21ZwpsRjElJqSgThj1NZSAtAPyi8nKX+EAkgo= +go.temporal.io/server v1.28.0/go.mod h1:yri8PdZoAtwI9p65hzvABf11WqXelHl/HabbrnJSu+g= go.temporal.io/version v0.3.0 h1:dMrei9l9NyHt8nG6EB8vAwDLLTwx2SvRyucCSumAiig= go.temporal.io/version v0.3.0/go.mod h1:UA9S8/1LaKYae6TyD9NaPMJTZb911JcbqghI2CBSP78= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -409,8 +429,8 @@ 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.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= 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-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -450,8 +470,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.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= @@ -463,8 +483,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.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -485,8 +505,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.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.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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= @@ -499,8 +519,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.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -559,8 +579,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/go-jose/go-jose.v2 v2.6.3 h1:nt80fvSDlhKWQgSWyHyy5CfmlQr+asih51R8PTWNKKs= -gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY= diff --git a/temporalcli/commands.gen.go b/temporalcli/commands.gen.go index a171230e1..a79941694 100644 --- a/temporalcli/commands.gen.go +++ b/temporalcli/commands.gen.go @@ -129,12 +129,28 @@ func (v *DeploymentNameOptions) buildFlags(cctx *CommandContext, f *pflag.FlagSe } type DeploymentVersionOptions struct { - Version string + DeploymentName string + BuildId string } func (v *DeploymentVersionOptions) buildFlags(cctx *CommandContext, f *pflag.FlagSet) { - f.StringVarP(&v.Version, "version", "v", "", "Fully-qualified name for a Worker Deployment Version. Use the format `YourDeploymentName.YourBuildID`. Required.") - _ = cobra.MarkFlagRequired(f, "version") + f.StringVar(&v.DeploymentName, "deployment-name", "", "Name of the Worker Deployment. Required.") + _ = cobra.MarkFlagRequired(f, "deployment-name") + f.StringVar(&v.BuildId, "build-id", "", "Build ID of the Worker Deployment Version. Required.") + _ = cobra.MarkFlagRequired(f, "build-id") +} + +type DeploymentVersionOrUnversionedOptions struct { + DeploymentName string + BuildId string + Unversioned bool +} + +func (v *DeploymentVersionOrUnversionedOptions) buildFlags(cctx *CommandContext, f *pflag.FlagSet) { + f.StringVar(&v.DeploymentName, "deployment-name", "", "Name of the Worker Deployment. Required.") + _ = cobra.MarkFlagRequired(f, "deployment-name") + f.StringVar(&v.BuildId, "build-id", "", "Build ID of the Worker Deployment Version. Required unless --unversioned is specified.") + f.BoolVar(&v.Unversioned, "unversioned", false, "Set unversioned workers as the target version. Cannot be used with --build-id.") } type DeploymentReferenceOptions struct { @@ -473,9 +489,9 @@ func NewTemporalActivityPauseCommand(cctx *CommandContext, parent *TemporalActiv s.Command.Use = "pause [flags]" s.Command.Short = "Pause an Activity" if hasHighlighting { - s.Command.Long = "Pause an Activity.\n\nIf the Activity is not currently running (e.g. because it previously\nfailed), it will not be run again until it is unpaused.\n\nHowever, if the Activity is currently running, it will run to completion.\nIf the Activity is on its last retry attempt and fails, the failure will\nbe returned to the caller, just as if the Activity had not been paused.\n\nActivities can be specified by their Activity ID or Activity Type. \nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nSpecify the Activity and Workflow IDs:\n\n\x1b[1mtemporal activity pause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\x1b[0m" + s.Command.Long = "Pause an Activity.\n\nIf the Activity is not currently running (e.g. because it previously\nfailed), it will not be run again until it is unpaused.\n\nHowever, if the Activity is currently running, it will run to completion.\nIf the Activity is on its last retry attempt and fails, the failure will\nbe returned to the caller, just as if the Activity had not been paused.\n\nActivities can be specified by their Activity ID or Activity Type.\nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nSpecify the Activity and Workflow IDs:\n\n\x1b[1mtemporal activity pause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\x1b[0m" } else { - s.Command.Long = "Pause an Activity.\n\nIf the Activity is not currently running (e.g. because it previously\nfailed), it will not be run again until it is unpaused.\n\nHowever, if the Activity is currently running, it will run to completion.\nIf the Activity is on its last retry attempt and fails, the failure will\nbe returned to the caller, just as if the Activity had not been paused.\n\nActivities can be specified by their Activity ID or Activity Type. \nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nSpecify the Activity and Workflow IDs:\n\n```\ntemporal activity pause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n```" + s.Command.Long = "Pause an Activity.\n\nIf the Activity is not currently running (e.g. because it previously\nfailed), it will not be run again until it is unpaused.\n\nHowever, if the Activity is currently running, it will run to completion.\nIf the Activity is on its last retry attempt and fails, the failure will\nbe returned to the caller, just as if the Activity had not been paused.\n\nActivities can be specified by their Activity ID or Activity Type.\nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nSpecify the Activity and Workflow IDs:\n\n```\ntemporal activity pause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n```" } s.Command.Args = cobra.NoArgs s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "Activity ID to pause.") @@ -508,9 +524,9 @@ func NewTemporalActivityResetCommand(cctx *CommandContext, parent *TemporalActiv s.Command.Use = "reset [flags]" s.Command.Short = "Reset an Activity" if hasHighlighting { - s.Command.Long = "Resetting an activity resets both the number of attempts and the activity \ntimeout. \n\nIf activity is paused and 'keep_paused' flag is not provided - it will be \nunpaused.\nIf activity is paused and 'keep_paused' flag is provided - it will stay \npaused.\nIf activity is waiting for the retry, is will be rescheduled immediately.\nIf the 'reset_heartbeats' flag is set, the activity heartbeat timer and \nheartbeats will be reset.\n\nActivities can be specified by their Activity ID or Activity Type. \nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored. \n\nSpecify the Activity Type of ID and Workflow IDs:\n\n\x1b[1mtemporal activity reset \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --keep-paused\n --reset-heartbeats\x1b[0m" + s.Command.Long = "Resetting an activity resets both the number of attempts and the activity\ntimeout.\n\nIf activity is paused and 'keep_paused' flag is not provided - it will be\nunpaused.\nIf activity is paused and 'keep_paused' flag is provided - it will stay\npaused.\nIf activity is waiting for the retry, is will be rescheduled immediately.\nIf the 'reset_heartbeats' flag is set, the activity heartbeat timer and\nheartbeats will be reset.\n\nActivities can be specified by their Activity ID or Activity Type.\nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nSpecify the Activity Type of ID and Workflow IDs:\n\n\x1b[1mtemporal activity reset \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --keep-paused\n --reset-heartbeats\x1b[0m" } else { - s.Command.Long = "Resetting an activity resets both the number of attempts and the activity \ntimeout. \n\nIf activity is paused and 'keep_paused' flag is not provided - it will be \nunpaused.\nIf activity is paused and 'keep_paused' flag is provided - it will stay \npaused.\nIf activity is waiting for the retry, is will be rescheduled immediately.\nIf the 'reset_heartbeats' flag is set, the activity heartbeat timer and \nheartbeats will be reset.\n\nActivities can be specified by their Activity ID or Activity Type. \nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored. \n\nSpecify the Activity Type of ID and Workflow IDs:\n\n```\ntemporal activity reset \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --keep-paused\n --reset-heartbeats\n```" + s.Command.Long = "Resetting an activity resets both the number of attempts and the activity\ntimeout.\n\nIf activity is paused and 'keep_paused' flag is not provided - it will be\nunpaused.\nIf activity is paused and 'keep_paused' flag is provided - it will stay\npaused.\nIf activity is waiting for the retry, is will be rescheduled immediately.\nIf the 'reset_heartbeats' flag is set, the activity heartbeat timer and\nheartbeats will be reset.\n\nActivities can be specified by their Activity ID or Activity Type.\nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nSpecify the Activity Type of ID and Workflow IDs:\n\n```\ntemporal activity reset \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --keep-paused\n --reset-heartbeats\n```" } s.Command.Args = cobra.NoArgs s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "Activity ID to pause.") @@ -547,9 +563,9 @@ func NewTemporalActivityUnpauseCommand(cctx *CommandContext, parent *TemporalAct s.Command.Use = "unpause [flags]" s.Command.Short = "Unpause an Activity" if hasHighlighting { - s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires. \n\nUse \x1b[1m--reset-attempts\x1b[0m to reset the number of previous run attempts to \nzero. For example, if an Activity is near the maximum number of attempts \nN specified in its retry policy, \x1b[1m--reset-attempts\x1b[0m will allow the \nActivity to be retried another N times after unpausing.\n\nUse \x1b[1m--reset-heartbeat\x1b[0m to reset the Activity's heartbeats. \n\nActivities can be specified by their Activity ID or Activity Type. \nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n\x1b[1mtemporal activity unpause \\\n --query YourQuery \\\n --reason YourReasonForTermination\x1b[0m\n\n\nSpecify the Activity ID or Type and Workflow IDs:\n\n\x1b[1mtemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --reset-attempts\n --reset-heartbeats\x1b[0m" + s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nUse \x1b[1m--reset-attempts\x1b[0m to reset the number of previous run attempts to\nzero. For example, if an Activity is near the maximum number of attempts\nN specified in its retry policy, \x1b[1m--reset-attempts\x1b[0m will allow the\nActivity to be retried another N times after unpausing.\n\nUse \x1b[1m--reset-heartbeat\x1b[0m to reset the Activity's heartbeats.\n\nActivities can be specified by their Activity ID or Activity Type.\nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n\x1b[1mtemporal activity unpause \\\n --query YourQuery \\\n --reason YourReasonForTermination\x1b[0m\n\n\nSpecify the Activity ID or Type and Workflow IDs:\n\n\x1b[1mtemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --reset-attempts\n --reset-heartbeats\x1b[0m" } else { - s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires. \n\nUse `--reset-attempts` to reset the number of previous run attempts to \nzero. For example, if an Activity is near the maximum number of attempts \nN specified in its retry policy, `--reset-attempts` will allow the \nActivity to be retried another N times after unpausing.\n\nUse `--reset-heartbeat` to reset the Activity's heartbeats. \n\nActivities can be specified by their Activity ID or Activity Type. \nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n```\ntemporal activity unpause \\\n --query YourQuery \\\n --reason YourReasonForTermination\n```\n\n\nSpecify the Activity ID or Type and Workflow IDs:\n\n```\ntemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --reset-attempts\n --reset-heartbeats\n```" + s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nUse `--reset-attempts` to reset the number of previous run attempts to\nzero. For example, if an Activity is near the maximum number of attempts\nN specified in its retry policy, `--reset-attempts` will allow the\nActivity to be retried another N times after unpausing.\n\nUse `--reset-heartbeat` to reset the Activity's heartbeats.\n\nActivities can be specified by their Activity ID or Activity Type.\nOne of those parameters must be provided. If both are provided - Activity\nType will be used, and Activity ID will be ignored.\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n```\ntemporal activity unpause \\\n --query YourQuery \\\n --reason YourReasonForTermination\n```\n\n\nSpecify the Activity ID or Type and Workflow IDs:\n\n```\ntemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --reset-attempts\n --reset-heartbeats\n```" } s.Command.Args = cobra.NoArgs s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "Activity ID to unpause. Can only be used without --query.") @@ -557,7 +573,7 @@ func NewTemporalActivityUnpauseCommand(cctx *CommandContext, parent *TemporalAct s.Command.Flags().StringVar(&s.Identity, "identity", "", "Identity of the user submitting this request.") s.Command.Flags().BoolVar(&s.ResetAttempts, "reset-attempts", false, "Also reset the activity attempts.") s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats. Only works with --reset-attempts.") - s.Command.Flags().BoolVar(&s.MatchAll, "match-all", false, "Every paused activity should be unpaused. This flag is ignored if activity-type is provided. Can only be used with --query.") + s.Command.Flags().BoolVar(&s.MatchAll, "match-all", false, "Every paused activity should be unpaused. This flag is ignored if activity-type is provided. Can only be used with --query.") s.Jitter = 0 s.Command.Flags().VarP(&s.Jitter, "jitter", "j", "The activity will start at random a time within the specified duration. Can only be used with --query.") s.SingleWorkflowOrBatchOptions.buildFlags(cctx, s.Command.Flags()) @@ -2733,9 +2749,9 @@ func NewTemporalWorkerDeploymentCommand(cctx *CommandContext, parent *TemporalWo s.Command.Use = "deployment" s.Command.Short = "Describe, list, and operate on Worker Deployments and Versions" if hasHighlighting { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDeployment commands perform operations on Worker Deployments:\n\n\x1b[1mtemporal worker deployment [command] [options]\x1b[0m\n\nFor example:\n\n\x1b[1mtemporal worker deployment list\x1b[0m\n\nLists the Deployments in the client's namespace.\n\nArguments can be Worker Deployment Versions associated with\na Deployment, using a fully qualified Version identifier that\nconcatenates the Deployment Name and the Build ID with the\nreserved separator \".\".\n\nFor example:\n\n\x1b[1mtemporal worker deployment set-current-version \\\n --version YourDeploymentName.YourBuildID\x1b[0m\n\nSets the current Deployment Version for a given Deployment." + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDeployment commands perform operations on Worker Deployments:\n\n\x1b[1mtemporal worker deployment [command] [options]\x1b[0m\n\nFor example:\n\n\x1b[1mtemporal worker deployment list\x1b[0m\n\nLists the Deployments in the client's namespace.\n\nArguments can be Worker Deployment Versions associated with\na Deployment, specified using the Deployment name and Build ID.\n\nFor example:\n\n\x1b[1mtemporal worker deployment set-current-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID\x1b[0m\n\nSets the current Deployment Version for a given Deployment." } else { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDeployment commands perform operations on Worker Deployments:\n\n```\ntemporal worker deployment [command] [options]\n```\n\nFor example:\n\n```\ntemporal worker deployment list\n```\n\nLists the Deployments in the client's namespace.\n\nArguments can be Worker Deployment Versions associated with\na Deployment, using a fully qualified Version identifier that\nconcatenates the Deployment Name and the Build ID with the\nreserved separator \".\".\n\nFor example:\n\n```\ntemporal worker deployment set-current-version \\\n --version YourDeploymentName.YourBuildID\n```\n\nSets the current Deployment Version for a given Deployment." + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDeployment commands perform operations on Worker Deployments:\n\n```\ntemporal worker deployment [command] [options]\n```\n\nFor example:\n\n```\ntemporal worker deployment list\n```\n\nLists the Deployments in the client's namespace.\n\nArguments can be Worker Deployment Versions associated with\na Deployment, specified using the Deployment name and Build ID.\n\nFor example:\n\n```\ntemporal worker deployment set-current-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID\n```\n\nSets the current Deployment Version for a given Deployment." } s.Command.Args = cobra.NoArgs s.Command.AddCommand(&NewTemporalWorkerDeploymentDeleteCommand(cctx, &s).Command) @@ -2793,9 +2809,9 @@ func NewTemporalWorkerDeploymentDeleteVersionCommand(cctx *CommandContext, paren s.Command.Use = "delete-version [flags]" s.Command.Short = "Delete a Worker Deployment Version" if hasHighlighting { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nRemove a Worker Deployment Version given its fully-qualified identifier.\nThis is rarely needed during normal operation\nsince unused Versions are eventually garbage collected.\nThe client can delete a Version only when all of the following conditions\nare met:\n - It is not the Current or Ramping Version for this Deployment.\n - It has no active pollers, i.e., none of the task queues in the\n Version have pollers.\n - It is not draining. This requirement can be ignored with the option\n\x1b[1m--skip-drainage\x1b[0m.\n\n\x1b[1mtemporal worker deployment delete-version [options]\x1b[0m\n\nFor example, skipping the drainage restriction:\n\n\x1b[1mtemporal worker deployment delete-version \\\n --version YourDeploymentName.YourBuildID \\\n --skip-drainage \x1b[0m" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nRemove a Worker Deployment Version given its fully-qualified identifier.\nThis is rarely needed during normal operation\nsince unused Versions are eventually garbage collected.\nThe client can delete a Version only when all of the following conditions\nare met:\n - It is not the Current or Ramping Version for this Deployment.\n - It has no active pollers, i.e., none of the task queues in the\n Version have pollers.\n - It is not draining. This requirement can be ignored with the option\n\x1b[1m--skip-drainage\x1b[0m.\n\x1b[1mtemporal worker deployment delete-version [options]\x1b[0m\n\nFor example, skipping the drainage restriction:\n\n\x1b[1mtemporal worker deployment delete-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --skip-drainage\x1b[0m" } else { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nRemove a Worker Deployment Version given its fully-qualified identifier.\nThis is rarely needed during normal operation\nsince unused Versions are eventually garbage collected.\nThe client can delete a Version only when all of the following conditions\nare met:\n - It is not the Current or Ramping Version for this Deployment.\n - It has no active pollers, i.e., none of the task queues in the\n Version have pollers.\n - It is not draining. This requirement can be ignored with the option\n`--skip-drainage`.\n\n```\ntemporal worker deployment delete-version [options]\n```\n\nFor example, skipping the drainage restriction:\n\n```\ntemporal worker deployment delete-version \\\n --version YourDeploymentName.YourBuildID \\\n --skip-drainage \n```" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nRemove a Worker Deployment Version given its fully-qualified identifier.\nThis is rarely needed during normal operation\nsince unused Versions are eventually garbage collected.\nThe client can delete a Version only when all of the following conditions\nare met:\n - It is not the Current or Ramping Version for this Deployment.\n - It has no active pollers, i.e., none of the task queues in the\n Version have pollers.\n - It is not draining. This requirement can be ignored with the option\n`--skip-drainage`.\n```\ntemporal worker deployment delete-version [options]\n```\n\nFor example, skipping the drainage restriction:\n\n```\ntemporal worker deployment delete-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --skip-drainage\n```" } s.Command.Args = cobra.NoArgs s.Command.Flags().StringVar(&s.Identity, "identity", "", "Identity of the user submitting this request.") @@ -2849,9 +2865,9 @@ func NewTemporalWorkerDeploymentDescribeVersionCommand(cctx *CommandContext, par s.Command.Use = "describe-version [flags]" s.Command.Short = "Show properties of a Worker Deployment Version" if hasHighlighting { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDescribe properties of a Worker Deployment Version, such as the task \nqueues polled by workers in this Deployment Version, or drainage\ninformation required to safely decommission workers, or user-provided\nmetadata, or its creation/modification time.\n\n\x1b[1mtemporal worker deployment describe-version [options]\x1b[0m\n\nFor example, to describe a deployment version in a deployment\n\x1b[1mYourDeploymentName\x1b[0m, with Build ID \x1b[1mYourBuildID\x1b[0m, and in the default\nnamespace:\n\n\x1b[1mtemporal worker deployment describe-version \\\n --version YourDeploymentName.YourBuildID\x1b[0m" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDescribe properties of a Worker Deployment Version, such as the task\nqueues polled by workers in this Deployment Version, or drainage\ninformation required to safely decommission workers, or user-provided\nmetadata, or its creation/modification time.\n\n\x1b[1mtemporal worker deployment describe-version [options]\x1b[0m\n\nFor example, to describe a deployment version in a deployment\n\x1b[1mYourDeploymentName\x1b[0m, with Build ID \x1b[1mYourBuildID\x1b[0m, and in the default\nnamespace:\n\n\x1b[1mtemporal worker deployment describe-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID\x1b[0m" } else { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDescribe properties of a Worker Deployment Version, such as the task \nqueues polled by workers in this Deployment Version, or drainage\ninformation required to safely decommission workers, or user-provided\nmetadata, or its creation/modification time.\n\n```\ntemporal worker deployment describe-version [options]\n```\n\nFor example, to describe a deployment version in a deployment\n`YourDeploymentName`, with Build ID `YourBuildID`, and in the default\nnamespace:\n\n```\ntemporal worker deployment describe-version \\\n --version YourDeploymentName.YourBuildID\n```" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nDescribe properties of a Worker Deployment Version, such as the task\nqueues polled by workers in this Deployment Version, or drainage\ninformation required to safely decommission workers, or user-provided\nmetadata, or its creation/modification time.\n\n```\ntemporal worker deployment describe-version [options]\n```\n\nFor example, to describe a deployment version in a deployment\n`YourDeploymentName`, with Build ID `YourBuildID`, and in the default\nnamespace:\n\n```\ntemporal worker deployment describe-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID\n```" } s.Command.Args = cobra.NoArgs s.DeploymentVersionOptions.buildFlags(cctx, s.Command.Flags()) @@ -2891,8 +2907,7 @@ func NewTemporalWorkerDeploymentListCommand(cctx *CommandContext, parent *Tempor type TemporalWorkerDeploymentSetCurrentVersionCommand struct { Parent *TemporalWorkerDeploymentCommand Command cobra.Command - DeploymentVersionOptions - DeploymentName string + DeploymentVersionOrUnversionedOptions Identity string IgnoreMissingTaskQueues bool Yes bool @@ -2905,16 +2920,15 @@ func NewTemporalWorkerDeploymentSetCurrentVersionCommand(cctx *CommandContext, p s.Command.Use = "set-current-version [flags]" s.Command.Short = "Make a Worker Deployment Version Current for a Deployment" if hasHighlighting { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Current Version for a Deployment.\nWhen a Version is current, Workers of that Deployment Version will receive\ntasks from new Workflows, and from existing AutoUpgrade Workflows that\nare running on this Deployment.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Version the request will fail. To override this protection use\n\x1b[1m--ignore-missing-task-queues\x1b[0m. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n\x1b[1mtemporal worker deployment set-current-version [options]\x1b[0m\n\nFor example, to set the Current Version of a deployment\n\x1b[1mYourDeploymentName\x1b[0m, with a version with Build ID \x1b[1mYourBuildID\x1b[0m, and\nin the default namespace:\n\n\x1b[1mtemporal worker deployment set-current-version \\\n --version YourDeploymentName.YourBuildID\x1b[0m\n\nThe target of set-current-version can also be \x1b[1m__unversioned__\x1b[0m, which\nmoves tasks to unversioned workers, but in this case we also need to\nspecify the Deployment Name.\n\n\x1b[1mtemporal worker deployment set-current-version \\\n --version __unversioned__ \\\n --deployment-name YourDeploymentName\x1b[0m" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Current Version for a Deployment.\nWhen a Version is current, Workers of that Deployment Version will receive\ntasks from new Workflows, and from existing AutoUpgrade Workflows that\nare running on this Deployment.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Version the request will fail. To override this protection use\n\x1b[1m--ignore-missing-task-queues\x1b[0m. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n\x1b[1mtemporal worker deployment set-current-version [options]\x1b[0m\n\nFor example, to set the Current Version of a deployment\n\x1b[1mYourDeploymentName\x1b[0m, with a version with Build ID \x1b[1mYourBuildID\x1b[0m, and\nin the default namespace:\n\n\x1b[1mtemporal worker deployment set-current-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID\x1b[0m\n\nThe target of set-current-version can also be unversioned workers:\n\n\x1b[1mtemporal worker deployment set-current-version \\\n --deployment-name YourDeploymentName --unversioned\x1b[0m" } else { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Current Version for a Deployment.\nWhen a Version is current, Workers of that Deployment Version will receive\ntasks from new Workflows, and from existing AutoUpgrade Workflows that\nare running on this Deployment.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Version the request will fail. To override this protection use\n`--ignore-missing-task-queues`. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n```\ntemporal worker deployment set-current-version [options]\n```\n\nFor example, to set the Current Version of a deployment\n`YourDeploymentName`, with a version with Build ID `YourBuildID`, and\nin the default namespace:\n\n```\ntemporal worker deployment set-current-version \\\n --version YourDeploymentName.YourBuildID\n```\n\nThe target of set-current-version can also be `__unversioned__`, which\nmoves tasks to unversioned workers, but in this case we also need to\nspecify the Deployment Name.\n\n```\ntemporal worker deployment set-current-version \\\n --version __unversioned__ \\\n --deployment-name YourDeploymentName\n```" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Current Version for a Deployment.\nWhen a Version is current, Workers of that Deployment Version will receive\ntasks from new Workflows, and from existing AutoUpgrade Workflows that\nare running on this Deployment.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Version the request will fail. To override this protection use\n`--ignore-missing-task-queues`. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n```\ntemporal worker deployment set-current-version [options]\n```\n\nFor example, to set the Current Version of a deployment\n`YourDeploymentName`, with a version with Build ID `YourBuildID`, and\nin the default namespace:\n\n```\ntemporal worker deployment set-current-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID\n```\n\nThe target of set-current-version can also be unversioned workers:\n\n```\ntemporal worker deployment set-current-version \\\n --deployment-name YourDeploymentName --unversioned\n```" } s.Command.Args = cobra.NoArgs - s.Command.Flags().StringVar(&s.DeploymentName, "deployment-name", "", "Deployment name. Only needed when `--version` is `__unversioned__` or empty.") s.Command.Flags().StringVar(&s.Identity, "identity", "", "Identity of the user submitting this request.") s.Command.Flags().BoolVar(&s.IgnoreMissingTaskQueues, "ignore-missing-task-queues", false, "Override protection to accidentally remove task queues.") s.Command.Flags().BoolVarP(&s.Yes, "yes", "y", false, "Don't prompt to confirm set Current Version.") - s.DeploymentVersionOptions.buildFlags(cctx, s.Command.Flags()) + s.DeploymentVersionOrUnversionedOptions.buildFlags(cctx, s.Command.Flags()) s.Command.Run = func(c *cobra.Command, args []string) { if err := s.run(cctx, args); err != nil { cctx.Options.Fail(err) @@ -2926,8 +2940,7 @@ func NewTemporalWorkerDeploymentSetCurrentVersionCommand(cctx *CommandContext, p type TemporalWorkerDeploymentSetRampingVersionCommand struct { Parent *TemporalWorkerDeploymentCommand Command cobra.Command - DeploymentVersionOptions - DeploymentName string + DeploymentVersionOrUnversionedOptions Percentage float32 Delete bool Identity string @@ -2942,18 +2955,17 @@ func NewTemporalWorkerDeploymentSetRampingVersionCommand(cctx *CommandContext, p s.Command.Use = "set-ramping-version [flags]" s.Command.Short = "Change Version Ramping settings for a Worker Deployment" if hasHighlighting { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Ramping Version and Percentage for a Deployment.\n\nThe Ramping Version can be set to a fully-qualified Version of the form\n\x1b[1mYourDeploymentName.YourBuildID\x1b[0m, or set to \"__unversioned__\", a special\nvalue that represents all the unversioned workers.\n\nThe Ramping Percentage is a float with values in the range [0, 100].\nA value of 100 does not make the Ramping Version Current, use\n\x1b[1mset-current-version\x1b[0m instead.\n\nTo remove a Ramping Version use the flag \x1b[1m--delete\x1b[0m.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Ramping Version the request will fail. To override this protection use\n\x1b[1m--ignore-missing-task-queues\x1b[0m. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n\x1b[1mtemporal worker deployment set-ramping-version [options]\x1b[0m\n\nFor example, to set the Ramping Version of a deployment\n\x1b[1mYourDeploymentName\x1b[0m, with a version with Build ID \x1b[1mYourBuildID\x1b[0m, with\n10 percent of tasks redirected to this version, and\nusing the default namespace:\n\n\x1b[1mtemporal worker deployment set-ramping-version \\\n --version YourDeploymentName.YourBuildID\n --percentage 10.0\x1b[0m\n\nAnd to remove that ramping:\n\n\x1b[1mtemporal worker deployment set-ramping-version \\\n --version YourDeploymentName.YourBuildID \\\n --delete\x1b[0m" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Ramping Version and Percentage for a Deployment.\n\nThe Ramping Version can be set using deployment name and build ID,\nor set to unversioned workers using the --unversioned flag.\n\nThe Ramping Percentage is a float with values in the range [0, 100].\nA value of 100 does not make the Ramping Version Current, use\n\x1b[1mset-current-version\x1b[0m instead.\n\nTo remove a Ramping Version use the flag \x1b[1m--delete\x1b[0m.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Ramping Version the request will fail. To override this protection use\n\x1b[1m--ignore-missing-task-queues\x1b[0m. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n\x1b[1mtemporal worker deployment set-ramping-version [options]\x1b[0m\n\nFor example, to set the Ramping Version of a deployment\n\x1b[1mYourDeploymentName\x1b[0m, with a version with Build ID \x1b[1mYourBuildID\x1b[0m, with\n10 percent of tasks redirected to this version, and\nusing the default namespace:\n\n\x1b[1mtemporal worker deployment set-ramping-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --percentage 10.0\x1b[0m\n\nAnd to remove that ramping:\n\x1b[1mtemporal worker deployment set-ramping-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --delete\x1b[0m" } else { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Ramping Version and Percentage for a Deployment.\n\nThe Ramping Version can be set to a fully-qualified Version of the form\n`YourDeploymentName.YourBuildID`, or set to \"__unversioned__\", a special\nvalue that represents all the unversioned workers.\n\nThe Ramping Percentage is a float with values in the range [0, 100].\nA value of 100 does not make the Ramping Version Current, use\n`set-current-version` instead.\n\nTo remove a Ramping Version use the flag `--delete`.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Ramping Version the request will fail. To override this protection use\n`--ignore-missing-task-queues`. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n```\ntemporal worker deployment set-ramping-version [options]\n```\n\nFor example, to set the Ramping Version of a deployment\n`YourDeploymentName`, with a version with Build ID `YourBuildID`, with\n10 percent of tasks redirected to this version, and\nusing the default namespace:\n\n```\ntemporal worker deployment set-ramping-version \\\n --version YourDeploymentName.YourBuildID\n --percentage 10.0\n```\n\nAnd to remove that ramping:\n\n```\ntemporal worker deployment set-ramping-version \\\n --version YourDeploymentName.YourBuildID \\\n --delete\n```" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\n\nSet the Ramping Version and Percentage for a Deployment.\n\nThe Ramping Version can be set using deployment name and build ID,\nor set to unversioned workers using the --unversioned flag.\n\nThe Ramping Percentage is a float with values in the range [0, 100].\nA value of 100 does not make the Ramping Version Current, use\n`set-current-version` instead.\n\nTo remove a Ramping Version use the flag `--delete`.\n\nIf not all the expected Task Queues are being polled by Workers in the\nnew Ramping Version the request will fail. To override this protection use\n`--ignore-missing-task-queues`. Note that this would ignore task queues\nin a deployment that are not yet discovered, leading to inconsistent task\nqueue configuration.\n\n```\ntemporal worker deployment set-ramping-version [options]\n```\n\nFor example, to set the Ramping Version of a deployment\n`YourDeploymentName`, with a version with Build ID `YourBuildID`, with\n10 percent of tasks redirected to this version, and\nusing the default namespace:\n\n```\ntemporal worker deployment set-ramping-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --percentage 10.0\n```\n\nAnd to remove that ramping:\n```\ntemporal worker deployment set-ramping-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --delete\n```" } s.Command.Args = cobra.NoArgs - s.Command.Flags().StringVar(&s.DeploymentName, "deployment-name", "", "Deployment name. Only needed when `--version` is `__unversioned__`.") s.Command.Flags().Float32Var(&s.Percentage, "percentage", 0, "Percentage of tasks redirected to the Ramping Version. Valid range [0,100].") s.Command.Flags().BoolVar(&s.Delete, "delete", false, "Delete the Ramping Version.") s.Command.Flags().StringVar(&s.Identity, "identity", "", "Identity of the user submitting this request.") s.Command.Flags().BoolVar(&s.IgnoreMissingTaskQueues, "ignore-missing-task-queues", false, "Override protection to accidentally remove task queues.") s.Command.Flags().BoolVarP(&s.Yes, "yes", "y", false, "Don't prompt to confirm set Ramping Version.") - s.DeploymentVersionOptions.buildFlags(cctx, s.Command.Flags()) + s.DeploymentVersionOrUnversionedOptions.buildFlags(cctx, s.Command.Flags()) s.Command.Run = func(c *cobra.Command, args []string) { if err := s.run(cctx, args); err != nil { cctx.Options.Fail(err) @@ -2977,9 +2989,9 @@ func NewTemporalWorkerDeploymentUpdateMetadataVersionCommand(cctx *CommandContex s.Command.Use = "update-metadata-version [flags]" s.Command.Short = "Change user-provided metadata for a Version" if hasHighlighting { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\nUpdate metadata associated with a Worker Deployment Version.\n\nFor example:\n\n\x1b[1m temporal worker deployment update-metadata-version \\\n --version YourDeploymentName.YourBuildID \\\n --metadata bar=1 \\\n --metadata foo=true\x1b[0m\n\nThe current metadata is also returned with \x1b[1mdescribe-version\x1b[0m:\n\n\x1b[1m temporal worker deployment describe-version \\\n --version YourDeploymentName.YourBuildID \\\x1b[0m" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\nUpdate metadata associated with a Worker Deployment Version.\n\nFor example:\n\n\x1b[1m temporal worker deployment update-metadata-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --metadata bar=1 \\\n --metadata foo=true\x1b[0m\n\nThe current metadata is also returned with \x1b[1mdescribe-version\x1b[0m:\n\x1b[1m temporal worker deployment describe-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\x1b[0m" } else { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\nUpdate metadata associated with a Worker Deployment Version.\n\nFor example:\n\n```\n temporal worker deployment update-metadata-version \\\n --version YourDeploymentName.YourBuildID \\\n --metadata bar=1 \\\n --metadata foo=true\n```\n\nThe current metadata is also returned with `describe-version`:\n\n```\n temporal worker deployment describe-version \\\n --version YourDeploymentName.YourBuildID \\\n```" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worker Deployment is experimental. Deployment commands are |\n| subject to change. |\n+---------------------------------------------------------------------+\nUpdate metadata associated with a Worker Deployment Version.\n\nFor example:\n\n```\n temporal worker deployment update-metadata-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n --metadata bar=1 \\\n --metadata foo=true\n```\n\nThe current metadata is also returned with `describe-version`:\n```\n temporal worker deployment describe-version \\\n --deployment-name YourDeploymentName --build-id YourBuildID \\\n```" } s.Command.Args = cobra.NoArgs s.Command.Flags().StringArrayVar(&s.Metadata, "metadata", nil, "Set deployment metadata using `KEY=\"VALUE\"` pairs. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={\"your\": \"value\"}'. Can be passed multiple times.") @@ -3528,9 +3540,9 @@ func NewTemporalWorkflowSignalWithStartCommand(cctx *CommandContext, parent *Tem s.Command.Use = "signal-with-start [flags]" s.Command.Short = "Send a message to a Workflow Execution, start the execution if it isn't running" if hasHighlighting { - s.Command.Long = "Send an asynchronous notification (Signal) to a Workflow Execution.\nIf the Workflow Execution is not running or is not found, it starts the \nworkflow then sends the signal.\n\n\x1b[1mtemporal workflow signal-with-start \\\n --signal-name YourSignal \\\n --signal-input '{\"some-key\": \"some-value\"}' \\\n --workflow-id YourWorkflowId \\\n --type YourWorkflowType \\\n --task-queue YourTaskQueue \\\n --input '{\"some-key\": \"some-value\"}'\x1b[0m" + s.Command.Long = "Send an asynchronous notification (Signal) to a Workflow Execution.\nIf the Workflow Execution is not running or is not found, it starts the\nworkflow then sends the signal.\n\n\x1b[1mtemporal workflow signal-with-start \\\n --signal-name YourSignal \\\n --signal-input '{\"some-key\": \"some-value\"}' \\\n --workflow-id YourWorkflowId \\\n --type YourWorkflowType \\\n --task-queue YourTaskQueue \\\n --input '{\"some-key\": \"some-value\"}'\x1b[0m" } else { - s.Command.Long = "Send an asynchronous notification (Signal) to a Workflow Execution.\nIf the Workflow Execution is not running or is not found, it starts the \nworkflow then sends the signal.\n\n```\ntemporal workflow signal-with-start \\\n --signal-name YourSignal \\\n --signal-input '{\"some-key\": \"some-value\"}' \\\n --workflow-id YourWorkflowId \\\n --type YourWorkflowType \\\n --task-queue YourTaskQueue \\\n --input '{\"some-key\": \"some-value\"}'\n```" + s.Command.Long = "Send an asynchronous notification (Signal) to a Workflow Execution.\nIf the Workflow Execution is not running or is not found, it starts the\nworkflow then sends the signal.\n\n```\ntemporal workflow signal-with-start \\\n --signal-name YourSignal \\\n --signal-input '{\"some-key\": \"some-value\"}' \\\n --workflow-id YourWorkflowId \\\n --type YourWorkflowType \\\n --task-queue YourTaskQueue \\\n --input '{\"some-key\": \"some-value\"}'\n```" } s.Command.Args = cobra.NoArgs s.Command.Flags().StringVar(&s.SignalName, "signal-name", "", "Signal name. Required. Aliased as \"--signal-type\".") @@ -3891,8 +3903,9 @@ type TemporalWorkflowUpdateOptionsCommand struct { Parent *TemporalWorkflowCommand Command cobra.Command SingleWorkflowOrBatchOptions - VersioningOverrideBehavior StringEnum - VersioningOverridePinnedVersion string + VersioningOverrideBehavior StringEnum + VersioningOverrideDeploymentName string + VersioningOverrideBuildId string } func NewTemporalWorkflowUpdateOptionsCommand(cctx *CommandContext, parent *TemporalWorkflowCommand) *TemporalWorkflowUpdateOptionsCommand { @@ -3902,15 +3915,16 @@ func NewTemporalWorkflowUpdateOptionsCommand(cctx *CommandContext, parent *Tempo s.Command.Use = "update-options [flags]" s.Command.Short = "Change Workflow Execution Options" if hasHighlighting { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worflow update-options is experimental. Workflow Execution |\n| properties are subject to change. |\n+---------------------------------------------------------------------+\n\nModify properties of Workflow Executions:\n\n\x1b[1mtemporal workflow update-options [options]\x1b[0m\n\nIt can override the Worker Deployment configuration of a\nWorkflow Execution, which controls Worker Versioning.\n\nFor example, to force Workers in the current Deployment execute the\nnext Workflow Task change behavior to \x1b[1mauto_upgrade\x1b[0m:\n\n\x1b[1mtemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior auto_upgrade\x1b[0m\n\nor to pin the workflow execution to a Worker Deployment, set behavior\nto \x1b[1mpinned\x1b[0m:\n\n\x1b[1mtemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior pinned \\\n --versioning-override-pinned-version \\\n YourDeploymentSeriesName.YourDeploymentBuildId\x1b[0m\n\nTo remove any previous overrides, set the behavior to\n\x1b[1munspecified\x1b[0m:\n\n\x1b[1mtemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior unspecified\x1b[0m\n\nTo see the current override use \x1b[1mtemporal workflow describe\x1b[0m" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worflow update-options is experimental. Workflow Execution |\n| properties are subject to change. |\n+---------------------------------------------------------------------+\n\nModify properties of Workflow Executions:\n\n\x1b[1mtemporal workflow update-options [options]\x1b[0m\n\nIt can override the Worker Deployment configuration of a\nWorkflow Execution, which controls Worker Versioning.\n\nFor example, to force Workers in the current Deployment execute the\nnext Workflow Task change behavior to \x1b[1mauto_upgrade\x1b[0m:\n\n\x1b[1mtemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior auto_upgrade\x1b[0m\n\nor to pin the workflow execution to a Worker Deployment, set behavior\nto \x1b[1mpinned\x1b[0m:\n\n\x1b[1mtemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior pinned \\\n --versioning-override-deployment-name YourDeploymentName \\\n --versioning-override-build-id YourDeploymentBuildId\x1b[0m\n\nTo remove any previous overrides, set the behavior to\n\x1b[1munspecified\x1b[0m:\n\n\x1b[1mtemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior unspecified\x1b[0m\n\nTo see the current override use \x1b[1mtemporal workflow describe\x1b[0m" } else { - s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worflow update-options is experimental. Workflow Execution |\n| properties are subject to change. |\n+---------------------------------------------------------------------+\n\nModify properties of Workflow Executions:\n\n```\ntemporal workflow update-options [options]\n```\n\nIt can override the Worker Deployment configuration of a\nWorkflow Execution, which controls Worker Versioning.\n\nFor example, to force Workers in the current Deployment execute the\nnext Workflow Task change behavior to `auto_upgrade`:\n\n```\ntemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior auto_upgrade\n```\n\nor to pin the workflow execution to a Worker Deployment, set behavior\nto `pinned`:\n\n```\ntemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior pinned \\\n --versioning-override-pinned-version \\\n YourDeploymentSeriesName.YourDeploymentBuildId\n```\n\nTo remove any previous overrides, set the behavior to\n`unspecified`:\n\n```\ntemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior unspecified\n```\n\nTo see the current override use `temporal workflow describe`" + s.Command.Long = "+---------------------------------------------------------------------+\n| CAUTION: Worflow update-options is experimental. Workflow Execution |\n| properties are subject to change. |\n+---------------------------------------------------------------------+\n\nModify properties of Workflow Executions:\n\n```\ntemporal workflow update-options [options]\n```\n\nIt can override the Worker Deployment configuration of a\nWorkflow Execution, which controls Worker Versioning.\n\nFor example, to force Workers in the current Deployment execute the\nnext Workflow Task change behavior to `auto_upgrade`:\n\n```\ntemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior auto_upgrade\n```\n\nor to pin the workflow execution to a Worker Deployment, set behavior\nto `pinned`:\n\n```\ntemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior pinned \\\n --versioning-override-deployment-name YourDeploymentName \\\n --versioning-override-build-id YourDeploymentBuildId\n```\n\nTo remove any previous overrides, set the behavior to\n`unspecified`:\n\n```\ntemporal workflow update-options \\\n --workflow-id YourWorkflowId \\\n --versioning-override-behavior unspecified\n```\n\nTo see the current override use `temporal workflow describe`" } s.Command.Args = cobra.NoArgs s.VersioningOverrideBehavior = NewStringEnum([]string{"unspecified", "pinned", "auto_upgrade"}, "") s.Command.Flags().Var(&s.VersioningOverrideBehavior, "versioning-override-behavior", "Override the versioning behavior of a Workflow. Accepted values: unspecified, pinned, auto_upgrade. Required.") _ = cobra.MarkFlagRequired(s.Command.Flags(), "versioning-override-behavior") - s.Command.Flags().StringVar(&s.VersioningOverridePinnedVersion, "versioning-override-pinned-version", "", "Override Pinned Version for a Worker Deployment (Only for pinned).") + s.Command.Flags().StringVar(&s.VersioningOverrideDeploymentName, "versioning-override-deployment-name", "", "When overriding to a `pinned` behavior, specifies the Deployment Name of the version to target.") + s.Command.Flags().StringVar(&s.VersioningOverrideBuildId, "versioning-override-build-id", "", "When overriding to a `pinned` behavior, specifies the Build ID of the version to target.") s.SingleWorkflowOrBatchOptions.buildFlags(cctx, s.Command.Flags()) s.Command.Run = func(c *cobra.Command, args []string) { if err := s.run(cctx, args); err != nil { diff --git a/temporalcli/commands.worker.deployment.go b/temporalcli/commands.worker.deployment.go index 9e09ac343..4f9a11d89 100644 --- a/temporalcli/commands.worker.deployment.go +++ b/temporalcli/commands.worker.deployment.go @@ -2,24 +2,27 @@ package temporalcli import ( "fmt" - "strings" "time" "github.com/fatih/color" "github.com/temporalio/cli/temporalcli/internal/printer" "go.temporal.io/api/common/v1" "go.temporal.io/sdk/client" + "go.temporal.io/sdk/worker" ) type versionSummariesRowType struct { - Version string `json:"version"` + DeploymentName string `json:"deploymentName"` + BuildId string `json:"buildId"` DrainageStatus string `json:"drainageStatus"` CreateTime time.Time `json:"createTime"` } type formattedRoutingConfigType struct { - CurrentVersion string `json:"currentVersion"` - RampingVersion string `json:"rampingVersion"` + CurrentVersionDeploymentName string `json:"currentVersionDeploymentName"` + CurrentVersionBuildId string `json:"currentVersionBuildId"` + RampingVersionDeploymentName string `json:"rampingVersionDeploymentName"` + RampingVersionBuildId string `json:"rampingVersionBuildId"` RampingVersionPercentage float32 `json:"rampingVersionPercentage"` CurrentVersionChangedTime time.Time `json:"currentVersionChangedTime"` RampingVersionChangedTime time.Time `json:"rampingVersionChangedTime"` @@ -35,11 +38,13 @@ type formattedWorkerDeploymentInfoType struct { } type formattedWorkerDeploymentListEntryType struct { - Name string - CreateTime time.Time - CurrentVersion string `cli:",cardOmitEmpty"` - RampingVersion string - RampingVersionPercentage float32 `cli:",cardOmitEmpty"` + Name string + CreateTime time.Time + CurrentVersionDeploymentName string `cli:",cardOmitEmpty"` + CurrentVersionBuildId string `cli:",cardOmitEmpty"` + RampingVersionDeploymentName string `cli:",cardOmitEmpty"` + RampingVersionBuildId string `cli:",cardOmitEmpty"` + RampingVersionPercentage float32 `cli:",cardOmitEmpty"` } type formattedDrainageInfo struct { @@ -54,7 +59,8 @@ type formattedTaskQueueInfoRowType struct { } type formattedWorkerDeploymentVersionInfoType struct { - Version string `json:"version"` + DeploymentName string `json:"deploymentName"` + BuildId string `json:"buildId"` CreateTime time.Time `json:"createTime"` RoutingChangedTime time.Time `json:"routingChangedTime"` CurrentSinceTime time.Time `json:"currentSinceTime"` @@ -86,7 +92,8 @@ func formatVersionSummaries(vss []client.WorkerDeploymentVersionSummary) ([]vers return vsRows, err } vsRows = append(vsRows, versionSummariesRowType{ - Version: vs.Version, + DeploymentName: vs.Version.DeploymentName, + BuildId: vs.Version.BuildId, CreateTime: vs.CreateTime, DrainageStatus: drainageStr, }) @@ -95,9 +102,23 @@ func formatVersionSummaries(vss []client.WorkerDeploymentVersionSummary) ([]vers } func formatRoutingConfig(rc client.WorkerDeploymentRoutingConfig) (formattedRoutingConfigType, error) { + cvdn := "" + cvbid := "" + rvdn := "" + rvbid := "" + if rc.CurrentVersion != nil { + cvdn = rc.CurrentVersion.DeploymentName + cvbid = rc.CurrentVersion.BuildId + } + if rc.RampingVersion != nil { + rvdn = rc.RampingVersion.DeploymentName + rvbid = rc.RampingVersion.BuildId + } return formattedRoutingConfigType{ - CurrentVersion: rc.CurrentVersion, - RampingVersion: rc.RampingVersion, + CurrentVersionDeploymentName: cvdn, + CurrentVersionBuildId: cvbid, + RampingVersionDeploymentName: rvdn, + RampingVersionBuildId: rvbid, RampingVersionPercentage: rc.RampingVersionPercentage, CurrentVersionChangedTime: rc.CurrentVersionChangedTime, RampingVersionChangedTime: rc.RampingVersionChangedTime, @@ -134,12 +155,26 @@ func printWorkerDeploymentInfo(cctx *CommandContext, deploymentInfo client.Worke if !cctx.JSONOutput { cctx.Printer.Println(color.MagentaString(msg)) + curVerDepName := "" + curVerBuildId := "" + rampVerDepName := "" + rampVerBuildId := "" + if deploymentInfo.RoutingConfig.CurrentVersion != nil { + curVerDepName = deploymentInfo.RoutingConfig.CurrentVersion.DeploymentName + curVerBuildId = deploymentInfo.RoutingConfig.CurrentVersion.BuildId + } + if deploymentInfo.RoutingConfig.RampingVersion != nil { + rampVerDepName = deploymentInfo.RoutingConfig.RampingVersion.DeploymentName + rampVerBuildId = deploymentInfo.RoutingConfig.RampingVersion.BuildId + } printMe := struct { Name string CreateTime time.Time LastModifierIdentity string `cli:",cardOmitEmpty"` - CurrentVersion string `cli:",cardOmitEmpty"` - RampingVersion string `cli:",cardOmitEmpty"` + CurrentVersionDeploymentName string `cli:",cardOmitEmpty"` + CurrentVersionBuildID string `cli:",cardOmitEmpty"` + RampingVersionDeploymentName string `cli:",cardOmitEmpty"` + RampingVersionBuildID string `cli:",cardOmitEmpty"` RampingVersionPercentage float32 `cli:",cardOmitEmpty"` CurrentVersionChangedTime time.Time `cli:",cardOmitEmpty"` RampingVersionChangedTime time.Time `cli:",cardOmitEmpty"` @@ -148,8 +183,10 @@ func printWorkerDeploymentInfo(cctx *CommandContext, deploymentInfo client.Worke Name: deploymentInfo.Name, CreateTime: deploymentInfo.CreateTime, LastModifierIdentity: deploymentInfo.LastModifierIdentity, - CurrentVersion: deploymentInfo.RoutingConfig.CurrentVersion, - RampingVersion: deploymentInfo.RoutingConfig.RampingVersion, + CurrentVersionDeploymentName: curVerDepName, + CurrentVersionBuildID: curVerBuildId, + RampingVersionDeploymentName: rampVerDepName, + RampingVersionBuildID: rampVerBuildId, RampingVersionPercentage: deploymentInfo.RoutingConfig.RampingVersionPercentage, CurrentVersionChangedTime: deploymentInfo.RoutingConfig.CurrentVersionChangedTime, RampingVersionChangedTime: deploymentInfo.RoutingConfig.RampingVersionChangedTime, @@ -179,30 +216,6 @@ func printWorkerDeploymentInfo(cctx *CommandContext, deploymentInfo client.Worke return cctx.Printer.PrintStructured(fDeploymentInfo, printer.StructuredOptions{}) } -func extractDeploymentName(version string, deploymentName string, failNonQualified bool) (string, error) { - if version == "" || version == "__unversioned__" { - if failNonQualified { - return "", fmt.Errorf( - "invalid deployment version type for this operation, use a fully-qualified version", - ) - } - if deploymentName == "" { - return "", fmt.Errorf( - "specify the deployment name with `--deployment-name` with a non-fully-qualified version", - ) - } - return deploymentName, nil - } - splitVersion := strings.SplitN(version, ".", 2) - if len(splitVersion) != 2 { - return "", fmt.Errorf( - "invalid format for worker deployment version %v, not YourDeploymentName.YourBuildID", - version, - ) - } - return splitVersion[0], nil -} - func formatDrainageInfo(drainageInfo *client.WorkerDeploymentVersionDrainageInfo) (formattedDrainageInfo, error) { if drainageInfo == nil { return formattedDrainageInfo{}, nil @@ -247,7 +260,8 @@ func workerDeploymentVersionInfoToRows(deploymentInfo client.WorkerDeploymentVer } return formattedWorkerDeploymentVersionInfoType{ - Version: deploymentInfo.Version, + DeploymentName: deploymentInfo.Version.DeploymentName, + BuildId: deploymentInfo.Version.BuildId, CreateTime: deploymentInfo.CreateTime, RoutingChangedTime: deploymentInfo.RoutingChangedTime, CurrentSinceTime: deploymentInfo.CurrentSinceTime, @@ -280,7 +294,8 @@ func printWorkerDeploymentVersionInfo(cctx *CommandContext, deploymentInfo clien } printMe := struct { - Version string + DeploymentName string + BuildId string CreateTime time.Time RoutingChangedTime time.Time `cli:",cardOmitEmpty"` CurrentSinceTime time.Time `cli:",cardOmitEmpty"` @@ -291,7 +306,8 @@ func printWorkerDeploymentVersionInfo(cctx *CommandContext, deploymentInfo clien DrainageLastCheckedTime time.Time `cli:",cardOmitEmpty"` Metadata map[string]*common.Payload `cli:",cardOmitEmpty"` }{ - Version: deploymentInfo.Version, + DeploymentName: deploymentInfo.Version.DeploymentName, + BuildId: deploymentInfo.Version.BuildId, CreateTime: deploymentInfo.CreateTime, RoutingChangedTime: deploymentInfo.RoutingChangedTime, CurrentSinceTime: deploymentInfo.CurrentSinceTime, @@ -450,17 +466,15 @@ func (c *TemporalWorkerDeploymentListCommand) run(cctx *CommandContext, args []s // For JSON dump one line of JSON per deployment _ = cctx.Printer.PrintStructured(listEntry, printer.StructuredOptions{}) } else { - rampingVersion := "" - if listEntry.RoutingConfig.RampingVersion != "" { - rampingVersion = listEntry.RoutingConfig.RampingVersion - } // For non-JSON, we are doing a table for each page page = append(page, &formattedWorkerDeploymentListEntryType{ - Name: listEntry.Name, - CreateTime: listEntry.CreateTime, - CurrentVersion: listEntry.RoutingConfig.CurrentVersion, - RampingVersion: rampingVersion, - RampingVersionPercentage: listEntry.RoutingConfig.RampingVersionPercentage, + Name: listEntry.Name, + CreateTime: listEntry.CreateTime, + CurrentVersionDeploymentName: listEntry.RoutingConfig.CurrentVersionDeploymentName, + CurrentVersionBuildId: listEntry.RoutingConfig.CurrentVersionBuildId, + RampingVersionDeploymentName: listEntry.RoutingConfig.RampingVersionDeploymentName, + RampingVersionBuildId: listEntry.RoutingConfig.RampingVersionBuildId, + RampingVersionPercentage: listEntry.RoutingConfig.RampingVersionPercentage, }) if len(page) == cap(page) { _ = cctx.Printer.PrintStructured(page, printTableOpts) @@ -485,14 +499,9 @@ func (c *TemporalWorkerDeploymentDeleteVersionCommand) run(cctx *CommandContext, } defer cl.Close() - name, err := extractDeploymentName(c.Version, "", true) - if err != nil { - return err - } - - dHandle := cl.WorkerDeploymentClient().GetHandle(name) + dHandle := cl.WorkerDeploymentClient().GetHandle(c.DeploymentName) _, err = dHandle.DeleteVersion(cctx, client.WorkerDeploymentDeleteVersionOptions{ - Version: c.Version, + BuildID: c.BuildId, SkipDrainage: c.SkipDrainage, Identity: c.Identity, }) @@ -511,15 +520,10 @@ func (c *TemporalWorkerDeploymentDescribeVersionCommand) run(cctx *CommandContex } defer cl.Close() - name, err := extractDeploymentName(c.Version, "", true) - if err != nil { - return err - } - - dHandle := cl.WorkerDeploymentClient().GetHandle(name) + dHandle := cl.WorkerDeploymentClient().GetHandle(c.DeploymentName) resp, err := dHandle.DescribeVersion(cctx, client.WorkerDeploymentDescribeVersionOptions{ - Version: c.Version, + BuildID: c.BuildId, }) if err != nil { return fmt.Errorf("error describing worker deployment version: %w", err) @@ -540,23 +544,18 @@ func (c *TemporalWorkerDeploymentSetCurrentVersionCommand) run(cctx *CommandCont } defer cl.Close() - name, err := extractDeploymentName(c.Version, c.DeploymentName, false) - if err != nil { - return err - } - token, err := c.Parent.getConflictToken(cctx, &getDeploymentConflictTokenOptions{ safeMode: !c.Yes, safeModeMessage: "Current", - deploymentName: name, + deploymentName: c.DeploymentName, }) if err != nil { return err } - dHandle := cl.WorkerDeploymentClient().GetHandle(name) + dHandle := cl.WorkerDeploymentClient().GetHandle(c.DeploymentName) _, err = dHandle.SetCurrentVersion(cctx, client.WorkerDeploymentSetCurrentVersionOptions{ - Version: c.Version, + BuildID: c.BuildId, Identity: c.Identity, IgnoreMissingTaskQueues: c.IgnoreMissingTaskQueues, ConflictToken: token, @@ -565,7 +564,7 @@ func (c *TemporalWorkerDeploymentSetCurrentVersionCommand) run(cctx *CommandCont return fmt.Errorf("error setting the current worker deployment version: %w", err) } - cctx.Printer.Println("Successfully setting the current worker deployment version") + cctx.Printer.Println("Successfully set the current worker deployment version") return nil } @@ -576,30 +575,23 @@ func (c *TemporalWorkerDeploymentSetRampingVersionCommand) run(cctx *CommandCont } defer cl.Close() - name, err := extractDeploymentName(c.Version, c.DeploymentName, false) - if err != nil { - return err - } - token, err := c.Parent.getConflictToken(cctx, &getDeploymentConflictTokenOptions{ safeMode: !c.Yes, safeModeMessage: "Ramping", - deploymentName: name, + deploymentName: c.DeploymentName, }) if err != nil { return err } - version := c.Version percentage := c.Percentage if c.Delete { - version = "" percentage = 0.0 } - dHandle := cl.WorkerDeploymentClient().GetHandle(name) + dHandle := cl.WorkerDeploymentClient().GetHandle(c.DeploymentName) _, err = dHandle.SetRampingVersion(cctx, client.WorkerDeploymentSetRampingVersionOptions{ - Version: version, + BuildID: c.BuildId, Percentage: percentage, ConflictToken: token, Identity: c.Identity, @@ -609,7 +601,7 @@ func (c *TemporalWorkerDeploymentSetRampingVersionCommand) run(cctx *CommandCont return fmt.Errorf("error setting the ramping worker deployment version: %w", err) } - cctx.Printer.Println("Successfully setting the ramping worker deployment version") + cctx.Printer.Println("Successfully set the ramping worker deployment version") return nil } @@ -620,19 +612,17 @@ func (c *TemporalWorkerDeploymentUpdateMetadataVersionCommand) run(cctx *Command } defer cl.Close() - name, err := extractDeploymentName(c.Version, "", true) - if err != nil { - return err - } - metadata, err := stringKeysJSONValues(c.Metadata, false) if err != nil { return fmt.Errorf("invalid metadata values: %w", err) } - dHandle := cl.WorkerDeploymentClient().GetHandle(name) + dHandle := cl.WorkerDeploymentClient().GetHandle(c.DeploymentName) response, err := dHandle.UpdateVersionMetadata(cctx, client.WorkerDeploymentUpdateVersionMetadataOptions{ - Version: c.Version, + Version: worker.WorkerDeploymentVersion{ + BuildId: c.BuildId, + DeploymentName: c.DeploymentName, + }, MetadataUpdate: client.WorkerDeploymentMetadataUpdate{ UpsertEntries: metadata, RemoveEntries: c.RemoveEntries, diff --git a/temporalcli/commands.worker.deployment_test.go b/temporalcli/commands.worker.deployment_test.go index 439f326d2..f72b8b40a 100644 --- a/temporalcli/commands.worker.deployment_test.go +++ b/temporalcli/commands.worker.deployment_test.go @@ -16,14 +16,17 @@ import ( ) type jsonVersionSummariesRowType struct { - Version string `json:"version"` + DeploymentName string `json:"deploymentName"` + BuildID string `json:"buildId"` DrainageStatus string `json:"drainageStatus"` CreateTime time.Time `json:"createTime"` } type jsonRoutingConfigType struct { - CurrentVersion string `json:"currentVersion"` - RampingVersion string `json:"rampingVersion"` + CurrentVersionDeploymentName string `json:"currentVersionDeploymentName"` + CurrentVersionBuildID string `json:"currentVersionBuildId"` + RampingVersionDeploymentName string `json:"rampingVersionDeploymentName"` + RampingVersionBuildID string `json:"rampingVersionBuildId"` RampingVersionPercentage float32 `json:"rampingVersionPercentage"` CurrentVersionChangedTime time.Time `json:"currentVersionChangedTime"` RampingVersionChangedTime time.Time `json:"rampingVersionChangedTime"` @@ -64,7 +67,10 @@ type jsonDeploymentVersionInfoType struct { func (s *SharedServerSuite) TestDeployment_Set_Current_Version() { deploymentName := uuid.NewString() buildId := uuid.NewString() - version := deploymentName + "." + buildId + version := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId, + } w := s.DevServer.StartDevWorker(s.Suite.T(), DevWorkerOptions{ Worker: worker.Options{ DeploymentOptions: worker.DeploymentOptions{ @@ -89,7 +95,7 @@ func (s *SharedServerSuite) TestDeployment_Set_Current_Version() { res := s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version, + "--deployment-name", version.DeploymentName, "--build-id", version.BuildId, ) assert.NoError(t, res.Err) }, 30*time.Second, 100*time.Millisecond) @@ -97,7 +103,7 @@ func (s *SharedServerSuite) TestDeployment_Set_Current_Version() { res := s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version, + "--deployment-name", version.DeploymentName, "--build-id", version.BuildId, "--yes", ) s.NoError(res.Err) @@ -110,7 +116,8 @@ func (s *SharedServerSuite) TestDeployment_Set_Current_Version() { s.NoError(res.Err) s.ContainsOnSameLine(res.Stdout.String(), "Name", deploymentName) - s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersion", version) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionDeploymentName", version.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionBuildID", version.BuildId) // json res = s.Execute( @@ -124,13 +131,14 @@ func (s *SharedServerSuite) TestDeployment_Set_Current_Version() { var jsonOut jsonDeploymentInfoType s.NoError(json.Unmarshal(res.Stdout.Bytes(), &jsonOut)) s.Equal(deploymentName, jsonOut.Name) - s.Equal(version, jsonOut.RoutingConfig.CurrentVersion) + s.Equal(version.DeploymentName, jsonOut.RoutingConfig.CurrentVersionDeploymentName) + s.Equal(version.BuildId, jsonOut.RoutingConfig.CurrentVersionBuildID) // set metadata res = s.Execute( "worker", "deployment", "update-metadata-version", "--address", s.Address(), - "--version", version, + "--deployment-name", version.DeploymentName, "--build-id", version.BuildId, "--metadata", "bar=1", "--output", "json", ) @@ -147,7 +155,7 @@ func (s *SharedServerSuite) TestDeployment_Set_Current_Version() { res = s.Execute( "worker", "deployment", "update-metadata-version", "--address", s.Address(), - "--version", version, + "--deployment-name", version.DeploymentName, "--build-id", version.BuildId, "--remove-entries", "bar", "--output", "json", ) @@ -156,7 +164,7 @@ func (s *SharedServerSuite) TestDeployment_Set_Current_Version() { res = s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version, + "--deployment-name", version.DeploymentName, "--build-id", version.BuildId, "--output", "json", ) s.NoError(res.Err) @@ -175,13 +183,19 @@ func filterByNamePrefix(jsonOut []jsonDeploymentInfoType, prefix string) []jsonD } func (s *SharedServerSuite) TestDeployment_List() { - prefix := uuid.NewString() - deploymentName1 := prefix + "a" + uuid.NewString() - deploymentName2 := prefix + "b" + uuid.NewString() + prefix := "deployment_list_" + deploymentName1 := prefix + "a_" + uuid.NewString() + deploymentName2 := prefix + "b_" + uuid.NewString() buildId1 := uuid.NewString() buildId2 := uuid.NewString() - version1 := deploymentName1 + "." + buildId1 - version2 := deploymentName2 + "." + buildId2 + version1 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName1, + BuildId: buildId1, + } + version2 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName2, + BuildId: buildId2, + } w1 := s.DevServer.StartDevWorker(s.Suite.T(), DevWorkerOptions{ Worker: worker.Options{ @@ -219,13 +233,13 @@ func (s *SharedServerSuite) TestDeployment_List() { res := s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, ) assert.NoError(t, res.Err) res = s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version2, + "--deployment-name", version2.DeploymentName, "--build-id", version2.BuildId, ) assert.NoError(t, res.Err) }, 30*time.Second, 100*time.Millisecond) @@ -233,7 +247,7 @@ func (s *SharedServerSuite) TestDeployment_List() { res := s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, "--yes", ) s.NoError(res.Err) @@ -241,19 +255,21 @@ func (s *SharedServerSuite) TestDeployment_List() { res = s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version2, + "--deployment-name", version2.DeploymentName, "--build-id", version2.BuildId, "--yes", ) s.NoError(res.Err) - res = s.Execute( - "worker", "deployment", "list", - "--address", s.Address(), - ) - s.NoError(res.Err) + s.EventuallyWithT(func(t *assert.CollectT) { + res = s.Execute( + "worker", "deployment", "list", + "--address", s.Address(), + ) + s.NoError(res.Err) + }, 10*time.Second, 100*time.Millisecond) - s.ContainsOnSameLine(res.Stdout.String(), deploymentName1, version1) - s.ContainsOnSameLine(res.Stdout.String(), deploymentName2, version2) + s.ContainsOnSameLine(res.Stdout.String(), deploymentName1, version1.BuildId) + s.ContainsOnSameLine(res.Stdout.String(), deploymentName2, version2.BuildId) // json res = s.Execute( @@ -271,17 +287,25 @@ func (s *SharedServerSuite) TestDeployment_List() { }) s.Equal(2, len(jsonOut)) s.Equal(deploymentName1, jsonOut[0].Name) - s.Equal(version1, jsonOut[0].RoutingConfig.CurrentVersion) + s.Equal(version1.DeploymentName, jsonOut[0].RoutingConfig.CurrentVersionDeploymentName) + s.Equal(version1.BuildId, jsonOut[0].RoutingConfig.CurrentVersionBuildID) s.Equal(deploymentName2, jsonOut[1].Name) - s.Equal(version2, jsonOut[1].RoutingConfig.CurrentVersion) + s.Equal(version2.DeploymentName, jsonOut[1].RoutingConfig.CurrentVersionDeploymentName) + s.Equal(version2.BuildId, jsonOut[1].RoutingConfig.CurrentVersionBuildID) } func (s *SharedServerSuite) TestDeployment_Describe_Drainage() { deploymentName := uuid.NewString() buildId1 := "a" + uuid.NewString() buildId2 := "b" + uuid.NewString() - version1 := deploymentName + "." + buildId1 - version2 := deploymentName + "." + buildId2 + version1 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId1, + } + version2 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId2, + } w1 := s.DevServer.StartDevWorker(s.Suite.T(), DevWorkerOptions{ Worker: worker.Options{ @@ -318,13 +342,13 @@ func (s *SharedServerSuite) TestDeployment_Describe_Drainage() { res := s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, ) assert.NoError(t, res.Err) res = s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version2, + "--deployment-name", version2.DeploymentName, "--build-id", version2.BuildId, ) assert.NoError(t, res.Err) }, 30*time.Second, 100*time.Millisecond) @@ -332,7 +356,7 @@ func (s *SharedServerSuite) TestDeployment_Describe_Drainage() { res := s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, "--yes", ) s.NoError(res.Err) @@ -343,13 +367,14 @@ func (s *SharedServerSuite) TestDeployment_Describe_Drainage() { "--name", deploymentName, ) s.NoError(res.Err) - s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersion", version1) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionDeploymentName", version1.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionBuildID", version1.BuildId) fmt.Print("hello") res = s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version2, + "--deployment-name", version2.DeploymentName, "--build-id", version2.BuildId, "--yes", ) s.NoError(res.Err) @@ -361,9 +386,10 @@ func (s *SharedServerSuite) TestDeployment_Describe_Drainage() { ) s.NoError(res.Err) - s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersion", version2) - s.ContainsOnSameLine(res.Stdout.String(), version1, "draining") - s.ContainsOnSameLine(res.Stdout.String(), version2, "unspecified") + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionDeploymentName", version2.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionBuildID", version2.BuildId) + s.ContainsOnSameLine(res.Stdout.String(), version1.DeploymentName, "draining") + s.ContainsOnSameLine(res.Stdout.String(), version2.DeploymentName, "unspecified") // json res = s.Execute( @@ -378,22 +404,28 @@ func (s *SharedServerSuite) TestDeployment_Describe_Drainage() { s.NoError(json.Unmarshal(res.Stdout.Bytes(), &jsonOut)) s.Equal(deploymentName, jsonOut.Name) sort.Slice(jsonOut.VersionSummaries, func(i, j int) bool { - return jsonOut.VersionSummaries[i].Version < jsonOut.VersionSummaries[j].Version + return jsonOut.VersionSummaries[i].BuildID < jsonOut.VersionSummaries[j].BuildID }) s.Equal(2, len(jsonOut.VersionSummaries)) s.Equal("draining", jsonOut.VersionSummaries[0].DrainageStatus) - s.Equal(version1, jsonOut.VersionSummaries[0].Version) + s.Equal(version1.BuildId, jsonOut.VersionSummaries[0].BuildID) s.Equal("unspecified", jsonOut.VersionSummaries[1].DrainageStatus) - s.Equal(version2, jsonOut.VersionSummaries[1].Version) + s.Equal(version2.BuildId, jsonOut.VersionSummaries[1].BuildID) } func (s *SharedServerSuite) TestDeployment_Ramping() { deploymentName := uuid.NewString() buildId1 := "a" + uuid.NewString() buildId2 := "b" + uuid.NewString() - version1 := deploymentName + "." + buildId1 - version2 := deploymentName + "." + buildId2 + version1 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId1, + } + version2 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId2, + } w1 := s.DevServer.StartDevWorker(s.Suite.T(), DevWorkerOptions{ Worker: worker.Options{ @@ -430,13 +462,13 @@ func (s *SharedServerSuite) TestDeployment_Ramping() { res := s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, ) assert.NoError(t, res.Err) res = s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version2, + "--deployment-name", version2.DeploymentName, "--build-id", version2.BuildId, ) assert.NoError(t, res.Err) }, 30*time.Second, 100*time.Millisecond) @@ -444,7 +476,7 @@ func (s *SharedServerSuite) TestDeployment_Ramping() { res := s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, "--yes", ) s.NoError(res.Err) @@ -452,7 +484,7 @@ func (s *SharedServerSuite) TestDeployment_Ramping() { res = s.Execute( "worker", "deployment", "set-ramping-version", "--address", s.Address(), - "--version", version2, + "--deployment-name", version2.DeploymentName, "--build-id", version2.BuildId, "--percentage", "12.5", "--yes", ) @@ -464,16 +496,17 @@ func (s *SharedServerSuite) TestDeployment_Ramping() { "--name", deploymentName, ) s.NoError(res.Err) - - s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersion", version1) - s.ContainsOnSameLine(res.Stdout.String(), "RampingVersion", version2) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionDeploymentName", version1.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionBuildID", version1.BuildId) + s.ContainsOnSameLine(res.Stdout.String(), "RampingVersionDeploymentName", version2.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "RampingVersionBuildID", version2.BuildId) s.ContainsOnSameLine(res.Stdout.String(), "RampingVersionPercentage", "12.5") // setting version2 as current also removes the ramp res = s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version2, + "--deployment-name", version2.DeploymentName, "--build-id", version2.BuildId, "--yes", ) s.NoError(res.Err) @@ -489,14 +522,14 @@ func (s *SharedServerSuite) TestDeployment_Ramping() { var jsonOut jsonDeploymentInfoType s.NoError(json.Unmarshal(res.Stdout.Bytes(), &jsonOut)) s.Equal(deploymentName, jsonOut.Name) - s.Empty(jsonOut.RoutingConfig.RampingVersion) - s.Equal(version2, jsonOut.RoutingConfig.CurrentVersion) + s.Empty(jsonOut.RoutingConfig.RampingVersionBuildID) + s.Equal(version2.BuildId, jsonOut.RoutingConfig.CurrentVersionBuildID) //same with explicit delete res = s.Execute( "worker", "deployment", "set-ramping-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, "--percentage", "10.1", "--yes", ) @@ -508,15 +541,16 @@ func (s *SharedServerSuite) TestDeployment_Ramping() { "--name", deploymentName, ) s.NoError(res.Err) - - s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersion", version2) - s.ContainsOnSameLine(res.Stdout.String(), "RampingVersion", version1) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionDeploymentName", version2.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "CurrentVersionBuildID", version2.BuildId) + s.ContainsOnSameLine(res.Stdout.String(), "RampingVersionDeploymentName", version1.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "RampingVersionBuildID", version1.BuildId) s.ContainsOnSameLine(res.Stdout.String(), "RampingVersionPercentage", "10.1") res = s.Execute( "worker", "deployment", "set-ramping-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, "--build-id", version1.BuildId, "--delete", "--yes", ) @@ -532,7 +566,6 @@ func (s *SharedServerSuite) TestDeployment_Ramping() { s.NoError(json.Unmarshal(res.Stdout.Bytes(), &jsonOut)) s.Equal(deploymentName, jsonOut.Name) - s.Empty(jsonOut.RoutingConfig.RampingVersion) - s.Equal(version2, jsonOut.RoutingConfig.CurrentVersion) - + s.Equal(float32(0), jsonOut.RoutingConfig.RampingVersionPercentage) + s.Equal(version2.BuildId, jsonOut.RoutingConfig.CurrentVersionBuildID) } diff --git a/temporalcli/commands.workflow.go b/temporalcli/commands.workflow.go index ae189678d..4be89054c 100644 --- a/temporalcli/commands.workflow.go +++ b/temporalcli/commands.workflow.go @@ -8,13 +8,14 @@ import ( "os/user" "go.temporal.io/sdk/converter" - "go.temporal.io/sdk/workflow" + "go.temporal.io/sdk/worker" "github.com/fatih/color" "github.com/google/uuid" "github.com/temporalio/cli/temporalcli/internal/printer" "go.temporal.io/api/batch/v1" "go.temporal.io/api/common/v1" + deploymentpb "go.temporal.io/api/deployment/v1" "go.temporal.io/api/enums/v1" "go.temporal.io/api/query/v1" sdkpb "go.temporal.io/api/sdk/v1" @@ -101,46 +102,58 @@ func (c *TemporalWorkflowUpdateOptionsCommand) run(cctx *CommandContext, args [] } defer cl.Close() - if c.VersioningOverrideBehavior.Value == "unspecified" || c.VersioningOverrideBehavior.Value == "auto_upgrade" { - if c.VersioningOverridePinnedVersion != "" { - return fmt.Errorf("cannot set pinned version with %v behavior", c.VersioningOverrideBehavior) + if c.VersioningOverrideBehavior.Value == "unspecified" || + c.VersioningOverrideBehavior.Value == "auto_upgrade" { + if c.VersioningOverrideDeploymentName != "" || c.VersioningOverrideBuildId != "" { + return fmt.Errorf("cannot set pinned deployment name or build id with %v behavior", + c.VersioningOverrideBehavior) } } if c.VersioningOverrideBehavior.Value == "pinned" { - if c.VersioningOverridePinnedVersion == "" { - return fmt.Errorf("missing version with 'pinned' behavior") + if c.VersioningOverrideDeploymentName == "" && c.VersioningOverrideBuildId == "" { + return fmt.Errorf("missing deployment name and/or build id with 'pinned' behavior") } } exec, batchReq, err := c.workflowExecOrBatch(cctx, c.Parent.Namespace, cl, singleOrBatchOverrides{}) + var overrideChange *client.VersioningOverrideChange + switch c.VersioningOverrideBehavior.Value { + case "unspecified": + overrideChange = &client.VersioningOverrideChange{ + Value: nil, + } + case "pinned": + overrideChange = &client.VersioningOverrideChange{ + Value: &client.PinnedVersioningOverride{ + Version: worker.WorkerDeploymentVersion{ + DeploymentName: c.VersioningOverrideDeploymentName, + BuildId: c.VersioningOverrideBuildId, + }, + }, + } + case "auto_upgrade": + overrideChange = &client.VersioningOverrideChange{ + Value: &client.AutoUpgradeVersioningOverride{}, + } + default: + return fmt.Errorf( + "invalid deployment behavior: %v, valid values are: 'unspecified', 'pinned', and 'auto_upgrade'", + c.VersioningOverrideBehavior, + ) + } + // Run single or batch if err != nil { return err } else if exec != nil { - behavior := workflow.VersioningBehaviorUnspecified - switch c.VersioningOverrideBehavior.Value { - case "unspecified": - case "pinned": - behavior = workflow.VersioningBehaviorPinned - case "auto_upgrade": - behavior = workflow.VersioningBehaviorAutoUpgrade - default: - return fmt.Errorf( - "invalid deployment behavior: %v, valid values are: 'unspecified', 'pinned', and 'auto_upgrade'", - c.VersioningOverrideBehavior, - ) - } _, err := cl.UpdateWorkflowExecutionOptions(cctx, client.UpdateWorkflowExecutionOptionsRequest{ WorkflowId: exec.WorkflowId, RunId: exec.RunId, WorkflowExecutionOptionsChanges: client.WorkflowExecutionOptionsChanges{ - VersioningOverride: &client.VersioningOverride{ - Behavior: behavior, - PinnedVersion: c.VersioningOverridePinnedVersion, - }, + VersioningOverride: overrideChange, }, }) if err != nil { @@ -154,28 +167,16 @@ func (c *TemporalWorkflowUpdateOptionsCommand) run(cctx *CommandContext, args [] return fmt.Errorf("invalid field mask: %w", err) } - behavior := enums.VERSIONING_BEHAVIOR_UNSPECIFIED - switch c.VersioningOverrideBehavior.Value { - case "unspecified": - case "pinned": - behavior = enums.VERSIONING_BEHAVIOR_PINNED - case "auto_upgrade": - behavior = enums.VERSIONING_BEHAVIOR_AUTO_UPGRADE - default: - return fmt.Errorf( - "invalid deployment behavior: %v, valid values are: 'unspecified', 'pinned', and 'auto_upgrade'", - c.VersioningOverrideBehavior, - ) + var protoVerOverride *workflowpb.VersioningOverride + if overrideChange != nil { + protoVerOverride = versioningOverrideToProto(overrideChange.Value) } batchReq.Operation = &workflowservice.StartBatchOperationRequest_UpdateWorkflowOptionsOperation{ UpdateWorkflowOptionsOperation: &batch.BatchOperationUpdateWorkflowExecutionOptions{ Identity: clientIdentity(), WorkflowExecutionOptions: &workflowpb.WorkflowExecutionOptions{ - VersioningOverride: &workflowpb.VersioningOverride{ - Behavior: behavior, - PinnedVersion: c.VersioningOverridePinnedVersion, - }, + VersioningOverride: protoVerOverride, }, UpdateMask: protoMask, }, @@ -686,3 +687,38 @@ func queryHelper(cctx *CommandContext, return cctx.Printer.PrintStructured(output, printer.StructuredOptions{}) } } + +// This is (mostly) copy-pasted from the SDK since it's not exposed. Most of this will go away once +// the deprecated fields are no longer supported. +func versioningOverrideToProto(versioningOverride client.VersioningOverride) *workflowpb.VersioningOverride { + if versioningOverride == nil { + return nil + } + switch v := versioningOverride.(type) { + case *client.PinnedVersioningOverride: + return &workflowpb.VersioningOverride{ + Behavior: enums.VERSIONING_BEHAVIOR_PINNED, + PinnedVersion: fmt.Sprintf("%s.%s", v.Version.DeploymentName, v.Version.BuildId), + Deployment: &deploymentpb.Deployment{ + SeriesName: v.Version.DeploymentName, + BuildId: v.Version.BuildId, + }, + Override: &workflowpb.VersioningOverride_Pinned{ + Pinned: &workflowpb.VersioningOverride_PinnedOverride{ + Behavior: workflowpb.VersioningOverride_PINNED_OVERRIDE_BEHAVIOR_PINNED, + Version: &deploymentpb.WorkerDeploymentVersion{ + DeploymentName: v.Version.DeploymentName, + BuildId: v.Version.BuildId, + }, + }, + }, + } + case *client.AutoUpgradeVersioningOverride: + return &workflowpb.VersioningOverride{ + Behavior: enums.VERSIONING_BEHAVIOR_AUTO_UPGRADE, + Override: &workflowpb.VersioningOverride_AutoUpgrade{AutoUpgrade: true}, + } + default: + return nil + } +} diff --git a/temporalcli/commands.workflow_exec.go b/temporalcli/commands.workflow_exec.go index a88d89ba7..4c5be6d20 100644 --- a/temporalcli/commands.workflow_exec.go +++ b/temporalcli/commands.workflow_exec.go @@ -157,10 +157,6 @@ func (c *TemporalWorkflowSignalWithStartCommand) run(cctx *CommandContext, _ []s searchAttr = &common.SearchAttributes{IndexedFields: fields} } - if wfStartOpts.VersioningOverride != (client.VersioningOverride{}) { - cctx.Logger.Warn("VersioningOverride is not configured for the signal-with-start command") - } - // We have to use the raw signal service call here because the Go SDK's // signal-with-start call doesn't accept multiple signal arguments. resp, err := cl.WorkflowService().SignalWithStartWorkflowExecution( diff --git a/temporalcli/commands.workflow_test.go b/temporalcli/commands.workflow_test.go index 2c3516743..c1a5b7bfd 100644 --- a/temporalcli/commands.workflow_test.go +++ b/temporalcli/commands.workflow_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/require" "github.com/temporalio/cli/temporalcli" "go.temporal.io/api/enums/v1" + workflowpb "go.temporal.io/api/workflow/v1" "go.temporal.io/api/workflowservice/v1" "go.temporal.io/sdk/client" "go.temporal.io/sdk/worker" @@ -429,10 +430,16 @@ func (s *SharedServerSuite) TestWorkflow_Cancel_SingleWorkflowSuccess() { func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Override() { buildId1 := uuid.NewString() - buildId2 := uuid.NewString() + buildId2 := "bid2-" + uuid.NewString() deploymentName := uuid.NewString() - version1 := deploymentName + "." + buildId1 - version2 := deploymentName + "." + buildId2 + version1 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId1, + } + version2 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId2, + } // Workflow that waits to be canceled. waitingWorkflow := func(ctx workflow.Context) error { ctx.Done().Receive(ctx, nil) @@ -463,7 +470,8 @@ func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Overrid res := s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, + "--build-id", version1.BuildId, ) assert.NoError(t, res.Err) }, 30*time.Second, 100*time.Millisecond) @@ -471,7 +479,8 @@ func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Overrid res := s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, + "--build-id", version1.BuildId, "--yes", ) s.NoError(res.Err) @@ -501,7 +510,8 @@ func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Overrid "-w", run.GetID(), ) assert.NoError(t, res.Err) - assert.Contains(t, res.Stdout.String(), version1) + assert.Contains(t, res.Stdout.String(), version1.DeploymentName) + assert.Contains(t, res.Stdout.String(), version1.BuildId) assert.Contains(t, res.Stdout.String(), "Pinned") } }, 30*time.Second, 100*time.Millisecond) @@ -521,9 +531,17 @@ func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Overrid "--address", s.Address(), "--query", "CustomKeywordField = '"+searchAttr+"'", "--versioning-override-behavior", "pinned", - "--versioning-override-pinned-version", version2, + "--versioning-override-deployment-name", version2.DeploymentName, + "--versioning-override-build-id", version2.BuildId, ) s.NoError(res.Err) + time.Sleep(10 * time.Second) + res = s.Execute( + "workflow", "describe", + "--address", s.Address(), + "-w", runs[0].GetID(), + "--output", "json", + ) s.EventuallyWithT(func(t *assert.CollectT) { for _, run := range runs { @@ -542,17 +560,27 @@ func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Overrid versioningInfo := jsonResp.GetWorkflowExecutionInfo().GetVersioningInfo() require.NotNil(t, versioningInfo) require.NotNil(t, versioningInfo.VersioningOverride) - require.Equal(t, version2, versioningInfo.VersioningOverride.PinnedVersion) + asPinned := versioningInfo.VersioningOverride.Override.(*workflowpb.VersioningOverride_Pinned) + require.Equal(t, version2.DeploymentName, asPinned.Pinned.Version.DeploymentName) + require.Equal(t, version2.BuildId, asPinned.Pinned.Version.BuildId) + require.Equal(t, enums.VERSIONING_BEHAVIOR_PINNED, versioningInfo.Behavior) } - }, 30*time.Second, 100*time.Millisecond) + }, 10*time.Second, 100*time.Millisecond) } func (s *SharedServerSuite) TestWorkflow_Update_Options_Versioning_Override() { buildId1 := uuid.NewString() buildId2 := uuid.NewString() + buildId3 := "id3-" + uuid.NewString() deploymentName := uuid.NewString() - version1 := deploymentName + "." + buildId1 - version2 := deploymentName + "." + buildId2 + version1 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId1, + } + version2 := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId2, + } // Workflow that waits to be canceled. waitingWorkflow := func(ctx workflow.Context) error { @@ -584,7 +612,8 @@ func (s *SharedServerSuite) TestWorkflow_Update_Options_Versioning_Override() { res := s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, + "--build-id", version1.BuildId, ) assert.NoError(t, res.Err) }, 30*time.Second, 100*time.Millisecond) @@ -592,7 +621,8 @@ func (s *SharedServerSuite) TestWorkflow_Update_Options_Versioning_Override() { res := s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version1, + "--deployment-name", version1.DeploymentName, + "--build-id", version1.BuildId, "--yes", ) s.NoError(res.Err) @@ -612,7 +642,8 @@ func (s *SharedServerSuite) TestWorkflow_Update_Options_Versioning_Override() { "-w", run.GetID(), ) assert.NoError(t, res.Err) - assert.Contains(t, res.Stdout.String(), version1) + assert.Contains(t, res.Stdout.String(), version1.DeploymentName) + assert.Contains(t, res.Stdout.String(), version1.BuildId) assert.Contains(t, res.Stdout.String(), "Pinned") }, 30*time.Second, 100*time.Millisecond) @@ -621,7 +652,29 @@ func (s *SharedServerSuite) TestWorkflow_Update_Options_Versioning_Override() { "--address", s.Address(), "-w", run.GetID(), "--versioning-override-behavior", "pinned", - "--versioning-override-pinned-version", version2, + "--versioning-override-deployment-name", version2.DeploymentName, + "--versioning-override-build-id", version2.BuildId, + ) + s.NoError(res.Err) + + res = s.Execute( + "workflow", "describe", + "--address", s.Address(), + "-w", run.GetID(), + ) + s.NoError(res.Err) + + s.ContainsOnSameLine(res.Stdout.String(), "OverrideBehavior", "Pinned") + s.ContainsOnSameLine(res.Stdout.String(), "OverridePinnedVersionDeploymentName", version2.DeploymentName) + s.ContainsOnSameLine(res.Stdout.String(), "OverridePinnedVersionBuildId", version2.BuildId) + + // Using only build-id + res = s.Execute( + "workflow", "update-options", + "--address", s.Address(), + "-w", run.GetID(), + "--versioning-override-behavior", "pinned", + "--versioning-override-build-id", buildId3, ) s.NoError(res.Err) @@ -633,7 +686,7 @@ func (s *SharedServerSuite) TestWorkflow_Update_Options_Versioning_Override() { s.NoError(res.Err) s.ContainsOnSameLine(res.Stdout.String(), "OverrideBehavior", "Pinned") - s.ContainsOnSameLine(res.Stdout.String(), "OverridePinnedVersion", version2) + s.ContainsOnSameLine(res.Stdout.String(), "OverridePinnedVersionBuildId", buildId3) // remove override res = s.Execute( diff --git a/temporalcli/commands.workflow_view.go b/temporalcli/commands.workflow_view.go index 9bfb5337f..896bd76ef 100644 --- a/temporalcli/commands.workflow_view.go +++ b/temporalcli/commands.workflow_view.go @@ -3,6 +3,7 @@ package temporalcli import ( "encoding/json" "fmt" + "strings" "time" "github.com/fatih/color" @@ -15,6 +16,7 @@ import ( "go.temporal.io/api/workflowservice/v1" "go.temporal.io/sdk/client" "go.temporal.io/sdk/converter" + "go.temporal.io/sdk/temporalnexus" ) func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []string) error { @@ -179,18 +181,51 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin cctx.Printer.Println(color.MagentaString("Versioning Info:")) cctx.Printer.Println() vInfo := info.VersioningInfo + + var dname string + var bid string + if vInfo.GetDeploymentVersion() != nil { + dname = vInfo.GetDeploymentVersion().DeploymentName + bid = vInfo.GetDeploymentVersion().BuildId + } + if dname == "" { + splitVersion := strings.SplitN(vInfo.GetVersion(), ".", 2) + if len(splitVersion) == 2 { + dname = splitVersion[0] + bid = splitVersion[1] + } + } + overrideBehavior := "" + overridePinnedVersionDeploymentName := "" + overridePinnedVersionBuildId := "" + if vInfo.VersioningOverride != nil { + switch vInfo.VersioningOverride.GetOverride().(type) { + case *workflow.VersioningOverride_Pinned: + overridePinnedVersionDeploymentName = vInfo.GetVersioningOverride().GetPinned().Version.DeploymentName + overridePinnedVersionBuildId = vInfo.GetVersioningOverride().GetPinned().Version.BuildId + overrideBehavior = enums.VERSIONING_BEHAVIOR_PINNED.String() + case *workflow.VersioningOverride_AutoUpgrade: + overrideBehavior = enums.VERSIONING_BEHAVIOR_AUTO_UPGRADE.String() + } + } _ = cctx.Printer.PrintStructured(struct { - Behavior string - Version string - OverrideBehavior string `cli:",cardOmitEmpty"` - OverridePinnedVersion string `cli:",cardOmitEmpty"` - TransitionVersion string `cli:",cardOmitEmpty"` + Behavior string + DeploymentName string + BuildId string + OverrideBehavior string `cli:",cardOmitEmpty"` + OverridePinnedVersionDeploymentName string `cli:",cardOmitEmpty"` + OverridePinnedVersionBuildId string `cli:",cardOmitEmpty"` + TransitionVersionDeploymentName string `cli:",cardOmitEmpty"` + TransitionVersionBuildId string `cli:",cardOmitEmpty"` }{ - Behavior: vInfo.Behavior.String(), - Version: vInfo.GetVersion(), - OverrideBehavior: vInfo.VersioningOverride.GetBehavior().String(), - OverridePinnedVersion: vInfo.VersioningOverride.GetPinnedVersion(), - TransitionVersion: vInfo.VersionTransition.GetVersion(), + Behavior: vInfo.Behavior.String(), + DeploymentName: dname, + BuildId: bid, + OverrideBehavior: overrideBehavior, + OverridePinnedVersionDeploymentName: overridePinnedVersionDeploymentName, + OverridePinnedVersionBuildId: overridePinnedVersionBuildId, + TransitionVersionDeploymentName: vInfo.VersionTransition.GetDeploymentVersion().GetDeploymentName(), + TransitionVersionBuildId: vInfo.VersionTransition.GetDeploymentVersion().GetBuildId(), }, printer.StructuredOptions{}) } @@ -200,6 +235,7 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin cctx.Printer.Println() cbs := make([]struct { URL string + Links []string Trigger string State enums.CallbackState Attempt int32 @@ -211,6 +247,12 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin }, 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 diff --git a/temporalcli/commands.workflow_view_test.go b/temporalcli/commands.workflow_view_test.go index a758b7815..1e9150755 100644 --- a/temporalcli/commands.workflow_view_test.go +++ b/temporalcli/commands.workflow_view_test.go @@ -558,7 +558,10 @@ func (s *SharedServerSuite) TestWorkflow_Describe_Deployment() { ctx.Done().Receive(ctx, nil) return ctx.Err() } - version := deploymentName + "." + buildId + version := worker.WorkerDeploymentVersion{ + DeploymentName: deploymentName, + BuildId: buildId, + } w := s.DevServer.StartDevWorker(s.Suite.T(), DevWorkerOptions{ Worker: worker.Options{ DeploymentOptions: worker.DeploymentOptions{ @@ -584,7 +587,8 @@ func (s *SharedServerSuite) TestWorkflow_Describe_Deployment() { res := s.Execute( "worker", "deployment", "describe-version", "--address", s.Address(), - "--version", version, + "--deployment-name", version.DeploymentName, + "--build-id", version.BuildId, ) assert.NoError(t, res.Err) }, 30*time.Second, 100*time.Millisecond) @@ -592,7 +596,8 @@ func (s *SharedServerSuite) TestWorkflow_Describe_Deployment() { res := s.Execute( "worker", "deployment", "set-current-version", "--address", s.Address(), - "--version", version, + "--deployment-name", version.DeploymentName, + "--build-id", version.BuildId, "--yes", ) s.NoError(res.Err) @@ -612,14 +617,15 @@ func (s *SharedServerSuite) TestWorkflow_Describe_Deployment() { "-w", run.GetID(), ) assert.NoError(t, res.Err) - assert.Contains(t, res.Stdout.String(), version) + assert.Contains(t, res.Stdout.String(), version.DeploymentName) + assert.Contains(t, res.Stdout.String(), version.BuildId) assert.Contains(t, res.Stdout.String(), "Pinned") }, 30*time.Second, 100*time.Millisecond) out := res.Stdout.String() s.ContainsOnSameLine(out, "Behavior", "Pinned") - s.ContainsOnSameLine(out, "Version", version) - s.ContainsOnSameLine(out, "OverrideBehavior", "Unspecified") + s.ContainsOnSameLine(out, "DeploymentName", version.DeploymentName) + s.ContainsOnSameLine(out, "BuildId", version.BuildId) // json res = s.Execute( @@ -634,7 +640,8 @@ func (s *SharedServerSuite) TestWorkflow_Describe_Deployment() { s.NoError(temporalcli.UnmarshalProtoJSONWithOptions(res.Stdout.Bytes(), &jsonResp, true)) versioningInfo := jsonResp.WorkflowExecutionInfo.VersioningInfo s.Equal("Pinned", versioningInfo.Behavior.String()) - s.Equal(version, versioningInfo.Version) + s.Equal(version.BuildId, versioningInfo.DeploymentVersion.BuildId) + s.Equal(version.DeploymentName, versioningInfo.DeploymentVersion.DeploymentName) s.Nil(versioningInfo.VersioningOverride) } diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index e79518a32..db5207c5a 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -428,8 +428,8 @@ commands: However, if the Activity is currently running, it will run to completion. If the Activity is on its last retry attempt and fails, the failure will be returned to the caller, just as if the Activity had not been paused. - - Activities can be specified by their Activity ID or Activity Type. + + Activities can be specified by their Activity ID or Activity Type. One of those parameters must be provided. If both are provided - Activity Type will be used, and Activity ID will be ignored. @@ -462,19 +462,19 @@ commands: If the Activity is not running and is past its retry timeout, it will be scheduled immediately. Otherwise, it will be scheduled after its retry - timeout expires. + timeout expires. - Use `--reset-attempts` to reset the number of previous run attempts to - zero. For example, if an Activity is near the maximum number of attempts - N specified in its retry policy, `--reset-attempts` will allow the + Use `--reset-attempts` to reset the number of previous run attempts to + zero. For example, if an Activity is near the maximum number of attempts + N specified in its retry policy, `--reset-attempts` will allow the Activity to be retried another N times after unpausing. - - Use `--reset-heartbeat` to reset the Activity's heartbeats. - - Activities can be specified by their Activity ID or Activity Type. + + Use `--reset-heartbeat` to reset the Activity's heartbeats. + + Activities can be specified by their Activity ID or Activity Type. One of those parameters must be provided. If both are provided - Activity Type will be used, and Activity ID will be ignored. - + Activities can be unpaused in bulk via a visibility Query list filter: ``` @@ -482,7 +482,7 @@ commands: --query YourQuery \ --reason YourReasonForTermination ``` - + Specify the Activity ID or Type and Workflow IDs: @@ -516,7 +516,7 @@ commands: - name: match-all type: bool description: | - Every paused activity should be unpaused. This flag is ignored if + Every paused activity should be unpaused. This flag is ignored if activity-type is provided. Can only be used with --query. - name: jitter type: duration @@ -527,24 +527,23 @@ commands: option-sets: - single-workflow-or-batch - - name: temporal activity reset summary: Reset an Activity description: | - Resetting an activity resets both the number of attempts and the activity - timeout. + Resetting an activity resets both the number of attempts and the activity + timeout. - If activity is paused and 'keep_paused' flag is not provided - it will be + If activity is paused and 'keep_paused' flag is not provided - it will be unpaused. - If activity is paused and 'keep_paused' flag is provided - it will stay + If activity is paused and 'keep_paused' flag is provided - it will stay paused. If activity is waiting for the retry, is will be rescheduled immediately. - If the 'reset_heartbeats' flag is set, the activity heartbeat timer and + If the 'reset_heartbeats' flag is set, the activity heartbeat timer and heartbeats will be reset. - Activities can be specified by their Activity ID or Activity Type. + Activities can be specified by their Activity ID or Activity Type. One of those parameters must be provided. If both are provided - Activity - Type will be used, and Activity ID will be ignored. + Type will be used, and Activity ID will be ignored. Specify the Activity Type of ID and Workflow IDs: @@ -853,17 +852,15 @@ commands: Lists the Deployments in the client's namespace. Arguments can be Worker Deployment Versions associated with - a Deployment, using a fully qualified Version identifier that - concatenates the Deployment Name and the Build ID with the - reserved separator ".". + a Deployment, specified using the Deployment name and Build ID. For example: ``` temporal worker deployment set-current-version \ - --version YourDeploymentName.YourBuildID + --deployment-name YourDeploymentName --build-id YourBuildID ``` - + Sets the current Deployment Version for a given Deployment. docs: @@ -969,7 +966,7 @@ commands: | subject to change. | +---------------------------------------------------------------------+ - Describe properties of a Worker Deployment Version, such as the task + Describe properties of a Worker Deployment Version, such as the task queues polled by workers in this Deployment Version, or drainage information required to safely decommission workers, or user-provided metadata, or its creation/modification time. @@ -984,7 +981,7 @@ commands: ``` temporal worker deployment describe-version \ - --version YourDeploymentName.YourBuildID + --deployment-name YourDeploymentName --build-id YourBuildID ``` option-sets: - deployment-version @@ -1007,7 +1004,6 @@ commands: Version have pollers. - It is not draining. This requirement can be ignored with the option `--skip-drainage`. - ``` temporal worker deployment delete-version [options] ``` @@ -1016,8 +1012,8 @@ commands: ``` temporal worker deployment delete-version \ - --version YourDeploymentName.YourBuildID \ - --skip-drainage + --deployment-name YourDeploymentName --build-id YourBuildID \ + --skip-drainage ``` option-sets: - deployment-version @@ -1041,13 +1037,13 @@ commands: When a Version is current, Workers of that Deployment Version will receive tasks from new Workflows, and from existing AutoUpgrade Workflows that are running on this Deployment. - + If not all the expected Task Queues are being polled by Workers in the new Version the request will fail. To override this protection use `--ignore-missing-task-queues`. Note that this would ignore task queues in a deployment that are not yet discovered, leading to inconsistent task queue configuration. - + ``` temporal worker deployment set-current-version [options] ``` @@ -1058,26 +1054,18 @@ commands: ``` temporal worker deployment set-current-version \ - --version YourDeploymentName.YourBuildID + --deployment-name YourDeploymentName --build-id YourBuildID ``` - The target of set-current-version can also be `__unversioned__`, which - moves tasks to unversioned workers, but in this case we also need to - specify the Deployment Name. + The target of set-current-version can also be unversioned workers: ``` temporal worker deployment set-current-version \ - --version __unversioned__ \ - --deployment-name YourDeploymentName + --deployment-name YourDeploymentName --unversioned ``` option-sets: - - deployment-version + - deployment-version-or-unversioned options: - - name: deployment-name - type: string - description: | - Deployment name. - Only needed when `--version` is `__unversioned__` or empty. - name: identity type: string description: Identity of the user submitting this request. @@ -1099,22 +1087,21 @@ commands: Set the Ramping Version and Percentage for a Deployment. - The Ramping Version can be set to a fully-qualified Version of the form - `YourDeploymentName.YourBuildID`, or set to "__unversioned__", a special - value that represents all the unversioned workers. + The Ramping Version can be set using deployment name and build ID, + or set to unversioned workers using the --unversioned flag. The Ramping Percentage is a float with values in the range [0, 100]. A value of 100 does not make the Ramping Version Current, use `set-current-version` instead. To remove a Ramping Version use the flag `--delete`. - + If not all the expected Task Queues are being polled by Workers in the new Ramping Version the request will fail. To override this protection use `--ignore-missing-task-queues`. Note that this would ignore task queues in a deployment that are not yet discovered, leading to inconsistent task queue configuration. - + ``` temporal worker deployment set-ramping-version [options] ``` @@ -1126,25 +1113,19 @@ commands: ``` temporal worker deployment set-ramping-version \ - --version YourDeploymentName.YourBuildID + --deployment-name YourDeploymentName --build-id YourBuildID \ --percentage 10.0 ``` And to remove that ramping: - ``` temporal worker deployment set-ramping-version \ - --version YourDeploymentName.YourBuildID \ + --deployment-name YourDeploymentName --build-id YourBuildID \ --delete ``` option-sets: - - deployment-version + - deployment-version-or-unversioned options: - - name: deployment-name - type: string - description: | - Deployment name. - Only needed when `--version` is `__unversioned__`. - name: percentage type: float description: | @@ -1177,16 +1158,15 @@ commands: ``` temporal worker deployment update-metadata-version \ - --version YourDeploymentName.YourBuildID \ + --deployment-name YourDeploymentName --build-id YourBuildID \ --metadata bar=1 \ --metadata foo=true ``` The current metadata is also returned with `describe-version`: - ``` temporal worker deployment describe-version \ - --version YourDeploymentName.YourBuildID \ + --deployment-name YourDeploymentName --build-id YourBuildID \ ``` option-sets: - deployment-version @@ -3373,8 +3353,8 @@ commands: temporal workflow update-options \ --workflow-id YourWorkflowId \ --versioning-override-behavior pinned \ - --versioning-override-pinned-version \ - YourDeploymentSeriesName.YourDeploymentBuildId + --versioning-override-deployment-name YourDeploymentName \ + --versioning-override-build-id YourDeploymentBuildId ``` To remove any previous overrides, set the behavior to @@ -3400,10 +3380,14 @@ commands: - unspecified - pinned - auto_upgrade - - name: versioning-override-pinned-version + - name: versioning-override-deployment-name type: string - description: Override Pinned Version for a Worker Deployment (Only for pinned). - + description: When overriding to a `pinned` behavior, specifies the Deployment Name of the + version to target. + - name: versioning-override-build-id + type: string + description: When overriding to a `pinned` behavior, specifies the Build ID of the + version to target. - name: temporal workflow query summary: Retrieve Workflow Execution state description: | @@ -3591,7 +3575,7 @@ commands: summary: Send a message to a Workflow Execution, start the execution if it isn't running description: | Send an asynchronous notification (Signal) to a Workflow Execution. - If the Workflow Execution is not running or is not found, it starts the + If the Workflow Execution is not running or is not found, it starts the workflow then sends the signal. ``` @@ -4220,14 +4204,34 @@ option-sets: - name: deployment-version options: - - name: version + - name: deployment-name type: string - short: v description: | - Fully-qualified name for a Worker Deployment Version. - Use the format `YourDeploymentName.YourBuildID`. + Name of the Worker Deployment. + required: true + - name: build-id + type: string + description: | + Build ID of the Worker Deployment Version. required: true + - name: deployment-version-or-unversioned + options: + - name: deployment-name + type: string + description: | + Name of the Worker Deployment. + required: true + - name: build-id + type: string + description: | + Build ID of the Worker Deployment Version. + Required unless --unversioned is specified. + - name: unversioned + type: bool + description: | + Set unversioned workers as the target version. + Cannot be used with --build-id. - name: deployment-reference options: - name: series-name