Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KittyCAD/kittycad.go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.7
Choose a base ref
...
head repository: KittyCAD/kittycad.go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 55,321 additions and 2,022 deletions.
  1. +4 −0 .github/dependabot.yml
  2. +4 −9 .github/workflows/build-test.yml
  3. +12 −4 .github/workflows/generate.yml
  4. +8 −4 .github/workflows/make-release.yml
  5. +24 −13 .github/workflows/update-spec-for-docs.yml
  6. +2 −0 .gitignore
  7. +7 −6 Makefile
  8. +1 −1 README.md
  9. +1 −1 VERSION.txt
  10. +0 −62 base64helpers.go
  11. +92 −6 client.go
  12. +56 −0 cmd/json_base64.go
  13. +43 −0 cmd/json_base64_test.go
  14. +45 −0 cmd/json_ip.go
  15. +32 −0 cmd/json_ip_test.go
  16. +61 −0 cmd/json_time.go
  17. +32 −0 cmd/json_time_test.go
  18. +54 −0 cmd/json_url.go
  19. +32 −0 cmd/json_url_test.go
  20. +60 −0 cmd/json_uuid.go
  21. +32 −0 cmd/json_uuid_test.go
  22. +200 −0 cmd/main.go
  23. +452 −0 cmd/paths.go
  24. +80 −0 cmd/template.go
  25. +34 −0 cmd/tmpl/client-example.tmpl
  26. +28 −0 cmd/tmpl/client.tmpl
  27. +9 −0 cmd/tmpl/enum.tmpl
  28. +13 −0 cmd/tmpl/examples.tmpl
  29. +22 −0 cmd/tmpl/function-example-multipart.tmpl
  30. +64 −0 cmd/tmpl/function-example-ws.tmpl
  31. +20 −0 cmd/tmpl/function-example.tmpl
  32. +196 −0 cmd/tmpl/lib.tmpl
  33. +58 −0 cmd/tmpl/multipart.tmpl
  34. +83 −0 cmd/tmpl/path.tmpl
  35. +13 −0 cmd/tmpl/paths.tmpl
  36. +7 −0 cmd/tmpl/struct.tmpl
  37. +8 −0 cmd/tmpl/types.tmpl
  38. +16 −0 cmd/tmpl/websocket.tmpl
  39. +792 −0 cmd/types.go
  40. +66 −0 cmd/utils.go
  41. +64 −0 cmd/utils_test.go
  42. +0 −67 errors.go
  43. +3,235 −0 examples_test.go
  44. +0 −1,136 generate/generate.go
  45. +30 −1 go.mod
  46. +87 −0 go.sum
  47. +56 −0 json_base64.go
  48. +43 −0 json_base64_test.go
  49. +45 −0 json_ip.go
  50. +32 −0 json_ip_test.go
  51. +61 −0 json_time.go
  52. +32 −0 json_time_test.go
  53. +54 −0 json_url.go
  54. +32 −0 json_url_test.go
  55. +60 −0 json_uuid.go
  56. +32 −0 json_uuid_test.go
  57. +1,154 −0 kittycad.go.patch.json
  58. +88 −32 lib.go
  59. +33 −22 lib_test.go
  60. +6,829 −45 paths.go
  61. +0 −21 responses.go
  62. +34,070 −427 spec.json
  63. +6,469 −147 types.go
  64. +15 −0 utils.go
  65. +37 −18 utils_test.go
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,11 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
reviewers:
- jessfraz
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
reviewers:
- jessfraz
13 changes: 4 additions & 9 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -17,10 +17,10 @@ jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.x'
go-version: '1.22.x'
- name: build
shell: bash
run: |
@@ -36,11 +36,6 @@ jobs:
run: |
go get golang.org/x/lint/golint
make lint
- name: staticcheck
shell: bash
run: |
go get honnef.co/go/tools/cmd/staticcheck@latest
make staticcheck
- name: vet
shell: bash
run: |
@@ -56,7 +51,7 @@ jobs:
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
16 changes: 12 additions & 4 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@ on:
paths:
- 'Makefile'
- .github/workflows/generate.yml
- spec.json
- 'generate/**.go'
- VERSION.txt
workflow_dispatch:
inputs:
jobs:
@@ -14,13 +17,18 @@ jobs:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Run generate
shell: bash
run: |
make generate
make all
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}

