Bump github.com/authzed/authzed-go from 1.2.0 to 1.2.1 #4285
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Abstract Machines | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Check the consistency of generated files | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check-generated-files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
cache-dependency-path: "go.sum" | |
- name: Check for changes in go.mod | |
run: | | |
go mod tidy | |
git diff --exit-code | |
- name: Check for changes in specific paths | |
uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
base: main | |
filters: | | |
proto: | |
- ".github/workflows/check-generated-files.yml" | |
- "auth.proto" | |
- "auth/*.pb.go" | |
- "pkg/messaging/message.proto" | |
- "pkg/messaging/*.pb.go" | |
mocks: | |
- ".github/workflows/check-generated-files.yml" | |
- "pkg/sdk/sdk.go" | |
- "users/postgres/clients.go" | |
- "users/clients.go" | |
- "pkg/clients/clients.go" | |
- "pkg/messaging/pubsub.go" | |
- "clients/postgres/clients.go" | |
- "clients/clients.go" | |
- "pkg/authz.go" | |
- "pkg/authn.go" | |
- "auth/domains.go" | |
- "auth/keys.go" | |
- "auth/service.go" | |
- "pkg/events/events.go" | |
- "provision/service.go" | |
- "pkg/groups/groups.go" | |
- "bootstrap/service.go" | |
- "bootstrap/configs.go" | |
- "invitations/invitations.go" | |
- "users/emailer.go" | |
- "users/hasher.go" | |
- "mqtt/events/streams.go" | |
- "readers/messages.go" | |
- "consumers/notifiers/notifier.go" | |
- "consumers/notifiers/service.go" | |
- "consumers/notifiers/subscriptions.go" | |
- "certs/certs.go" | |
- "certs/pki/vault.go" | |
- "certs/service.go" | |
- "journal/journal.go" | |
- name: Set up protoc | |
if: steps.changes.outputs.proto == 'true' | |
run: | | |
PROTOC_VERSION=29.0 | |
PROTOC_GEN_VERSION=v1.36.0 | |
PROTOC_GRPC_VERSION=v1.5.1 | |
# Export the variables so they are available in future steps | |
echo "PROTOC_VERSION=$PROTOC_VERSION" >> $GITHUB_ENV | |
echo "PROTOC_GEN_VERSION=$PROTOC_GEN_VERSION" >> $GITHUB_ENV | |
echo "PROTOC_GRPC_VERSION=$PROTOC_GRPC_VERSION" >> $GITHUB_ENV | |
# Download and install protoc | |
PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip | |
curl -0L -o $PROTOC_ZIP https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP | |
unzip -o $PROTOC_ZIP -d protoc3 | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
sudo mv protoc3/include/* /usr/local/include/ | |
rm -rf $PROTOC_ZIP protoc3 | |
# Install protoc-gen-go and protoc-gen-go-grpc | |
go install google.golang.org/protobuf/cmd/protoc-gen-go@$PROTOC_GEN_VERSION | |
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$PROTOC_GRPC_VERSION | |
# Add protoc to the PATH | |
export PATH=$PATH:/usr/local/bin/protoc | |
- name: Check Protobuf is up to Date | |
if: steps.changes.outputs.proto == 'true' | |
run: | | |
for p in $(find . -name "*.pb.go"); do | |
mv $p $p.tmp | |
done | |
make proto | |
for p in $(find . -name "*.pb.go"); do | |
if ! cmp -s $p $p.tmp; then | |
echo "Error: Proto file and generated Go file $p are out of sync!" | |
echo "Here is the difference:" | |
diff $p $p.tmp || true | |
echo "Please run 'make proto' with protoc version $PROTOC_VERSION, protoc-gen-go version $PROTOC_GEN_VERSION and protoc-gen-go-grpc version $PROTOC_GRPC_VERSION and commit the changes." | |
exit 1 | |
fi | |
done | |
- name: Check Mocks are up to Date | |
if: steps.changes.outputs.mocks == 'true' | |
run: | | |
MOCKERY_VERSION=v2.43.2 | |
go install github.com/vektra/mockery/v2@$MOCKERY_VERSION | |
mv ./invitations/mocks/repository.go ./invitations/mocks/repository.go.tmp | |
mv ./invitations/mocks/service.go ./invitations/mocks/service.go.tmp | |
mv ./auth/mocks/token_client.go ./auth/mocks/token_client.go.tmp | |
mv ./auth/mocks/authz.go ./auth/mocks/authz.go.tmp | |
mv ./auth/mocks/keys.go ./auth/mocks/keys.go.tmp | |
mv ./auth/mocks/service.go ./auth/mocks/service.go.tmp | |
mv ./bootstrap/mocks/configs.go ./bootstrap/mocks/configs.go.tmp | |
mv ./bootstrap/mocks/config_reader.go ./bootstrap/mocks/config_reader.go.tmp | |
mv ./bootstrap/mocks/service.go ./bootstrap/mocks/service.go.tmp | |
mv ./domains/mocks/domains_client.go ./domains/mocks/domains_client.go.tmp | |
mv ./domains/mocks/repository.go ./domains/mocks/repository.go.tmp | |
mv ./domains/mocks/service.go ./domains/mocks/service.go.tmp | |
mv ./channels/mocks/repository.go ./channels/mocks/repository.go.tmp | |
mv ./channels/mocks/channels_client.go ./channels/mocks/channels_client.go.tmp | |
mv ./channels/mocks/service.go ./channels/mocks/service.go.tmp | |
mv ./groups/private/mocks/service.go ./groups/private/mocks/service.go.tmp | |
mv ./groups/mocks/repository.go ./groups/mocks/repository.go.tmp | |
mv ./groups/mocks/groups_client.go ./groups/mocks/groups_client.go.tmp | |
mv ./groups/mocks/service.go ./groups/mocks/service.go.tmp | |
mv ./users/mocks/hasher.go ./users/mocks/hasher.go.tmp | |
mv ./users/mocks/emailer.go ./users/mocks/emailer.go.tmp | |
mv ./users/mocks/repository.go ./users/mocks/repository.go.tmp | |
mv ./users/mocks/service.go ./users/mocks/service.go.tmp | |
mv ./journal/mocks/repository.go ./journal/mocks/repository.go.tmp | |
mv ./journal/mocks/service.go ./journal/mocks/service.go.tmp | |
mv ./consumers/notifiers/mocks/notifier.go ./consumers/notifiers/mocks/notifier.go.tmp | |
mv ./consumers/notifiers/mocks/repository.go ./consumers/notifiers/mocks/repository.go.tmp | |
mv ./consumers/notifiers/mocks/service.go ./consumers/notifiers/mocks/service.go.tmp | |
mv ./certs/mocks/pki.go ./certs/mocks/pki.go.tmp | |
mv ./certs/mocks/service.go ./certs/mocks/service.go.tmp | |
mv ./provision/mocks/service.go ./provision/mocks/service.go.tmp | |
mv ./clients/private/mocks/service.go ./clients/private/mocks/service.go.tmp | |
mv ./clients/mocks/repository.go ./clients/mocks/repository.go.tmp | |
mv ./clients/mocks/clients_client.go ./clients/mocks/clients_client.go.tmp | |
mv ./clients/mocks/cache.go ./clients/mocks/cache.go.tmp | |
mv ./clients/mocks/service.go ./clients/mocks/service.go.tmp | |
mv ./mqtt/mocks/events.go ./mqtt/mocks/events.go.tmp | |
mv ./readers/mocks/messages.go ./readers/mocks/messages.go.tmp | |
mv ./pkg/sdk/mocks/sdk.go ./pkg/sdk/mocks/sdk.go.tmp | |
mv ./pkg/messaging/mocks/pubsub.go ./pkg/messaging/mocks/pubsub.go.tmp | |
mv ./pkg/authn/mocks/authn.go ./pkg/authn/mocks/authn.go.tmp | |
mv ./pkg/roles/mocks/rolesRepo.go ./pkg/roles/mocks/rolesRepo.go.tmp | |
mv ./pkg/roles/mocks/provisioner.go ./pkg/roles/mocks/provisioner.go.tmp | |
mv ./pkg/roles/mocks/rolemanager.go ./pkg/roles/mocks/rolemanager.go.tmp | |
mv ./pkg/oauth2/mocks/provider.go ./pkg/oauth2/mocks/provider.go.tmp | |
mv ./pkg/authz/mocks/authz.go ./pkg/authz/mocks/authz.go.tmp | |
mv ./pkg/events/mocks/subscriber.go ./pkg/events/mocks/subscriber.go.tmp | |
mv ./pkg/events/mocks/publisher.go ./pkg/events/mocks/publisher.go.tmp | |
mv ./pkg/policies/mocks/evaluator.go ./pkg/policies/mocks/evaluator.go.tmp | |
mv ./pkg/policies/mocks/service.go ./pkg/policies/mocks/service.go.tmp | |
make mocks | |
check_mock_changes() { | |
local file_path=$1 | |
local tmp_file_path=$1.tmp | |
local entity_name=$2 | |
if ! cmp -s "$file_path" "$tmp_file_path"; then | |
echo "Error: Generated mocks for $entity_name are out of sync!" | |
echo "Please run 'make mocks' with mockery version $MOCKERY_VERSION and commit the changes." | |
exit 1 | |
fi | |
} | |
check_mock_changes ./invitations/mocks/repository.go " ./invitations/mocks/repository.go" | |
check_mock_changes ./invitations/mocks/service.go " ./invitations/mocks/service.go" | |
check_mock_changes ./auth/mocks/token_client.go " ./auth/mocks/token_client.go" | |
check_mock_changes ./auth/mocks/authz.go " ./auth/mocks/authz.go" | |
check_mock_changes ./auth/mocks/keys.go " ./auth/mocks/keys.go" | |
check_mock_changes ./auth/mocks/service.go " ./auth/mocks/service.go" | |
check_mock_changes ./bootstrap/mocks/configs.go " ./bootstrap/mocks/configs.go" | |
check_mock_changes ./bootstrap/mocks/config_reader.go " ./bootstrap/mocks/config_reader.go" | |
check_mock_changes ./bootstrap/mocks/service.go " ./bootstrap/mocks/service.go" | |
check_mock_changes ./domains/mocks/domains_client.go " ./domains/mocks/domains_client.go" | |
check_mock_changes ./domains/mocks/repository.go " ./domains/mocks/repository.go" | |
check_mock_changes ./domains/mocks/service.go " ./domains/mocks/service.go" | |
check_mock_changes ./channels/mocks/repository.go " ./channels/mocks/repository.go" | |
check_mock_changes ./channels/mocks/channels_client.go " ./channels/mocks/channels_client.go" | |
check_mock_changes ./channels/mocks/service.go " ./channels/mocks/service.go" | |
check_mock_changes ./groups/private/mocks/service.go " ./groups/private/mocks/service.go" | |
check_mock_changes ./groups/mocks/repository.go " ./groups/mocks/repository.go" | |
check_mock_changes ./groups/mocks/groups_client.go " ./groups/mocks/groups_client.go" | |
check_mock_changes ./groups/mocks/service.go " ./groups/mocks/service.go" | |
check_mock_changes ./users/mocks/hasher.go " ./users/mocks/hasher.go" | |
check_mock_changes ./users/mocks/emailer.go " ./users/mocks/emailer.go" | |
check_mock_changes ./users/mocks/repository.go " ./users/mocks/repository.go" | |
check_mock_changes ./users/mocks/service.go " ./users/mocks/service.go" | |
check_mock_changes ./journal/mocks/repository.go " ./journal/mocks/repository.go" | |
check_mock_changes ./journal/mocks/service.go " ./journal/mocks/service.go" | |
check_mock_changes ./consumers/notifiers/mocks/notifier.go " ./consumers/notifiers/mocks/notifier.go" | |
check_mock_changes ./consumers/notifiers/mocks/repository.go " ./consumers/notifiers/mocks/repository.go" | |
check_mock_changes ./consumers/notifiers/mocks/service.go " ./consumers/notifiers/mocks/service.go" | |
check_mock_changes ./certs/mocks/pki.go " ./certs/mocks/pki.go" | |
check_mock_changes ./certs/mocks/service.go " ./certs/mocks/service.go" | |
check_mock_changes ./provision/mocks/service.go " ./provision/mocks/service.go" | |
check_mock_changes ./clients/private/mocks/service.go " ./clients/private/mocks/service.go" | |
check_mock_changes ./clients/mocks/repository.go " ./clients/mocks/repository.go" | |
check_mock_changes ./clients/mocks/clients_client.go " ./clients/mocks/clients_client.go" | |
check_mock_changes ./clients/mocks/cache.go " ./clients/mocks/cache.go" | |
check_mock_changes ./clients/mocks/service.go " ./clients/mocks/service.go" | |
check_mock_changes ./mqtt/mocks/events.go " ./mqtt/mocks/events.go" | |
check_mock_changes ./readers/mocks/messages.go " ./readers/mocks/messages.go" | |
check_mock_changes ./pkg/sdk/mocks/sdk.go " ./pkg/sdk/mocks/sdk.go" | |
check_mock_changes ./pkg/messaging/mocks/pubsub.go " ./pkg/messaging/mocks/pubsub.go" | |
check_mock_changes ./pkg/authn/mocks/authn.go " ./pkg/authn/mocks/authn.go" | |
check_mock_changes ./pkg/roles/mocks/rolesRepo.go " ./pkg/roles/mocks/rolesRepo.go" | |
check_mock_changes ./pkg/roles/mocks/provisioner.go " ./pkg/roles/mocks/provisioner.go" | |
check_mock_changes ./pkg/roles/mocks/rolemanager.go " ./pkg/roles/mocks/rolemanager.go" | |
check_mock_changes ./pkg/oauth2/mocks/provider.go " ./pkg/oauth2/mocks/provider.go" | |
check_mock_changes ./pkg/authz/mocks/authz.go " ./pkg/authz/mocks/authz.go" | |
check_mock_changes ./pkg/events/mocks/subscriber.go " ./pkg/events/mocks/subscriber.go" | |
check_mock_changes ./pkg/events/mocks/publisher.go " ./pkg/events/mocks/publisher.go" | |
check_mock_changes ./pkg/policies/mocks/evaluator.go " ./pkg/policies/mocks/evaluator.go" | |
check_mock_changes ./pkg/policies/mocks/service.go " ./pkg/policies/mocks/service.go" |