Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4d6b32b
chore: upgrade jackc/pgx from v4 to v5
ravisuhag Mar 27, 2026
9b36aef
chore: upgrade grpc-middleware v1 to v2 and modernize gRPC setup
ravisuhag Mar 27, 2026
11b2a43
chore: upgrade r3labs/diff from v2 to v3
ravisuhag Mar 27, 2026
c705dba
chore: upgrade go-elasticsearch from v7 to v8, remove olivere/elastic
ravisuhag Mar 27, 2026
306d877
chore: upgrade raystack/salt from v0.3 to v0.7
ravisuhag Mar 27, 2026
905cee3
chore: bump all dependency versions to latest
ravisuhag Mar 27, 2026
f82102c
fix: replace deprecated grpc.DialContext and WithBlock with grpc.NewC…
ravisuhag Mar 27, 2026
e99f18b
build: upgrade CI Go version to 1.25 and Elasticsearch to 8.x
ravisuhag Mar 27, 2026
088d69f
build: upgrade CI Go version to 1.26
ravisuhag Mar 27, 2026
816e009
build: use go-version-file instead of hardcoded Go version in CI
ravisuhag Mar 27, 2026
264d39f
chore: fix ci
ravisuhag Mar 27, 2026
7246c9d
chore: optimize CI pipeline and fix JSONB NULL scan error
ravisuhag Mar 27, 2026
5a20ab1
chore: avoid duplicate CI runs on PR branches
ravisuhag Mar 27, 2026
441c374
chore: add concurrency groups to cancel stale CI runs
ravisuhag Mar 27, 2026
ac37120
Revert "chore: add concurrency groups to cancel stale CI runs"
ravisuhag Mar 27, 2026
28abc09
Reapply "chore: add concurrency groups to cancel stale CI runs"
ravisuhag Mar 27, 2026
313492c
chore: remove unnecessary build-essential and add release cache
ravisuhag Mar 27, 2026
21b8dbe
fix: handle NULL JSONB/JSONText scanning and ES 8.x purge compatibility
ravisuhag Mar 27, 2026
9ac0e8f
chore: simplify root config files and fix ES 8.x test purge
ravisuhag Mar 27, 2026
a9c4ae7
fix: exclude system indices from ES test purge for 8.x compatibility
ravisuhag Mar 27, 2026
367e610
fix: list and delete only user indices in ES test purge
ravisuhag Mar 28, 2026
df95c2b
chore: clean up goreleaser config and fix config comment syntax
ravisuhag Mar 28, 2026
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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
.git
.github
.idea
.vscode
.DS_Store
.env
.claude
compass
config.yaml
compass.yaml
temp/
docs/
test/
*.md
coverage.out
dist/
23 changes: 18 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
name: Lint

on: [push]
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "docs/**"
pull_request:
paths-ignore:
- "**.md"
- "docs/**"

concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: "1.20"
go-version-file: "go.mod"
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.1
version: latest
args: --timeout=5m
16 changes: 13 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,27 @@ on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "docs/**"

concurrency:
group: main-${{ github.ref }}
cancel-in-progress: false

jobs:
dev:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.20"
go-version-file: "go.mod"
cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v4
with:
Expand All @@ -29,3 +37,5 @@ jobs:
push: true
file: "./Dockerfile.dev"
tags: raystack/compass:dev
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.20"
go-version-file: "go.mod"
cache: true
- name: Login to DockerHub
uses: docker/login-action@v4
with:
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
name: Test
on: [push, pull_request]
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "docs/**"
pull_request:
paths-ignore:
- "**.md"
- "docs/**"

concurrency:
group: test-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
runs-on: ubuntu-latest
services:
elasticsearch:
image: elasticsearch:7.17.9
image: elasticsearch:8.17.1
ports:
- 9200:9200
env:
discovery.type: single-node
xpack.security.enabled: "false"
ES_JAVA_OPTS: "-Xms128m -Xmx128m"
options: >-
--health-cmd "curl -f http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
ES_TEST_SERVER_URL: "http://localhost:9200"
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.20"
- name: Install dependencies
run: sudo apt-get install build-essential
- name: Install packages
run: go mod tidy
go-version-file: "go.mod"
cache: true
- name: Run Test
run: make test
- name: Install goveralls and send coverage
Expand Down
6 changes: 1 addition & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ builds:
flags: [-a]
ldflags:
- -X github.com/raystack/compass/cli.Version={{.Tag}}
- -X github.com/raystack/compass/cli.BuildCommit={{.FullCommit}}
- -X github.com/raystack/compass/cli.BuildDate={{.Date}}
goos: [linux, darwin, windows]
goarch: [amd64, 386, arm, arm64]
goarch: [amd64, arm64]
env:
- CGO_ENABLED=0

