From 746f6d3fb07b3365267a6064b34425a6f5582fac Mon Sep 17 00:00:00 2001 From: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:00:49 -0600 Subject: [PATCH 1/2] last pass of cleanup Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> --- .buildkite/pipeline.yaml | 4 ++-- .github/labeler.yml | 3 +++ .gitignore | 2 +- .golangci.yaml | 1 - .goreleaser.yaml | 9 +++++---- README.md | 6 ------ Taskfile.yaml | 6 +++--- atlas.hcl | 1 - cmd/serve.go | 2 +- gen_schema.go | 2 ++ go.mod | 2 +- go.sum | 4 ++-- 12 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 98e95129..e0a92ae6 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -109,7 +109,7 @@ steps: download: "coverage.out" step: "go_test_libsql" - docker#v5.11.0: - image: "sonarsource/sonar-scanner-cli:5" + image: "sonarsource/sonar-scanner-cli:11.0" environment: - "SONAR_TOKEN" - "SONAR_HOST_URL=$SONAR_HOST" @@ -125,7 +125,7 @@ steps: download: coverage.out step: "go_test_libsql" - docker#v5.11.0: - image: "sonarsource/sonar-scanner-cli:5" + image: "sonarsource/sonar-scanner-cli:11.0" environment: - "SONAR_TOKEN" - "SONAR_HOST_URL=$SONAR_HOST" diff --git a/.github/labeler.yml b/.github/labeler.yml index cc55bf2b..00eb09b5 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -7,6 +7,9 @@ enhancement: # Add 'breaking-change' label to any PR where the head branch name starts with `breaking-change` or has a `breaking-change` section in the name breaking-change: - head-branch: ["^breaking-change", "breaking-change"] +# Add 'dependencies' label to any PR where the head branch name starts with `dependencies` or has a `dependencies` section in the name +dependencies: + - head-branch: ["^dependencies", "dependencies", "^deps", "deps"] ci: - changed-files: - any-glob-to-any-file: .github/** diff --git a/.gitignore b/.gitignore index 88aee83e..ef40db5c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ go.work # local dev created files *.db core -core-cli +openlane-cli server.crt server.key private_key.pem diff --git a/.golangci.yaml b/.golangci.yaml index 83ffeead..cb58e454 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -42,7 +42,6 @@ issues: - .buildkite/* - .github/* - docker/* - - pkg/utils/totp/testing/* - internal/ent/generated/* - jsonschema/templates/* exclude-files: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 67243c62..a82c71a6 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,8 +1,9 @@ -project_name: core +project_name: openlane builds: - env: - GO111MODULE=on - CGO_ENABLED=0 + binary: openlane flags: - -trimpath - -tags=netgo @@ -38,7 +39,7 @@ archives: format: zip brews: - homepage: 'https://github.com/theopenlane/core' - description: 'core is the client CLI for interacting with the OL Core Server' + description: 'openlane is the client CLI for interacting with the openlane server' directory: Formula license: 'Apache-2.0' commit_author: @@ -49,7 +50,7 @@ brews: name: homebrew-tap token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" test: | - system "#{bin}/core --help" + system "#{bin}/openlane --help" source: enabled: true changelog: @@ -63,7 +64,7 @@ release: prerelease: auto github: owner: theopenlane - name: core + name: openlane # This section defines how and which artifacts we want to sign for the release. signs: - cmd: cosign diff --git a/README.md b/README.md index 1828a1c4..a1307b05 100644 --- a/README.md +++ b/README.md @@ -56,12 +56,6 @@ We also leverage many secondary technologies in use, including (but not limited 1. [golangci-lint](https://github.com/golangci/golangci-lint) - an annoyingly opinionated linter 1. [buildkite](https://buildkite.com/theopenlane) - our CI system of choice (with github actions providing some intermediary support) -Lastly we're already ourselves using (and plan to support our customers usage in our cloud service) these third party integrations: - -1. [turso/libsql](https://github.com/tursodatabase/libsql) - Turso is an edge-hosted, distributed database that's based on libSQL , an open-source and open-contribution fork of SQLite -1. [posthog](https://posthog.com/) - Product analytics -1. [sendgrid](https://sendgrid.com/en-us) - Transactional email send provider - All of these components are bundled into our respective Docker images; for additional information / instructions, see the [contributing guide](.github/CONTRIBUTING.md) in this repository. We're constantly adding and changing things, but have tried to list all the great open source tools and projects we rely on; if you see your project (or one you use) in here and wish to list it, feel free to open a PR! ## Dependencies diff --git a/Taskfile.yaml b/Taskfile.yaml index 886f031a..f4667568 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -85,9 +85,9 @@ tasks: go:build-cli: aliases: [buildcli] - desc: Runs go build for the core cli + desc: Runs go build for the openlane cli cmds: - - go build -mod=mod -o core-cli ./cmd/cli + - go build -mod=mod -o openlane-cli ./cmd/cli go:all: aliases: [go] @@ -148,7 +148,7 @@ tasks: desc: open a new shell to launch server as a dep cmds: - rm -f core.db - - rm -f core-cli + - rm -f openlane-cli - osascript -e 'tell app "Terminal" to do script "cd {{.PWD}} && task run-dev"' vars: PWD: diff --git a/atlas.hcl b/atlas.hcl index f8abb3ed..481ea78d 100644 --- a/atlas.hcl +++ b/atlas.hcl @@ -1,5 +1,4 @@ variable "cloud_token" { - type = string default = getenv("ATLAS_CLOUD_TOKEN") } diff --git a/cmd/serve.go b/cmd/serve.go index 21d9f30e..7ad32bf3 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -98,7 +98,7 @@ func serve(ctx context.Context) error { serveropts.WithSessionManager(redisClient), ) - // Setup Geodetic client + // Setup DBx client if so.Config.Settings.DBx.Enabled { gc := so.Config.Settings.DBx.NewDefaultClient() diff --git a/gen_schema.go b/gen_schema.go index 680aa512..89e8003e 100644 --- a/gen_schema.go +++ b/gen_schema.go @@ -20,7 +20,9 @@ func main() { if err != nil { log.Fatal(err) } + defer f.Close() + fmtr := formatter.NewFormatter(f) fmtr.FormatSchema(schema) diff --git a/go.mod b/go.mod index aa2024a2..1b2aa01d 100644 --- a/go.mod +++ b/go.mod @@ -71,7 +71,7 @@ require ( golang.org/x/oauth2 v0.22.0 golang.org/x/term v0.23.0 golang.org/x/text v0.17.0 - golang.org/x/tools v0.24.0 + golang.org/x/tools v0.24.1-0.20240830174951-063360f92f43 modernc.org/sqlite v1.32.0 ) diff --git a/go.sum b/go.sum index f36b8932..07ea7e61 100644 --- a/go.sum +++ b/go.sum @@ -701,8 +701,8 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.24.1-0.20240830174951-063360f92f43 h1:1ySJO68IdfJ9yb4S2I9mQpX/7HE9uEcW3HD37G5+4Kg= +golang.org/x/tools v0.24.1-0.20240830174951-063360f92f43/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk= From bbf79a00d180f414db7b957b265246340e84e72f Mon Sep 17 00:00:00 2001 From: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:07:59 -0600 Subject: [PATCH 2/2] put x/tools back Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1b2aa01d..aa2024a2 100644 --- a/go.mod +++ b/go.mod @@ -71,7 +71,7 @@ require ( golang.org/x/oauth2 v0.22.0 golang.org/x/term v0.23.0 golang.org/x/text v0.17.0 - golang.org/x/tools v0.24.1-0.20240830174951-063360f92f43 + golang.org/x/tools v0.24.0 modernc.org/sqlite v1.32.0 ) diff --git a/go.sum b/go.sum index 07ea7e61..f36b8932 100644 --- a/go.sum +++ b/go.sum @@ -701,8 +701,8 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.24.1-0.20240830174951-063360f92f43 h1:1ySJO68IdfJ9yb4S2I9mQpX/7HE9uEcW3HD37G5+4Kg= -golang.org/x/tools v0.24.1-0.20240830174951-063360f92f43/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk=