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..8c49b9b7a 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,4 @@ name: Test - on: push: pull_request: @@ -10,18 +9,17 @@ 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 run: make test - name: Upload coverage artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage path: coverage.out @@ -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,33 +47,31 @@ 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 run: make test-plugins PLUGIN=${{ matrix.plugins }} - name: Upload coverage artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-plugins path: coverage-plugins*.out 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/Makefile b/Makefile index c3cf5ac34..021429971 100755 --- a/Makefile +++ b/Makefile @@ -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