Skip to content

Commit

Permalink
fix: sdk generation
Browse files Browse the repository at this point in the history
* fix: better error handling
* chore: remove old httpclient

Co-authored-by: Patrik <zepatrik@users.noreply.github.com>
  • Loading branch information
2 people authored and aeneasr committed Sep 14, 2022
1 parent 54c00c3 commit acc1546
Show file tree
Hide file tree
Showing 99 changed files with 104 additions and 6,465 deletions.
3 changes: 0 additions & 3 deletions .docker/Dockerfile-build
Expand Up @@ -10,9 +10,6 @@ ADD go.sum go.sum
ADD proto/go.mod proto/go.mod
ADD proto/go.sum proto/go.sum

ADD internal/httpclient-next/go.mod internal/httpclient-next/go.mod
ADD internal/httpclient-next/go.sum internal/httpclient-next/go.sum

ENV CGO_ENABLED 1

RUN go mod download
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
@@ -1,5 +1,4 @@
internal/httpclient/**/* linguist-generated=true
internal/httpclient-next/**/* linguist-generated=true
proto/**/*.pb.go linguist-generated=true
proto/**/*_pb.js linguist-generated=true
proto/**/*_pb.d.ts linguist-generated=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Test Keto
run: |
source scripts/local-dependencies.sh
go-acc --ignore "internal/httpclient,internal/httpclient-next" -o coverage.txt ./... -- -tags sqlite
go-acc --ignore "internal/httpclient" -o coverage.txt ./... -- -tags sqlite
- run: |
source scripts/local-dependencies.sh
goveralls -service=github -coverprofile=coverage.txt
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Expand Up @@ -32,7 +32,7 @@ tools/yq: .bin/gobin/go.mod .bin/gobin/go.sum Makefile

define make-brew-dependency
tools/$(firstword $(subst @, ,$(notdir $1))): tools/brew Makefile
HOMEBREW_NO_AUTO_UPDATE=1 brew install keto/tools/$1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true HOMEBREW_NO_AUTO_UPDATE=1 brew install keto/tools/$1
endef
$(foreach dep, $(BREW_DEPENDENCIES), $(eval $(call make-brew-dependency,$(dep))))

Expand Down Expand Up @@ -67,7 +67,7 @@ docker:
# Generates the SDKs
.PHONY: sdk
sdk: tools/go-swagger tools/cli node_modules
rm -rf internal/httpclient internal/httpclient-next
rm -rf internal/httpclient
swagger generate spec -m -o spec/swagger.json \
-c github.com/ory/keto \
-c github.com/ory/x/healthx \
Expand All @@ -82,18 +82,19 @@ sdk: tools/go-swagger tools/cli node_modules
-p file://.schema/openapi/patches/meta.yaml \
spec/swagger.json spec/api.json

mkdir -p internal/httpclient internal/httpclient-next
swagger generate client -f ./spec/swagger.json -t internal/httpclient -A Ory_Keto
mkdir -p internal/httpclient

npm run openapi-generator-cli -- generate -i "spec/api.json" \
-g go \
-o "internal/httpclient-next" \
-o "internal/httpclient" \
--git-user-id ory \
--git-repo-id keto-client-go \
--git-host github.com \
-t .schema/openapi/templates/go \
-c .schema/openapi/gen.go.yml

rm internal/httpclient/go.{mod,sum}

make format

.PHONY: build
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Expand Up @@ -5,7 +5,6 @@ replace (
github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.14.10
github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1
github.com/ory/keto/internal/httpclient-next => ./internal/httpclient-next
github.com/ory/keto/proto => ./proto
github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.5-0.20210114230657-cdd3331e3e7c
)
Expand All @@ -28,7 +27,6 @@ require (
github.com/ory/graceful v0.1.3
github.com/ory/herodot v0.9.13
github.com/ory/jsonschema/v3 v3.0.7
github.com/ory/keto/internal/httpclient-next v0.0.0-00010101000000-000000000000
github.com/ory/keto/proto v0.0.0-00010101000000-000000000000
github.com/ory/x v0.0.463
github.com/pelletier/go-toml v1.9.5
Expand Down
2 changes: 1 addition & 1 deletion internal/e2e/sdk_client_test.go
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

httpclient "github.com/ory/keto/internal/httpclient-next"
httpclient "github.com/ory/keto/internal/httpclient"
"github.com/ory/keto/internal/x"
"github.com/ory/keto/ketoapi"
)
Expand Down
7 changes: 0 additions & 7 deletions internal/httpclient-next/go.mod

This file was deleted.

13 changes: 0 additions & 13 deletions internal/httpclient-next/go.sum

This file was deleted.

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

0 comments on commit acc1546

Please sign in to comment.