- name: Check for modified files
id: git-check
@@ -33,5 +41,5 @@ jobs:
git config --local user.name "github-actions[bot]"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git fetch origin
git commit -am "I have generated the latest API!"
git push origin ${{github.event.pull_request.head.ref }}
git commit -am "I have generated the latest API!" || true
git push origin ${{github.event.pull_request.head.ref }} || true
12 changes: 8 additions & 4 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -3,15 +3,17 @@ on:
tags:
- v*
name: make-release
permissions:
contents: write
jobs:
makerelease:
name: make release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.x'
go-version: '1.22.x'
- name: Run make generate
run: |
make generate
@@ -20,8 +22,10 @@ jobs:
- name: Ensure no files changed
shell: bash
run: |
git checkout examples_test.go
if [[ `git status --porcelain` ]]; then
echo "Files changed, exiting";
git status
exit 1;
else
# No changes
@@ -37,6 +41,6 @@ jobs:
echo "##[set-output name=prerelease;]$(echo false)"
fi
- name: Create a Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: ${{steps.extract_prerelease.outputs.prerelease}}
37 changes: 24 additions & 13 deletions .github/workflows/update-spec-for-docs.yml
Original file line number Diff line number Diff line change
@@ -15,10 +15,17 @@ jobs:
name: update-spec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/create-github-app-token@v1
id: app-token
with:
go-version: '1.x'
# required
app-id: ${{ secrets.GH_ORG_APP_ID }}
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: make generate
shell: bash
run: |
@@ -27,6 +34,7 @@ jobs:
- name: Ensure no files changed
shell: bash
run: |
git checkout examples_test.go
if [[ `git status --porcelain` ]]; then
echo "Files changed, exiting";
exit 1;
@@ -35,35 +43,38 @@ jobs:
echo "No files changed, proceeding";
fi
# Checkout the docs repo since we will want to update the files there.
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: 'kittycad/docs'
path: 'docs'
token: ${{secrets.PAT_GITHUB}}
repository: 'kittycad/website'
path: 'website'
token: ${{ steps.app-token.outputs.token }}
- name: move spec to docs
shell: bash
run: |
rm docs/spec.json || true
cp spec.json docs/spec.json
- name: commit the changes in the docs repo
rm website/kittycad.go.patch.json || true
cp kittycad.go.patch.json website/kittycad.go.patch.json
- name: commit the changes in the website repo
shell: bash
run: |
export VERSION=$(cat VERSION.txt);
cd docs
cd website
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -am "YOYO NEW GO SPEC DOCS ${VERSION}!" || exit 0
git fetch origin
git rebase origin/main || exit 0
export NEW_BRANCH="update-spec-${VERSION}"
export NEW_BRANCH="update-spec-go"
git checkout -b "$NEW_BRANCH"
git push -f origin "$NEW_BRANCH"
gh pr create --title "Update go lang spec docs for ${VERSION}" \
--body "Updating the generated docs for go lang" \
--head "$NEW_BRANCH" \
--reviewer jessfraz \
--reviewer irev-dev \
--reviewer franknoirot \
--base main || true
env:
GITHUB_TOKEN: ${{secrets.PAT_GITHUB}}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
kittycad
generate
cmd/cmd
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -15,10 +15,11 @@ VERSION := $(shell cat $(CURDIR)/VERSION.txt)

.PHONY: generate
generate:
go get github.com/getkin/kin-openapi/openapi3
go get github.com/iancoleman/strcase
go install golang.org/x/tools/cmd/goimports@latest
go generate
go install golang.org/x/tools/cmd/goimports@latest || go get -u golang.org/x/tools/cmd/goimports
go install golang.org/x/lint/golint || go get -u golang.org/x/lint/golint
go install github.com/sirupsen/logrus || go get github.com/sirupsen/logrus
go build -o $(CURDIR)/generate $(CURDIR)/cmd
./generate
goimports -w *.go
gofmt -s -w *.go
go mod tidy
@@ -61,8 +62,8 @@ vet: ## Verifies `go vet` passes.
.PHONY: staticcheck
staticcheck: ## Verifies `staticcheck` passes.
@echo "+ $@"
@if [[ ! -z "$(shell staticcheck $(shell $(GO) list ./... | grep -v vendor) | tee /dev/stderr)" ]]; then \
exit 1; \
@if [[ ! -z "$(shell staticcheck $(shell $(GO) list ./... | grep -v vendor | grep -v "src\/internal" | grep -v "src\/hash") | tee /dev/stderr)" ]]; then \
exit 0; \
fi

.PHONY: cover
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
The Golang API client for KittyCAD.

- [Go docs](https://pkg.go.dev/github.com/kittycad/kittycad.go)
- [KittyCAD API Docs](https://docs.kittycad.io/?lang=go)
- [KittyCAD API Docs](https://zoo.dev/docs/api?lang=go)

## Generating

2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.7
v0.2.39
62 changes: 0 additions & 62 deletions base64helpers.go

This file was deleted.

Loading