Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ING-916: Remove and ignore the generated OpenAPI file. #206

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,12 @@ jobs:
with:
version: 3.17
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
go install golang.org/x/tools/cmd/goimports@latest
- name: Generate Files
run: |
go generate ./dataapiv1
if [ -n "$(git status --porcelain)" ]; then
echo 'To fix this check, run "go generate ./dataapiv1"'
git status # Show the files that failed to pass the check.
exit 1
fi
go generate ./...
- name: goimports
run: |
goimports -w .
go run golang.org/x/tools/cmd/goimports@latest -w .
find . -name go.mod -execdir go mod tidy \;
if [ -n "$(git status --porcelain)" ]; then
echo 'To fix this check, run "goimports -w . && find . -name go.mod -execdir go mod tidy \;"'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
go install github.com/matryer/moq@latest
- name: Install Dependencies
run: go get ./...
- name: Generate Files
run: |
go generate ./...
- name: Initialize Test Cluster
run: ./.github/bin/init-cluster
- name: Check Test Cluster
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLINT_VERSION)
$(GOBIN)/golangci-lint run

check: fmt lint test
check: generate fmt lint test

build:
generate:
go generate ./...

build: generate
for platform in linux darwin ; do \
for arch in amd64 arm64 ; do \
echo "Building $$platform $$arch binary " ; \
Expand All @@ -56,4 +59,4 @@ dist: image-artifacts
container: build
docker build -f Dockerfile -t ${DOCKER_USER}/cloud-native-gateway:${DOCKER_TAG} .

.PHONY: all test fmt lint check build
.PHONY: all test fmt lint check generate build
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,42 @@ Provides translation capabilities for Protostellar to legacy protocols.
Building the gateway:

```
> go generate ./...
> go build -o stellar-gateway ./cmd/gateway
```

Basic execution which will run generate a self-signed certificate and run against a Couchbase Server instance on localhost:

```
> ./stellar-gateway --self-sign
```

To turn up the log level:

```
> ./stellar-gateway --self-sign --log-level debug
```

To add extra debug information to errors:

```
> ./stellar-gateway --self-sign --debug
```

To execute against a remote Couchbase Server instance:

```
> ./stellar-gateway --self-sign --cb-host 192.168.107.128
```

To execute using an existing certificate (used to connect to the gateway by clients):
To execute using an existing certificate (used to connect to the gateway by clients):

```
> ./stellar-gateway --cert /path/to/cert --key /path/to/key
```

To execute without having to perform a build after every change

```
> go run ./cmd/gateway --self-sign
```
Expand Down
1 change: 1 addition & 0 deletions dataapiv1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spec.gen.go
Loading
Loading