Skip to content

Commit

Permalink
build: v1.0.0 (#203)
Browse files Browse the repository at this point in the history
* unclog release

* unclog build

* update Makefile and add UPGRADING.md

* run pure Go tests with `make test`
  • Loading branch information
melekes authored Sep 20, 2024
1 parent b31daa3 commit 9b8cce9
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changelog/v1.0.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*September 20, 2024*

This release swaps the "default" DB from goleveldb to pebbledb. There's now a
`goleveldb` build flag that must be used when using goleveldb. If you're using
`pebbledb`, you don't need a build flag anymore.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# CHANGELOG

## v1.0.0

*September 20, 2024*

This release swaps the "default" DB from goleveldb to pebbledb. There's now a
`goleveldb` build flag that must be used when using goleveldb. If you're using
`pebbledb`, you don't need a build flag anymore.

### BREAKING

- Add `goleveldb` build flag.
([\#202](https://github.com/cometbft/cometbft-db/pull/202))

## v0.15.0

*September 9, 2024*
Expand Down
35 changes: 23 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,48 @@ endif

all: lint test

### go tests
## By default this will only test memdb & goleveldb
#? test: Run pure Go tests only
test:
@echo "--> Running go test"
@go test $(PACKAGES) -v
@go test $(PACKAGES) -tags goleveldb,boltdb,badgerdb
.PHONY: test

#? test-goleveldb: Run goleveldb tests
test-goleveldb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags goleveldb -v
.PHONY: test-goleveldb

#? test-cleveldb: Run cleveldb tests
test-cleveldb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags cleveldb -v
.PHONY: test-cleveldb

#? test-rocksdb: Run rocksdb tests
test-rocksdb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags rocksdb -v
.PHONY: test-rocksdb

#? test-boltdb: Run boltdb tests
test-boltdb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags boltdb -v
.PHONY: test-boltdb

#? test-badgerdb: Run badgerdb tests
test-badgerdb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags badgerdb -v
.PHONY: test-badgerdb

test-pebble:
#? test-pebbledb: Run pebbledb tests
test-pebbledb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags pebbledb -v

test-all:
@echo "--> Running go test"
@go test $(PACKAGES) -tags cleveldb,boltdb,rocksdb,grocksdb_clean_link,badgerdb,pebbledb -v
.PHONY: test-all
@go test $(PACKAGES) -v

#? test-all-with-coverage: Run all tests with coverage
test-all-with-coverage:
@echo "--> Running go test for all databases, with coverage"
@CGO_ENABLED=1 go test ./... \
Expand All @@ -56,28 +62,31 @@ test-all-with-coverage:
-race \
-coverprofile=coverage.txt \
-covermode=atomic \
-tags=memdb,goleveldb,cleveldb,boltdb,rocksdb,grocksdb_clean_link,badgerdb,pebbledb \
-tags=goleveldb,cleveldb,boltdb,rocksdb,badgerdb\
-v
.PHONY: test-all-with-coverage

#? lint: Run linter
lint:
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
@go mod verify
.PHONY: lint

#? format: Format the code
format:
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs goimports -w
.PHONY: format

#? docker-test-image: Build the Docker test image
docker-test-image:
@echo "--> Building Docker test image"
@cd tools && \
docker build -t $(DOCKER_TEST_IMAGE):$(DOCKER_TEST_IMAGE_VERSION) .
.PHONY: docker-test-image

# Runs the same test as is executed in CI, but locally.
#? docker-test: Run the same test as is executed in CI, but locally.
docker-test:
@echo "--> Running all tests with all databases with Docker (interactive flags: \"$(DOCKER_TEST_INTERACTIVE_FLAGS)\")"
@docker run $(DOCKER_TEST_INTERACTIVE_FLAGS) --rm --name cometbft-db-test \
Expand All @@ -88,10 +97,12 @@ docker-test:
make test-all-with-coverage
.PHONY: docker-test

#? tools: Install tools
tools:
go get -v $(GOTOOLS)
.PHONY: tools

#? vulncheck: Run go vuln check
vulncheck:
@go run golang.org/x/vuln/cmd/govulncheck@latest ./...
.PHONY: vulncheck
10 changes: 10 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Upgrading

## v0.15 -> v1.0

There's now a `goleveldb` build flag that must be used when using goleveldb. If
you're using `pebbledb`, you don't need a build flag anymore.

```sh
go build -tags goleveldb
```
2 changes: 1 addition & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
// - pure go
// - use boltdb build tag (go build -tags boltdb)
BoltDBBackend BackendType = "boltdb"
// RocksDBBackend represents rocksdb (uses github.com/tecbot/gorocksdb)
// RocksDBBackend represents rocksdb (uses https://github.com/linxGnu/grocksdb)
// - requires gcc
// - use rocksdb build tag (go build -tags rocksdb)
RocksDBBackend BackendType = "rocksdb"
Expand Down

0 comments on commit 9b8cce9

Please sign in to comment.