Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.23.0"
go-version: "1.25.0"
- name: Install gofumpt
run: go install mvdan.cc/gofumpt@latest
run: go install mvdan.cc/gofumpt@v0.7.0
- name: Run gofumpt
run: gofumpt -l -w .
- name: make verification
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ go.work

.vscode/
config.toml
CLAUDE.md

# build
pb
Expand Down
61 changes: 41 additions & 20 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,49 @@
version: "2"

linters:
disable-all: true
default: none
enable:
- typecheck
- goimports
- misspell
- govet
- revive
- ineffassign
- gomodguard
- gofmt
- unused

linters-settings:
golint:
min-confidence: 0

misspell:
locale: US

issues:
exclude-use-default: false
exclude:
- instead of using struct literal
- should have a package comment
- should have comment or be unexported
- time-naming
- error strings should not be capitalized or end with punctuation or a newline
- staticcheck
settings:
staticcheck:
checks:
- "all"
- "-ST1000"
- "-ST1003"
- "-ST1005"
- "-ST1016"
- "-ST1020"
- "-ST1021"
- "-ST1022"
- "-ST1023"
misspell:
locale: US
exclusions:
presets: []
rules:
- text: "instead of using struct literal"
linters:
- revive
Comment thread
pratik50 marked this conversation as resolved.
- text: "should have a package comment"
linters:
- revive
- text: "should have comment or be unexported"
linters:
- revive
- text: "time-naming"
linters:
- revive
Comment thread
pratik50 marked this conversation as resolved.
- text: "error strings should not be capitalized or end with punctuation or a newline"
linters:
- revive

formatters:
enable:
- gofmt
- goimports
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
PWD := $(shell pwd)
GOPATH := $(shell go env GOPATH)
VERSION ?= $(shell git describe --tags)
# This is just for development purposes. The version is determined at build time using git tags.
VERSION ?= $(shell git describe --tags 2>/dev/null || echo "dev")
TAG ?= "parseablehq/pb:$(VERSION)"
LDFLAGS := $(shell go run buildscripts/gen-ldflags.go $(VERSION))

GOARCH := $(shell go env GOARCH)
GOOS := $(shell go env GOOS)
GO111MODULE=on

GOLANGCI_LINT_VERSION := v2.11.4

all: build

Expand All @@ -15,11 +17,9 @@ checks:
@(env bash $(PWD)/buildscripts/checkdeps.sh)

getdeps:
@GO111MODULE=on
@mkdir -p ${GOPATH}/bin
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin
@echo "Installing stringer" && go install -v golang.org/x/tools/cmd/stringer@latest
@echo "Installing staticheck" && go install honnef.co/go/tools/cmd/staticcheck@latest
@echo "Installing golangci-lint $(GOLANGCI_LINT_VERSION)"
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin $(GOLANGCI_LINT_VERSION)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

The curl | sh pipeline can succeed even if curl fails (because the shell returns the status of the last command in the pipeline). This can lead to silently missing golangci-lint installs. Consider avoiding the pipeline (download then execute), or ensure pipefail is enabled so failures propagate; also consider pinning the install script to a specific tag/commit instead of master to reduce supply-chain risk.

Suggested change
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin $(GOLANGCI_LINT_VERSION)
@tmpfile=$$(mktemp); trap 'rm -f "$$tmpfile"' EXIT; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/$(GOLANGCI_LINT_VERSION)/install.sh -o "$$tmpfile" && \
sh "$$tmpfile" -b $(GOPATH)/bin $(GOLANGCI_LINT_VERSION)

Copilot uses AI. Check for mistakes.

crosscompile:
@(env bash $(PWD)/buildscripts/cross-compile.sh)
Expand All @@ -31,17 +31,16 @@ docker: build

vet:
@echo "Running $@"
@GO111MODULE=on go vet $(PWD)/...
@go vet $(PWD)/...

lint:
@echo "Running $@ check"
@GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=5m --config ./.golangci.yml
@GO111MODULE=on ${GOPATH}/bin/staticcheck -tests=false -checks="all,-ST1000,-ST1003,-ST1016,-ST1020,-ST1021,-ST1022,-ST1023,-ST1005" ./...
@${GOPATH}/bin/golangci-lint run --timeout=5m --config ./.golangci.yml

# Builds pb locally.
build: checks
@echo "Building pb binary to './pb'"
@GO111MODULE=on CGO_ENABLED=0 go build -trimpath -tags kqueue --ldflags "$(LDFLAGS)" -o $(PWD)/pb
@CGO_ENABLED=0 go build -trimpath -tags kqueue --ldflags "$(LDFLAGS)" -o $(PWD)/pb

# Build pb for all supported platforms.
build-release: verifiers crosscompile
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/checkdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _init() {

## Minimum required versions for build dependencies
GIT_VERSION="1.0"
GO_VERSION="1.13"
GO_VERSION="1.25"
OSX_VERSION="10.8"
KNAME=$(uname -s)
ARCH=$(uname -m)
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module pb

go 1.23.0
go 1.25.0

toolchain go1.23.4
toolchain go1.25.4

require (
github.com/apache/arrow/go/v13 v13.0.0
Expand All @@ -23,6 +23,7 @@ require (
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.16.3
k8s.io/api v0.32.0
k8s.io/apimachinery v0.32.0
k8s.io/client-go v0.32.0
)
Expand Down Expand Up @@ -151,7 +152,6 @@ require (
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/api v0.32.0 // indirect
k8s.io/apiextensions-apiserver v0.31.1 // indirect
k8s.io/apiserver v0.31.1 // indirect
k8s.io/cli-runtime v0.31.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions pkg/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func Apply(h Helm, verbose bool) error {
// RepoUpdate()

// Locate chart path
cp, err := client.ChartPathOptions.LocateChart(fmt.Sprintf("%s/%s", h.RepoName, h.ChartName), settings)
cp, err := client.LocateChart(fmt.Sprintf("%s/%s", h.RepoName, h.ChartName), settings)
if err != nil {
return err
}
Expand Down Expand Up @@ -318,7 +318,7 @@ func Upgrade(h Helm) error {
// RepoUpdate()

// Locate chart path
cp, err := client.ChartPathOptions.LocateChart(fmt.Sprintf("%s/%s", h.RepoName, h.ChartName), settings)
cp, err := client.LocateChart(fmt.Sprintf("%s/%s", h.RepoName, h.ChartName), settings)
if err != nil {
return err
}
Expand Down
9 changes: 5 additions & 4 deletions pkg/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,14 @@ func promptNamespaceAndCredentials() (*ParseableInfo, error) {
// applyParseableSecret creates and applies the Kubernetes secret
func applyParseableSecret(ps *ParseableInfo, store ObjectStore, objectStoreConfig ObjectStoreConfig) error {
var secretManifest string
if store == LocalStore {
switch store {
case LocalStore:
secretManifest = getParseableSecretLocal(ps)
} else if store == S3Store {
case S3Store:
secretManifest = getParseableSecretS3(ps, objectStoreConfig)
} else if store == BlobStore {
case BlobStore:
secretManifest = getParseableSecretBlob(ps, objectStoreConfig)
} else if store == GcsStore {
case GcsStore:
secretManifest = getParseableSecretGcs(ps, objectStoreConfig)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

applyParseableSecret can call applyManifest with an empty secretManifest when store has an unexpected value (no default case). Returning an explicit error in a default branch would prevent applying an empty/invalid manifest and make failures clearer to users.

Suggested change
secretManifest = getParseableSecretGcs(ps, objectStoreConfig)
secretManifest = getParseableSecretGcs(ps, objectStoreConfig)
default:
return fmt.Errorf("unsupported object store: %v", store)

Copilot uses AI. Check for mistakes.
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/iterator/iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestIteratorConstruct(t *testing.T) {
iter := NewQueryIterator(scenario.StartTime(), scenario.EndTime(), true, scenario.QueryRunnerFunc(), scenario.HasDataFunc())

currentWindow := iter.windows[0]
if !(currentWindow.time == scenario.StartTime()) {
if currentWindow.time != scenario.StartTime() {
t.Fatalf("window time does not match start, expected %s, actual %s", scenario.StartTime().String(), currentWindow.time.String())
}
}
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestIteratorDescending(t *testing.T) {

func checkCurrentWindowIndex(expectedValue string, currentWindow MinuteCheckPoint, t *testing.T) {
expectedTime, _ := time.Parse(time.RFC822Z, expectedValue)
if !(currentWindow.time == expectedTime) {
if currentWindow.time != expectedTime {
t.Fatalf("window time does not match start, expected %s, actual %s", expectedTime.String(), currentWindow.time.String())
}
}
2 changes: 1 addition & 1 deletion pkg/model/role/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (m *Model) Valid() bool {
case "admin", "editor", "none":
return true
case "writer", "reader", "ingestor":
return !(strings.Contains(m.Stream.Value(), " ") || m.Stream.Value() == "")
return !strings.Contains(m.Stream.Value(), " ") && m.Stream.Value() != ""
}
return true
}
Expand Down
Loading