From c06bbfda0a745b533ad25367b8d68f1b48cbf454 Mon Sep 17 00:00:00 2001 From: Yuvraj Date: Wed, 18 Aug 2021 22:20:58 +0530 Subject: [PATCH] Added validation check to impose limits on stored, free-form strings (#180) * Added validation check for all models Signed-off-by: Yuvraj --- flyteadmin/go.mod | 2 + flyteadmin/go.sum | 54 +++++++++++++++++-- .../pkg/repositories/config/postgres.go | 2 + .../pkg/repositories/models/execution.go | 22 ++++---- .../repositories/models/execution_event.go | 2 +- .../pkg/repositories/models/launch_plan.go | 8 +-- .../pkg/repositories/models/named_entity.go | 14 ++--- .../pkg/repositories/models/node_execution.go | 2 +- flyteadmin/pkg/repositories/models/project.go | 2 +- .../pkg/repositories/models/resource.go | 10 ++-- flyteadmin/pkg/repositories/models/task.go | 10 ++-- .../pkg/repositories/models/task_execution.go | 4 +- .../pkg/repositories/models/workflow.go | 8 +-- flyteadmin/tests/attributes_test.go | 9 ++++ 14 files changed, 105 insertions(+), 44 deletions(-) diff --git a/flyteadmin/go.mod b/flyteadmin/go.mod index cf6ad54f7..15064c046 100644 --- a/flyteadmin/go.mod +++ b/flyteadmin/go.mod @@ -46,6 +46,8 @@ require ( github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect github.com/prometheus/client_golang v1.9.0 github.com/prometheus/common v0.19.0 // indirect + github.com/qor/qor v1.2.0 // indirect + github.com/qor/validations v0.0.0-20171228122639-f364bca61b46 github.com/sendgrid/rest v2.6.4+incompatible // indirect github.com/sendgrid/sendgrid-go v3.10.0+incompatible github.com/sirupsen/logrus v1.8.1 // indirect diff --git a/flyteadmin/go.sum b/flyteadmin/go.sum index a13b5014e..7bea926bf 100644 --- a/flyteadmin/go.sum +++ b/flyteadmin/go.sum @@ -153,6 +153,7 @@ github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.3/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.20/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.37.1/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.37.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.37.31 h1:eK7hgg1H4xivwopAbnzfQ7ZBbDb9cEkGDivd9rUMnJs= @@ -169,6 +170,7 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.0.0/go.mod h1:5f+cELGATgill5Pu3/vK3E github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benlaurie/objecthash v0.0.0-20180202135721-d1e3d6079fc1 h1:VRtJdDi2lqc3MFwmouppm2jlm6icF+7H3WYKpLENMTo= @@ -197,6 +199,7 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= +github.com/chris-ramon/douceur v0.2.0/go.mod h1:wDW5xjJdeoMm1mRt4sD4c/LbF/mWdEpRXQKjTR8nIBE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -257,6 +260,7 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -746,6 +750,7 @@ github.com/gopherjs/gopherjs v0.0.0-20181004151105-1babbf986f6f/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -758,10 +763,12 @@ github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyC github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.1.2/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= github.com/gorilla/sessions v1.1.3/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= +github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gosimple/slug v1.9.0/go.mod h1:AMZ+sOVe65uByN3kgEyf9WEBKBCSS+dJjMX9x4vDJbg= github.com/gotestyourself/gotestyourself v1.3.0/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graymeta/stow v0.2.7 h1:b31cB1Ylw/388sYSZxnmpjT2QxC21AaQ8fRnUtE13b4= @@ -855,15 +862,19 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jinzhu/configor v1.2.0/go.mod h1:nX89/MOmDba7ZX7GCyU/VIaQ2Ar2aizBl2d3JLF/rDc= github.com/jinzhu/gorm v1.9.2/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= +github.com/jinzhu/gorm v1.9.14/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jinzhu/gorm v1.9.15/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v0.0.0-20181116074157-8ec929ed50c3/go.mod h1:oHTiXerJ20+SfYcrdlBO7rzZRJWGwSTQ0iUY2jI6Gfc= -github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E= +github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -914,7 +925,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -944,6 +954,7 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -1013,6 +1024,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182aff github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/microcosm-cc/bluemonday v1.0.3/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -1056,6 +1068,8 @@ github.com/ncw/swift v1.0.49/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ github.com/ncw/swift v1.0.53 h1:luHjjTNtekIEvHg5KdAFIBaH7bWfNkefwFnpDffSIks= github.com/ncw/swift v1.0.53/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -1201,6 +1215,34 @@ github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/qor/admin v0.0.0-20200701030804-02d81a10a8bf/go.mod h1:Sm5kX+Hkq1LKiFyqZJLnncUg8dWM/2roOEiy98NOUzA= +github.com/qor/admin v0.0.0-20200728131616-564dfca36b14/go.mod h1:TiMo/I9p4pjVFtLI8+ellx2YbeiirVYcoh5UrQc9v9I= +github.com/qor/admin v0.0.0-20210618081816-6df954b69f20/go.mod h1:VhWvTKxb2tdmu1GkVc6U5Oak0r7NyskTSj3ZPDQOrTI= +github.com/qor/admin v0.0.0-20210622020116-b031b9cba8be/go.mod h1:Yz4adpkVO2JUS9cK9Pk1HP5L58LYXbaLJcFiqIjKGwU= +github.com/qor/assetfs v0.0.0-20170713023933-ff57fdc13a14/go.mod h1:GZSCP3jIneuPsav3pXmpmJwz9ES+Fuq4ZPOUC3wwckQ= +github.com/qor/audited v0.0.0-20171228121055-b52c9c2f0571/go.mod h1:XQ/SY+Bgd2pHTAQhsSwN7KoCJSr8jJVnUqDMPk9rhYk= +github.com/qor/l10n v0.0.0-20181031091737-2ca95fb3b4dd/go.mod h1:SL121FdEw7YlEMYbqngGLjRZbzyxSnxCFGWTnVHgNfM= +github.com/qor/media v0.0.0-20200720100650-60c52edf57cb/go.mod h1:hzx9cTt5MpROMVIhwNhRJETc7e3a1J4bLNYflkcQ1wk= +github.com/qor/middlewares v0.0.0-20170822143614-781378b69454/go.mod h1:PejEyg3hS+Toh5m0AKRv2jK5br8qIoHLqmHrpg0WJYg= +github.com/qor/oss v0.0.0-20191031055114-aef9ba66bf76/go.mod h1:JhtPzUhP5KGtCB2yksmxuYAD4hEWw4qGQJpucjsm3U0= +github.com/qor/publish v0.0.0-20181014061411-abfbacee9e0d/go.mod h1:rsJ6QTqNLOPY3xaWmphqPkMqqbBPS8pAwkJWY+t5XHg= +github.com/qor/publish2 v0.0.0-20200106024649-fcb930aa85ac/go.mod h1:f29A86/3KWWIOAsHjZP4gVb/PHHtPIONEm5ZrjqTU9A= +github.com/qor/publish2 v0.0.0-20200729081509-d97fdb5620a5/go.mod h1:eWD99pi0Tv8eO0V+cdDxTpJEZYuxjMzQ0oBo0DRx8vE= +github.com/qor/qor v0.0.0-20200715033016-13227382be83/go.mod h1:oG+LgDEnsI9avcFFdczoZnBe3rw42s4cG433w6XpEig= +github.com/qor/qor v0.0.0-20200729071734-d587cffbbb93/go.mod h1:i3WqgQWpyNJRB9D3ewgthf5/8fR/ALcvPGUqu5vHZA8= +github.com/qor/qor v0.0.0-20200910063046-9fd9b0159793/go.mod h1:auMzQviFtvyB4kMsKZ4STU78euz0f/lDD52xY8DAyGE= +github.com/qor/qor v0.0.0-20210618082622-a52aba0a0ce1/go.mod h1:o/VCIcWT8JQ+9t6fHGZZ3sDABv39PwktdJL3I5qmGHw= +github.com/qor/qor v1.2.0 h1:13GClzwPmVNPHjUXAuZiVX6pOea8JXyr6mES0zuP+Uc= +github.com/qor/qor v1.2.0/go.mod h1:4JiLaf9Z8lycEWNYC0603IM0ofPWkeVinBhOgeeLFKA= +github.com/qor/responder v0.0.0-20171031032654-b6def473574f/go.mod h1:0TL2G+qGDYhHJ6XIJ6UcqkZVN+jp8AGqGU2wDnv2qas= +github.com/qor/roles v0.0.0-20171127035124-d6375609fe3e/go.mod h1:++RicL9Ia/BrQHppwAsMc5CA7mAjnBLNniB46MzUteA= +github.com/qor/serializable_meta v0.0.0-20180510060738-5fd8542db417/go.mod h1:ZhRkze6qCgCNNqisHEFTAkndoBtY/XJbA03LJLJrzDY= +github.com/qor/session v0.0.0-20170907035918-8206b0adab70/go.mod h1:ldgcaca0ZGx6tFtd/w0ELq5jHD/KLJ1Lbdn8qhr/pQ0= +github.com/qor/sorting v0.0.0-20200724034229-cdba739ba535/go.mod h1:Nmne32NH9i0UnoO0z2tbzXEKbrptnR3RM1MoRYTgpaM= +github.com/qor/validations v0.0.0-20171228122639-f364bca61b46 h1:dRlsVUhwD1pwrasuVbNooGQITYjKzmXK5eYoEEvBGQI= +github.com/qor/validations v0.0.0-20171228122639-f364bca61b46/go.mod h1:UJsA0AuvrKNaWtrb1UzKai10mN3ZBbQkPjUHpxwahTc= +github.com/qor/worker v0.0.0-20190805090529-35a245417f70/go.mod h1:M+3u2k0/OiZCc4thYtdE2Cps+n5tOOfI7X7LdHUo9/k= +github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be/go.mod h1:MIDFMn7db1kT65GmV94GzpX9Qdi7N/pQlwb+AN8wh+Q= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -1327,6 +1369,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.1.1/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/theplant/cldr v0.0.0-20190423050709-9f76f7ce4ee8/go.mod h1:MIL7SmF8wRAYDn+JexczVRUiJXTCi4VbQavsCKWKwXI= +github.com/theplant/htmltestingutils v0.0.0-20190423050759-0e06de7b6967/go.mod h1:86iN4EAYaQbx1VTW5uPslTIviRkYH8CzslMC//g+BgY= +github.com/theplant/testingutils v0.0.0-20190603093022-26d8b4d95c61/go.mod h1:p22Q3Bg5ML+hdI3QSQkB/pZ2+CjfOnGugoQIoyE2Ub8= github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1353,6 +1398,7 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM= +github.com/yosssi/gohtml v0.0.0-20200519115854-476f5b4b8047/go.mod h1:+ccdNT0xMY1dtc5XBxumbYfOUhmduiGudqaDgD2rVRE= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1473,6 +1519,7 @@ golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8H golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1967,8 +2014,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= diff --git a/flyteadmin/pkg/repositories/config/postgres.go b/flyteadmin/pkg/repositories/config/postgres.go index 7d1a56f48..1f0198387 100644 --- a/flyteadmin/pkg/repositories/config/postgres.go +++ b/flyteadmin/pkg/repositories/config/postgres.go @@ -7,6 +7,7 @@ import ( "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/postgres" // Required to import database driver. + "github.com/qor/validations" ) const Postgres = "postgres" @@ -77,5 +78,6 @@ func OpenDbConnection(config DbConnectionConfigProvider) *gorm.DB { panic(err) } db.LogMode(config.IsDebug()) + validations.RegisterCallbacks(db) return db } diff --git a/flyteadmin/pkg/repositories/models/execution.go b/flyteadmin/pkg/repositories/models/execution.go index 554d9d8df..61de003d4 100644 --- a/flyteadmin/pkg/repositories/models/execution.go +++ b/flyteadmin/pkg/repositories/models/execution.go @@ -11,19 +11,19 @@ import ( // Execution primary key type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project"` - Domain string `gorm:"primary_key;column:execution_domain"` - Name string `gorm:"primary_key;column:execution_name"` + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|255)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|255)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|255)"` } // Database model to encapsulate a (workflow) execution. type Execution struct { BaseModel ExecutionKey - LaunchPlanID uint `gorm:"index"` - WorkflowID uint `gorm:"index"` - TaskID uint `gorm:"index"` - Phase string + LaunchPlanID uint `gorm:"index"` + WorkflowID uint `gorm:"index"` + TaskID uint `gorm:"index"` + Phase string `valid:"length(0|255)"` Closure []byte Spec []byte `gorm:"not null"` StartedAt *time.Time @@ -37,7 +37,7 @@ type Execution struct { ExecutionEvents []ExecutionEvent // In the case of an aborted execution this string may be non-empty. // It should be ignored for any other value of phase other than aborted. - AbortCause string + AbortCause string `valid:"length(0|255)"` // Corresponds to the execution mode used to trigger this execution Mode int32 // The "parent" execution (if there is one) that is related to this execution. @@ -47,7 +47,7 @@ type Execution struct { // The parent node execution if this was launched by a node ParentNodeExecutionID uint // Cluster where execution was triggered - Cluster string + Cluster string `valid:"length(0|255)"` // Offloaded location of inputs LiteralMap. These are the inputs evaluated and contain applied defaults. InputsURI storage.DataReference // User specified inputs. This map might be incomplete and not include defaults applied @@ -55,8 +55,8 @@ type Execution struct { // Execution Error Kind. nullable ErrorKind *string `gorm:"index"` // Execution Error Code nullable - ErrorCode *string + ErrorCode *string `valid:"length(0|255)"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. - User string `gorm:"index"` + User string `gorm:"index" valid:"length(0|255)"` } diff --git a/flyteadmin/pkg/repositories/models/execution_event.go b/flyteadmin/pkg/repositories/models/execution_event.go index b15ab4cb8..b6e18decc 100644 --- a/flyteadmin/pkg/repositories/models/execution_event.go +++ b/flyteadmin/pkg/repositories/models/execution_event.go @@ -7,7 +7,7 @@ import ( type ExecutionEvent struct { BaseModel ExecutionKey - RequestID string + RequestID string `valid:"length(0|255)"` OccurredAt time.Time Phase string `gorm:"primary_key"` } diff --git a/flyteadmin/pkg/repositories/models/launch_plan.go b/flyteadmin/pkg/repositories/models/launch_plan.go index 228e9f5c9..88b16d28f 100644 --- a/flyteadmin/pkg/repositories/models/launch_plan.go +++ b/flyteadmin/pkg/repositories/models/launch_plan.go @@ -2,10 +2,10 @@ package models // Launch plan primary key type LaunchPlanKey struct { - Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` - Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` - Name string `gorm:"primary_key;index:lp_project_domain_name_idx"` - Version string `gorm:"primary_key"` + Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:lp_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` } type LaunchPlanScheduleType string diff --git a/flyteadmin/pkg/repositories/models/named_entity.go b/flyteadmin/pkg/repositories/models/named_entity.go index 5b09e97ee..966676d0c 100644 --- a/flyteadmin/pkg/repositories/models/named_entity.go +++ b/flyteadmin/pkg/repositories/models/named_entity.go @@ -6,10 +6,10 @@ import ( // NamedEntityMetadata primary key type NamedEntityMetadataKey struct { - ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"` - Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"` - Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"` - Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` } // Fields to be composed into any named entity @@ -30,9 +30,9 @@ type NamedEntityMetadata struct { // fields here should match the ones in NamedEntityMetadataKey. type NamedEntityKey struct { ResourceType core.ResourceType - Project string - Domain string - Name string + Project string `valid:"length(0|255)"` + Domain string `valid:"length(0|255)"` + Name string `valid:"length(0|255)"` } // Composes an identifier (NamedEntity) and its associated metadata fields diff --git a/flyteadmin/pkg/repositories/models/node_execution.go b/flyteadmin/pkg/repositories/models/node_execution.go index 1e84e04a7..9cc3fbaf9 100644 --- a/flyteadmin/pkg/repositories/models/node_execution.go +++ b/flyteadmin/pkg/repositories/models/node_execution.go @@ -9,7 +9,7 @@ import ( type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"primary_key;index"` + NodeID string `gorm:"primary_key;index" valid:"length(0|255)"` } // By convention, gorm foreign key references are of the form {ModelName}ID diff --git a/flyteadmin/pkg/repositories/models/project.go b/flyteadmin/pkg/repositories/models/project.go index adcae65a7..a5feedb27 100644 --- a/flyteadmin/pkg/repositories/models/project.go +++ b/flyteadmin/pkg/repositories/models/project.go @@ -3,7 +3,7 @@ package models type Project struct { BaseModel Identifier string `gorm:"primary_key"` - Name string // Human-readable name, not a unique identifier. + Name string `valid:"length(0|255)"` // Human-readable name, not a unique identifier. Description string `gorm:"type:varchar(300)"` Labels []byte // GORM doesn't save the zero value for ints, so we use a pointer for the State field diff --git a/flyteadmin/pkg/repositories/models/resource.go b/flyteadmin/pkg/repositories/models/resource.go index 74e0429d7..08299a62e 100644 --- a/flyteadmin/pkg/repositories/models/resource.go +++ b/flyteadmin/pkg/repositories/models/resource.go @@ -18,11 +18,11 @@ type Resource struct { CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"unique_index:resource_idx"` - Domain string `gorm:"unique_index:resource_idx"` - Workflow string `gorm:"unique_index:resource_idx"` - LaunchPlan string `gorm:"unique_index:resource_idx"` - ResourceType string `gorm:"unique_index:resource_idx"` + Project string `gorm:"unique_index:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"unique_index:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"unique_index:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"unique_index:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"unique_index:resource_idx" valid:"length(0|255)"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte diff --git a/flyteadmin/pkg/repositories/models/task.go b/flyteadmin/pkg/repositories/models/task.go index dc5237c3a..a48251e8f 100644 --- a/flyteadmin/pkg/repositories/models/task.go +++ b/flyteadmin/pkg/repositories/models/task.go @@ -5,10 +5,10 @@ package models // Task primary key type TaskKey struct { - Project string `gorm:"primary_key;index:task_project_domain_name_idx,task_project_domain_idx"` - Domain string `gorm:"primary_key;index:task_project_domain_name_idx,task_project_domain_idx"` - Name string `gorm:"primary_key;index:task_project_domain_name_idx"` - Version string `gorm:"primary_key"` + Project string `gorm:"primary_key;index:task_project_domain_name_idx,task_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:task_project_domain_name_idx,task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` } // Database model to encapsulate a task. @@ -19,5 +19,5 @@ type Task struct { // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string + Type string `valid:"length(0|255)"` } diff --git a/flyteadmin/pkg/repositories/models/task_execution.go b/flyteadmin/pkg/repositories/models/task_execution.go index 8a3e5ab20..febe96f87 100644 --- a/flyteadmin/pkg/repositories/models/task_execution.go +++ b/flyteadmin/pkg/repositories/models/task_execution.go @@ -20,9 +20,9 @@ type TaskExecutionKey struct { type TaskExecution struct { BaseModel TaskExecutionKey - Phase string + Phase string `valid:"length(0|255)"` PhaseVersion uint32 - InputURI string + InputURI string `valid:"length(0|255)"` Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the TaskExecution closure diff --git a/flyteadmin/pkg/repositories/models/workflow.go b/flyteadmin/pkg/repositories/models/workflow.go index e7f9d7b28..42741e2ea 100644 --- a/flyteadmin/pkg/repositories/models/workflow.go +++ b/flyteadmin/pkg/repositories/models/workflow.go @@ -2,9 +2,9 @@ package models // Workflow primary key type WorkflowKey struct { - Project string `gorm:"primary_key;index:workflow_project_domain_name_idx,workflow_project_domain_idx"` - Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx,workflow_project_domain_idx"` - Name string `gorm:"primary_key;index:workflow_project_domain_name_idx"` + Project string `gorm:"primary_key;index:workflow_project_domain_name_idx,workflow_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx,workflow_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` Version string `gorm:"primary_key"` } @@ -13,7 +13,7 @@ type Workflow struct { BaseModel WorkflowKey TypedInterface []byte - RemoteClosureIdentifier string `gorm:"not null"` + RemoteClosureIdentifier string `gorm:"not null" valid:"length(0|255)"` LaunchPlans []LaunchPlan Executions []Execution // Hash of the compiled workflow closure diff --git a/flyteadmin/tests/attributes_test.go b/flyteadmin/tests/attributes_test.go index 7d55c0f6d..5b3343bb6 100644 --- a/flyteadmin/tests/attributes_test.go +++ b/flyteadmin/tests/attributes_test.go @@ -5,6 +5,7 @@ package tests import ( "context" "testing" + "fmt" "github.com/golang/protobuf/proto" @@ -42,6 +43,7 @@ func TestUpdateProjectDomainAttributes(t *testing.T) { } _, err := client.UpdateProjectDomainAttributes(ctx, &req) + fmt.Println(err) assert.Nil(t, err) response, err := client.GetProjectDomainAttributes(ctx, &admin.ProjectDomainAttributesGetRequest{ @@ -49,6 +51,7 @@ func TestUpdateProjectDomainAttributes(t *testing.T) { Domain: "development", ResourceType: admin.MatchableResource_TASK_RESOURCE, }) + fmt.Println(err) assert.Nil(t, err) assert.True(t, proto.Equal(&admin.ProjectDomainAttributesGetResponse{ Attributes: &admin.ProjectDomainAttributes{ @@ -64,6 +67,7 @@ func TestUpdateProjectDomainAttributes(t *testing.T) { Workflow: "workflow", ResourceType: admin.MatchableResource_TASK_RESOURCE, }) + fmt.Println(err) assert.Nil(t, err) // Testing that if overrides are not set at workflow level, the one from Project-Domain is returned assert.True(t, proto.Equal(&admin.WorkflowAttributesGetResponse{ @@ -80,6 +84,7 @@ func TestUpdateProjectDomainAttributes(t *testing.T) { Domain: "development", ResourceType: admin.MatchableResource_TASK_RESOURCE, }) + fmt.Println(err) assert.Nil(t, err) response, err = client.GetProjectDomainAttributes(ctx, &admin.ProjectDomainAttributesGetRequest{ @@ -87,6 +92,7 @@ func TestUpdateProjectDomainAttributes(t *testing.T) { Domain: "development", ResourceType: admin.MatchableResource_TASK_RESOURCE, }) + fmt.Println(err) assert.Nil(t, response) assert.EqualError(t, err, "rpc error: code = NotFound desc = Resource [{Project:admintests Domain:development Workflow: LaunchPlan: ResourceType:TASK_RESOURCE}] not found") } @@ -110,6 +116,7 @@ func TestUpdateWorkflowAttributes(t *testing.T) { } _, err := client.UpdateWorkflowAttributes(ctx, &req) + fmt.Println(err) assert.Nil(t, err) response, err := client.GetWorkflowAttributes(ctx, &admin.WorkflowAttributesGetRequest{ @@ -118,6 +125,7 @@ func TestUpdateWorkflowAttributes(t *testing.T) { Workflow: "workflow", ResourceType: admin.MatchableResource_TASK_RESOURCE, }) + fmt.Println(err) assert.Nil(t, err) assert.True(t, proto.Equal(&admin.WorkflowAttributesGetResponse{ Attributes: &admin.WorkflowAttributes{ @@ -134,6 +142,7 @@ func TestUpdateWorkflowAttributes(t *testing.T) { Workflow: "workflow", ResourceType: admin.MatchableResource_TASK_RESOURCE, }) + fmt.Println(err) assert.Nil(t, err) _, err = client.GetWorkflowAttributes(ctx, &admin.WorkflowAttributesGetRequest{