diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea782..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d6..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 000000000..0bafafd89 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,13 @@ +Raystack takes the security of our software products and services seriously. + +If you believe you have found a security vulnerability in this project, you can report it to us directly using [private vulnerability reporting][]. + +- Include a description of your investigation of the this project's codebase and why you believe an exploit is possible. +- POCs and links to code are greatly encouraged. +- Such reports are not eligible for a bounty reward. + +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** + +Thanks for helping make GitHub safe for everyone. + +[private vulnerability reporting]: https://github.com/raystack/meteor/security/advisories diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb30af711..8bcaf8de2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,9 @@ jobs: fetch-depth: 0 - run: git fetch --force --tags - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: "stable" - cache: true + go-version-file: "go.mod" - name: Get release tag id: get_version uses: battila7/get-version-action@v2 @@ -29,16 +28,3 @@ jobs: distribution: goreleaser version: ~v2 args: --snapshot --clean - - name: Login to GitHub Packages Docker Registry - uses: docker/login-action@v1 - with: - registry: docker.pkg.github.com - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push Images - run: docker push docker.io/raystack/meteor:latest diff --git a/.github/workflows/build_dev.yml b/.github/workflows/build_dev.yml deleted file mode 100644 index 4a9ab3fdc..000000000 --- a/.github/workflows/build_dev.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Dev - -on: workflow_dispatch - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - file: "./Dockerfile.dev" - tags: | - raystack/meteor:dev diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 51544a831..589dfe116 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,4 @@ -name: docs - +name: Docs on: push: branches: @@ -11,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions/setup-node@v2 - name: Installation uses: bahmutov/npm-install@v1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 030ff109f..44d45a239 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,25 +1,30 @@ -name: lint - +name: Lint on: push: - branches: - - main + paths: + - "**.go" + - go.mod + - go.sum pull_request: + paths: + - "**.go" + - go.mod + - go.sum jobs: lint: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: "1.20" - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Run linter - uses: golangci/golangci-lint-action@v3 + go-version-file: "go.mod" + + - name: Run checks + uses: golangci/golangci-lint-action@v6 with: - version: v1.53 + version: v1.60 args: --timeout=5m diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 79c1696ee..0cce2c9bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,4 @@ -name: release - +name: Release on: push: tags: @@ -18,8 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "stable" - cache: true + go-version-file: "go.mod" - name: Login to DockerHub uses: docker/login-action@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bd6180af..581d4a305 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,4 @@ name: Test - on: push: pull_request: @@ -10,12 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: '1.20' - cache: true + go-version-file: "go.mod" - name: Install dependencies run: sudo apt-get install build-essential - name: Run Test @@ -32,12 +30,12 @@ jobs: plugins: ${{ steps.set-matrix.outputs.plugins }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - id: set-matrix run: | echo "plugins=$(find plugins -mindepth 2 -maxdepth 2 -type d | sed 's/plugins\///' | awk 'BEGIN{printf "["} {printf "%s\"%s\"",sep,$0; sep=","} END{print ",\".\"]"}')" >> $GITHUB_OUTPUT - plugins-test: + plugins: needs: pretest runs-on: ubuntu-latest if: | @@ -49,12 +47,11 @@ jobs: plugins: ${{ fromJson(needs.pretest.outputs.plugins) }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: '1.20' - cache: true + go-version-file: "go.mod" - name: Install dependencies run: sudo apt-get install build-essential - name: Run Test @@ -67,15 +64,14 @@ jobs: coverage: runs-on: ubuntu-latest - needs: [test, plugins-test] + needs: [test, plugins] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: '1.20' - cache: true + go-version-file: "go.mod" - name: Download coverage uses: actions/download-artifact@v3 with: @@ -89,4 +85,4 @@ jobs: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | go install github.com/mattn/goveralls@v0.0.11 - goveralls -coverprofile=$(ls -1 coverage*.out | paste -sd "," -) -service=github \ No newline at end of file + goveralls -coverprofile=$(ls -1 coverage*.out | paste -sd "," -) -service=github diff --git a/.goreleaser.yml b/.goreleaser.yml index d26b938a9..bb119fd5b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,16 +11,13 @@ before: - make clean changelog: + use: github sort: asc filters: - exclude: - - "^docs:" - - "^test:" - - "^build:" + exclude: ["^docs:", "^test:", "^build:", "^refactor:", "^style:", "^chore:"] builds: - main: ./main.go - id: "linux" binary: meteor flags: [-a] ldflags: @@ -28,16 +25,12 @@ builds: - -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}} - -X github.com/raystack/meteor/cmd.BuildDate={{.Date}} goos: ["linux", "windows", "darwin"] - goarch: [amd64, arm64] # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library + goarch: [amd64, arm64] # Skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library env: - CGO_ENABLED=0 - ignore: # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library - - goos: linux - goarch: 386 + ignore: - goos: linux goarch: arm - - goos: windows - goarch: 386 - goos: windows goarch: arm @@ -51,7 +44,7 @@ checksum: name_template: "checksums.txt" snapshot: - name_template: "{{ .Tag }}-next" + version_template: "{{ .Tag }}-next" dockers: - goos: linux @@ -69,10 +62,7 @@ nfpms: description: "Metadata collection tool." homepage: https://github.com/raystack/meteor license: Apache 2.0 - formats: - - deb - - rpm - - apk + formats: [deb, rpm, apk] scoops: - homepage: "https://github.com/raystack/meteor" diff --git a/Makefile b/Makefile index 6afef54db..021429971 100755 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ NAME="github.com/raystack/meteor" VERSION=$(shell git describe --always --tags 2>/dev/null) COVERFILE="/tmp/app.coverprofile" -PROTON_COMMIT := "42b77358cbb68335607e99794f729e4a558974a5" +PROTON_COMMIT := "ae895e033f71df187c62d7cf9431a2e259ddd423" .PHONY: all build clean test all: build @@ -28,20 +28,20 @@ test-plugins: @echo " > Testing plugins with tag 'plugins'" go test $(if $(filter .,$(PLUGIN)),./plugins,$(if $(PLUGIN),./plugins/$(PLUGIN)/...,./plugins/...)) -tags=plugins -coverprofile=coverage-plugins$(subst .,root,$(subst /,-,$(if $(PLUGIN),-$(PLUGIN),))).out -parallel=1 -test-coverage: # test test-plugins +test-coverage: cp coverage.out coverage-all.out tail -n +2 coverage-plugins.out >> coverage-all.out go tool cover -html=coverage-all.out -generate-proto: ## regenerate protos +generate-proto: @echo " > cloning protobuf from raystack/proton" @echo " > generating protobuf" @buf generate --template buf.gen.yaml https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --path raystack/assets/v1beta2 @echo " > protobuf compilation finished" -lint: ## Lint with golangci-lint +lint: golangci-lint run -install: ## install required dependencies +install: @echo "> installing dependencies" go install github.com/vektra/mockery/v2@v2.14.0 diff --git a/buf.gen.yaml b/buf.gen.yaml index 160225c80..d406c83be 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -1,5 +1,5 @@ -version: v1 +version: v2 plugins: - - name: go + - remote: buf.build/protocolbuffers/go:v1.31.0 out: models opt: paths=source_relative diff --git a/cmd/info.go b/cmd/info.go index fbbeca590..7f1b2d826 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -161,7 +161,7 @@ func InfoProccCmd() *cobra.Command { func inform(typ string, summary string, err error) error { if err != nil { - fmt.Println(term.Redf("ERROR:"), term.Redf(err.Error())) + fmt.Println(term.Redf("ERROR: %s", err.Error())) fmt.Println(term.Bluef("\nUse 'meteor list %s' for the list of supported %s.", typ, typ)) return nil } diff --git a/cmd/run.go b/cmd/run.go index 6378cee95..1a5a21d12 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -120,10 +120,10 @@ func RunCmd() *cobra.Command { if run.Error != nil { lg.Error(run.Error.Error(), "recipe", run.Recipe.Name) failures++ - row = append(row, term.FailureIcon(), run.Recipe.Name, term.Grey(run.Recipe.Source.Name), term.Greyf("%v ms", strconv.Itoa(run.DurationInMs)), term.Greyf(strconv.Itoa(run.RecordCount))) + row = append(row, term.FailureIcon(), run.Recipe.Name, term.Grey(run.Recipe.Source.Name), term.Greyf("%v ms", strconv.Itoa(run.DurationInMs)), term.Greyf("%s", strconv.Itoa(run.RecordCount))) } else { success++ - row = append(row, term.SuccessIcon(), run.Recipe.Name, term.Grey(run.Recipe.Source.Name), term.Greyf("%v ms", strconv.Itoa(run.DurationInMs)), term.Greyf(strconv.Itoa(run.RecordCount))) + row = append(row, term.SuccessIcon(), run.Recipe.Name, term.Grey(run.Recipe.Source.Name), term.Greyf("%v ms", strconv.Itoa(run.DurationInMs)), term.Greyf("%s", strconv.Itoa(run.RecordCount))) } report = append(report, row) if err = bar.Add(1); err != nil { diff --git a/models/raystack/assets/v1beta2/application.pb.go b/models/raystack/assets/v1beta2/application.pb.go index 4a96ae697..2993d5882 100644 --- a/models/raystack/assets/v1beta2/application.pb.go +++ b/models/raystack/assets/v1beta2/application.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/application.proto diff --git a/models/raystack/assets/v1beta2/asset.pb.go b/models/raystack/assets/v1beta2/asset.pb.go index 31d8becb6..973ec24ab 100644 --- a/models/raystack/assets/v1beta2/asset.pb.go +++ b/models/raystack/assets/v1beta2/asset.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/asset.proto diff --git a/models/raystack/assets/v1beta2/bucket.pb.go b/models/raystack/assets/v1beta2/bucket.pb.go index 8620025b8..a9dfe0808 100644 --- a/models/raystack/assets/v1beta2/bucket.pb.go +++ b/models/raystack/assets/v1beta2/bucket.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/bucket.proto diff --git a/models/raystack/assets/v1beta2/common.pb.go b/models/raystack/assets/v1beta2/common.pb.go index f674c51bd..2f67a87aa 100644 --- a/models/raystack/assets/v1beta2/common.pb.go +++ b/models/raystack/assets/v1beta2/common.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/common.proto diff --git a/models/raystack/assets/v1beta2/dashboard.pb.go b/models/raystack/assets/v1beta2/dashboard.pb.go index cad46f8af..27bdb9863 100644 --- a/models/raystack/assets/v1beta2/dashboard.pb.go +++ b/models/raystack/assets/v1beta2/dashboard.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/dashboard.proto diff --git a/models/raystack/assets/v1beta2/experiment.pb.go b/models/raystack/assets/v1beta2/experiment.pb.go index 5910951e4..a38b5fa15 100644 --- a/models/raystack/assets/v1beta2/experiment.pb.go +++ b/models/raystack/assets/v1beta2/experiment.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/experiment.proto diff --git a/models/raystack/assets/v1beta2/feature_table.pb.go b/models/raystack/assets/v1beta2/feature_table.pb.go index 2df0ffac1..a85507001 100644 --- a/models/raystack/assets/v1beta2/feature_table.pb.go +++ b/models/raystack/assets/v1beta2/feature_table.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/feature_table.proto diff --git a/models/raystack/assets/v1beta2/group.pb.go b/models/raystack/assets/v1beta2/group.pb.go index 25df06458..4c02e8d7f 100644 --- a/models/raystack/assets/v1beta2/group.pb.go +++ b/models/raystack/assets/v1beta2/group.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/group.proto diff --git a/models/raystack/assets/v1beta2/job.pb.go b/models/raystack/assets/v1beta2/job.pb.go index e1e9f4dd4..4157c5836 100644 --- a/models/raystack/assets/v1beta2/job.pb.go +++ b/models/raystack/assets/v1beta2/job.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/job.proto diff --git a/models/raystack/assets/v1beta2/metric.pb.go b/models/raystack/assets/v1beta2/metric.pb.go index ae5dea38d..a66e0d418 100644 --- a/models/raystack/assets/v1beta2/metric.pb.go +++ b/models/raystack/assets/v1beta2/metric.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/metric.proto diff --git a/models/raystack/assets/v1beta2/model.pb.go b/models/raystack/assets/v1beta2/model.pb.go index 5c3f915d9..64062d924 100644 --- a/models/raystack/assets/v1beta2/model.pb.go +++ b/models/raystack/assets/v1beta2/model.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/model.proto diff --git a/models/raystack/assets/v1beta2/table.pb.go b/models/raystack/assets/v1beta2/table.pb.go index 534c93442..bca02cf4a 100644 --- a/models/raystack/assets/v1beta2/table.pb.go +++ b/models/raystack/assets/v1beta2/table.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/table.proto diff --git a/models/raystack/assets/v1beta2/topic.pb.go b/models/raystack/assets/v1beta2/topic.pb.go index ee64f237e..0bdc710e6 100644 --- a/models/raystack/assets/v1beta2/topic.pb.go +++ b/models/raystack/assets/v1beta2/topic.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/topic.proto diff --git a/models/raystack/assets/v1beta2/user.pb.go b/models/raystack/assets/v1beta2/user.pb.go index 964b4fc75..73afbe8a2 100644 --- a/models/raystack/assets/v1beta2/user.pb.go +++ b/models/raystack/assets/v1beta2/user.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: raystack/assets/v1beta2/user.proto