Expand Down Expand Up @@ -70,8 +68,6 @@ brews:
name: homebrew-tap
license: "Apache 2.0"
folder: Formula
dependencies:
- name: git
install: |-
bin.install "compass"
commit_author:
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM alpine:latest

COPY compass /usr/bin/compass
RUN apk update
RUN apk add ca-certificates
RUN apk update && apk add --no-cache ca-certificates && rm -rf /var/cache/apk/*

CMD ["compass"]
ENTRYPOINT ["compass"]
15 changes: 5 additions & 10 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
FROM golang:1.20-alpine3.17 as builder
ARG GO_VERSION=1.25
FROM golang:${GO_VERSION}-alpine3.21 AS builder
RUN apk add make
WORKDIR /build/
COPY . .
RUN make build

FROM alpine:3.17

FROM alpine:3.21
COPY --from=builder /build/compass /usr/bin/compass
RUN apk update
RUN apk add ca-certificates

# glibc compatibility library, since go binaries
# don't work well with musl libc that alpine uses
RUN apk add libc6-compat
RUN apk update && apk add --no-cache ca-certificates libc6-compat && rm -rf /var/cache/apk/*

ENTRYPOINT ["compass"]
ENTRYPOINT ["compass"]
37 changes: 16 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VERSION := "$(shell git describe --tags ${TAG})-next"
BUILD_DIR=dist
PROTON_COMMIT := "409f146"

.PHONY: all build clean test tidy vet proto setup format generat
.PHONY: all build clean test tidy vet proto setup format generate lint install

all: clean test build format lint

Expand All @@ -14,22 +14,22 @@ tidy:
@go mod tidy -v

install:
@echo "Installing Guardian to ${GOBIN}..."
@echo "Installing compass to ${GOBIN}..."
@go install

format:
@echo "Running go fmt..."
@go fmt
@go fmt ./...

lint: ## Lint checker
@echo "Running lint checks using golangci-lint..."
@golangci-lint run

clean: tidy ## Clean the build artifacts
clean: ## Clean the build artifacts
@echo "Cleaning up build directories..."
@rm -rf $coverage.out ${BUILD_DIR}
@rm -rf coverage.out ${BUILD_DIR}

test: ## Run the tests
test: ## Run the tests
go test ./... -race -coverprofile=coverage.out

e2e: ## Run all e2e tests
Expand All @@ -40,21 +40,19 @@ coverage: test ## Print the code coverage
@go tool cover -html=coverage.out

build: ## Build the compass binary
@echo "Building guardian version ${VERSION}..."
@echo "Building compass version ${VERSION}..."
CGO_ENABLED=0 go build -ldflags "-X ${NAME}/cli.Version=${VERSION}"
@echo "Build complete"

buildr: setup
goreleaser --snapshot --skip-publish --rm-dist
buildr: setup ## Build release snapshot
goreleaser release --snapshot --skip=publish --clean


vet:
vet: ## Run go vet
go vet ./...

download:
download: ## Download go modules
@go mod download


generate: ## Run all go generate in the code base
@echo "Running go generate..."
go generate ./...
Expand All @@ -63,20 +61,17 @@ config: ## Generate the sample config file
@echo "Initializing sample server config..."
@cp config/config.yaml config.yaml


proto: ## Generate the protobuf files
@echo "Generating protobuf from raystack/proton"
@echo " [info] make sure correct version of dependencies are installed using 'make install'"
@echo " [info] make sure correct version of dependencies are installed using 'make setup'"
@buf generate https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path raystack/compass -v
@echo "Protobuf compilation finished"

setup: ## Install required dependencies
@echo "> Installing dependencies..."
go mod tidy
go install github.com/vektra/mockery/v2@v2.14.0
go install google.golang.org/protobuf/proto@v1.28.0
go install google.golang.org/grpc@v1.46.0
go install github.com/bufbuild/buf/cmd/buf@v1.4.0
go install github.com/vektra/mockery/v2@latest
go install github.com/bufbuild/buf/cmd/buf@latest
Comment on lines +73 to +74
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

What is the latest stable version of vektra/mockery and bufbuild/buf?

💡 Result:

The latest stable version of vektra/mockery is v3.7.0 (released March 6, 2026). The latest stable version of bufbuild/buf is v1.66.1 (released March 9, 2026).

Citations:


🏁 Script executed:

# Check the Makefile context around lines 73-74
head -80 Makefile | tail -15

Repository: raystack/compass

Length of output: 680


🏁 Script executed:

# Look for go.mod and check if it has any version constraints
find . -name "go.mod" -o -name "go.sum" | head -5

Repository: raystack/compass

Length of output: 77


🏁 Script executed:

# Check test.yml to understand the CI setup mentioned
find . -name "test.yml" -o -name ".github" -type d

Repository: raystack/compass

Length of output: 98


🏁 Script executed:

# Search for any documentation or comments about tool versions
rg -i "mockery|buf.*version" --max-count=20

Repository: raystack/compass

Length of output: 5498


🏁 Script executed:

cat .github/workflows/test.yml

Repository: raystack/compass

Length of output: 1313


🏁 Script executed:

# Check go.mod for mockery/buf references
cat go.mod | head -50

Repository: raystack/compass

Length of output: 1976


🏁 Script executed:

# Search for any comments or documentation about why v2 is used
rg -i "mockery.*v2|mockery.*v3" -B 2 -A 2

Repository: raystack/compass

Length of output: 3855


Pin mockery version to match committed mocks; use caution with buf version selection.

Using @latest for mockery and buf creates version drift between local development and CI. Your CI runs make test without make setup, relying on committed mocks (all generated with mockery v2.20.2). Version inconsistencies between local and committed mocks will cause subtle test failures.

However, the suggested versions need adjustment:

  • Mockery v2.50.0 may generate different mock output than the committed v2.20.2, creating drift. Pin to v2.20.2 to match committed code, or update all committed mocks if upgrading.
  • Mockery v3.7.0 is available but represents a major version change—verify compatibility before adopting.
  • Buf v1.50.0 is reasonable but v1.66.1 is latest in the v1 series.
♻️ Suggested change (conservative approach)
-	go install github.com/vektra/mockery/v2@latest
-	go install github.com/bufbuild/buf/cmd/buf@latest
+	go install github.com/vektra/mockery/v2@v2.20.2
+	go install github.com/bufbuild/buf/cmd/buf@v1.50.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
go install github.com/vektra/mockery/v2@latest
go install github.com/bufbuild/buf/cmd/buf@latest
go install github.com/vektra/mockery/v2@v2.20.2
go install github.com/bufbuild/buf/cmd/buf@v1.50.0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 73 - 74, Pin the installed tool versions in the
Makefile to avoid drift: change the go install lines that currently use
github.com/vektra/mockery/v2@latest and github.com/bufbuild/buf/cmd/buf@latest
to explicit versions—set mockery to v2.20.2 to match the committed mocks (or
update all mocks if you intend to upgrade) and pick a stable buf v1.x release
(e.g., v1.66.1) instead of `@latest` so CI and local environments remain
consistent.


swagger-md:
npx swagger-markdown -i proto/compass.swagger.yaml -o docs/docs/reference/api.md
Expand All @@ -86,9 +81,9 @@ clean-doc:
@rm -rf ./docs/docs/reference/cli.md
@rm -f ./docs/docs/reference/api.md

doc: clean-doc update-swagger-md ## Generate api and cli references
doc: clean-doc swagger-md ## Generate api and cli references
@echo "> generate cli docs"
@go run . reference --plain | sed '1 s,.*,# CLI,' > ./docs/docs/reference/cli.md

help: ## Display this help message
@cat $(MAKEFILE_LIST) | grep -e "^[a-zA-Z_\-]*: *.*## *" | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Loading