From b88c2a9e9be47f8ddb87c8688ae4d4cddb60af9b Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Tue, 27 Feb 2024 20:01:35 -0800 Subject: [PATCH 1/4] Expose more errors as user-visible so users can adjust their queries in a useful way. (#2448) --- internal/controlplane/handlers_profile.go | 4 ++-- internal/engine/entities/entities.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/controlplane/handlers_profile.go b/internal/controlplane/handlers_profile.go index f97a0c5ae5..74c938c3eb 100644 --- a/internal/controlplane/handlers_profile.go +++ b/internal/controlplane/handlers_profile.go @@ -395,7 +395,7 @@ func (s *Server) GetProfileStatusByName(ctx context.Context, }) if err != nil { if errors.Is(err, sql.ErrNoRows) { - return nil, status.Errorf(codes.NotFound, "profile status not found") + return nil, util.UserVisibleError(codes.NotFound, "profile %q status not found", in.Name) } return nil, status.Errorf(codes.Unknown, "failed to get profile: %s", err) } @@ -411,7 +411,7 @@ func (s *Server) GetProfileStatusByName(ctx context.Context, dbEntity = &db.NullEntities{} } else if e := in.GetEntity(); e != nil { if !e.GetType().IsValid() { - return nil, status.Errorf(codes.InvalidArgument, + return nil, util.UserVisibleError(codes.InvalidArgument, "invalid entity type %s, please use one of %s", e.GetType(), entities.KnownTypesCSV()) } diff --git a/internal/engine/entities/entities.go b/internal/engine/entities/entities.go index a8d3db2f7b..162156b8e8 100644 --- a/internal/engine/entities/entities.go +++ b/internal/engine/entities/entities.go @@ -42,7 +42,7 @@ func KnownTypesCSV() string { } slices.Sort(keys) - return strings.Join(keys, ",") + return strings.Join(keys, ", ") } // EntityTypeFromDB returns the entity type from the database entity From 7f134919c0e3fc80a30743ca7d3c59735fc218b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 08:48:11 +0200 Subject: [PATCH 2/4] build(deps): bump docker/setup-buildx-action from 3.0.0 to 3.1.0 (#2450) Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/f95db51fddba0c2d1ec667646a06c2ce06100226...0d103c3126aa41d772a8362f6aa67afac040f80c) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/image-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index fd00529125..957c5c5605 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -47,7 +47,7 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 + uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3 - name: Test build on x86 id: docker_build uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5 From 3d5b7e348626aa95476108b3bb7d4174a1f0283f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 08:48:41 +0200 Subject: [PATCH 3/4] build(deps): bump peter-evans/create-pull-request from 6.0.0 to 6.0.1 (#2449) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/b1ddad2c994a25fbc81a28b3ec0e368bb2021c50...a4f52f8033a6168103c2538976c07b467e8163bc) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-docs-cli.yml | 2 +- .github/workflows/update-docs-dbschema.yml | 2 +- .github/workflows/update-docs-helm.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-docs-cli.yml b/.github/workflows/update-docs-cli.yml index ea3882ade0..8148091fd2 100644 --- a/.github/workflows/update-docs-cli.yml +++ b/.github/workflows/update-docs-cli.yml @@ -31,7 +31,7 @@ jobs: echo "commit_date=$COMMIT_DATE" >> $GITHUB_OUTPUT echo "commit_author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT - name: Commit and push changes - uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v5 + uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # v5 with: commit-message: Update documentation committer: GitHub diff --git a/.github/workflows/update-docs-dbschema.yml b/.github/workflows/update-docs-dbschema.yml index f55f6ab732..7bd0cff0e0 100644 --- a/.github/workflows/update-docs-dbschema.yml +++ b/.github/workflows/update-docs-dbschema.yml @@ -27,7 +27,7 @@ jobs: echo "commit_date=$COMMIT_DATE" >> $GITHUB_OUTPUT echo "commit_author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT - name: Commit and push changes - uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v5 + uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # v5 with: commit-message: Update DB schema committer: GitHub diff --git a/.github/workflows/update-docs-helm.yml b/.github/workflows/update-docs-helm.yml index f966874868..eb51cc7b0b 100644 --- a/.github/workflows/update-docs-helm.yml +++ b/.github/workflows/update-docs-helm.yml @@ -39,7 +39,7 @@ jobs: echo "commit_date=$COMMIT_DATE" >> $GITHUB_OUTPUT echo "commit_author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT - name: Commit and push changes - uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v5 + uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # v5 with: commit-message: Update helm documentation committer: GitHub From a10ba305008040b6383f971e19361be94a1ede75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:16:08 +0200 Subject: [PATCH 4/4] build(deps): bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 (#2451) build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/v1.19.0/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 5 ++--- go.sum | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index df131bf3b2..18a53c34e5 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/openfga/go-sdk v0.3.5 github.com/openfga/openfga v1.4.3 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c - github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/client_golang v1.19.0 github.com/puzpuzpuz/xsync/v3 v3.1.0 github.com/robfig/cron/v3 v3.0.1 github.com/rs/zerolog v1.32.0 @@ -113,7 +113,6 @@ require ( github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/option v1.0.1 // indirect github.com/mattn/go-localereader v0.0.1 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muhlemmer/gu v0.3.1 // indirect @@ -232,7 +231,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.4.4 // indirect diff --git a/go.sum b/go.sum index 60f59f4822..69ad09b17b 100644 --- a/go.sum +++ b/go.sum @@ -539,8 +539,6 @@ github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRC github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -623,16 +621,16 @@ github.com/pressly/goose/v3 v3.17.0 h1:fT4CL3LRm4kfyLuPWzDFAoxjR5ZHjeJ6uQhibQtBa github.com/pressly/goose/v3 v3.17.0/go.mod h1:22aw7NpnCPlS86oqkO/+3+o9FuCaJg4ZVWRUO3oGzHQ= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=