mirror of
https://github.com/hanzoai/notify.git
synced 2026-10-30 15:04:32 +00:00
The module has been github.com/hanzoai/notify since v1.7.0, but the mockery package key and the gci import prefix still named the pre-rename path, so both pointed at a module this repo does not contain. Point them at the real module path. The tenant comment now states what the code does — providers bind their recipient list at construction via AddReceivers — rather than crediting an upstream design. Co-authored-by: Hanzo Dev <[email protected]>
85 lines
2.4 KiB
Makefile
85 lines
2.4 KiB
Makefile
export GO111MODULE := on
|
|
export GOPROXY = https://proxy.golang.org,direct
|
|
|
|
###############################################################################
|
|
# DEPENDENCIES
|
|
###############################################################################
|
|
|
|
# Install all the build and lint dependencies
|
|
tools:
|
|
@go install mvdan.cc/gofumpt@latest
|
|
@go install github.com/daixiang0/gci@latest
|
|
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
@go install github.com/vektra/mockery/[email protected]
|
|
@go install github.com/segmentio/golines@latest
|
|
.PHONY: tools
|
|
|
|
###############################################################################
|
|
# TESTS
|
|
###############################################################################
|
|
|
|
test:
|
|
@go build ./...
|
|
@go test -failfast -race ./...
|
|
.PHONY: test
|
|
|
|
gen-coverage:
|
|
@go test -race -covermode=atomic -coverprofile=coverage.out ./... > /dev/null
|
|
.PHONY: gen-coverage
|
|
|
|
coverage: gen-coverage
|
|
@go tool cover -func coverage.out
|
|
.PHONY: coverage
|
|
|
|
coverage-html: gen-coverage
|
|
@go tool cover -html=coverage.out -o cover.html
|
|
.PHONY: coverage-html
|
|
|
|
mock:
|
|
@mockery
|
|
@rm mock_notifier.go mock_option.go
|
|
.PHONY: mock
|
|
|
|
###############################################################################
|
|
# CODE HEALTH
|
|
###############################################################################
|
|
|
|
fmt:
|
|
@golines --shorten-comments -m 120 -w .
|
|
@gofumpt -w -l .
|
|
@gci write -s standard -s default -s "Prefix(github.com/hanzoai/notify)" .
|
|
.PHONY: fmt
|
|
|
|
lint:
|
|
@golangci-lint run ./...
|
|
.PHONY: lint
|
|
|
|
clean:
|
|
@find . -name "mock_*" -type f -delete
|
|
.PHONY: clean
|
|
|
|
ci: lint test
|
|
.PHONY: ci
|
|
|
|
###############################################################################
|
|
# KMS BOOTSTRAP
|
|
###############################################################################
|
|
|
|
# seed-plivo prompts for the Hanzo Plivo credentials and writes them
|
|
# to kms.hanzo.ai under brand/hanzo/plivo. This is the fleet default
|
|
# every brand falls back to until it sets its own override in the
|
|
# platform UI. Never commit the values — they live ONLY in KMS.
|
|
#
|
|
# KMS_ENDPOINT (required) — e.g. https://kms.hanzo.ai
|
|
# IAM_ENDPOINT (required) — e.g. https://hanzo.id
|
|
# IAM_CLIENT_ID + IAM_CLIENT_SECRET — service account for the seed run
|
|
#
|
|
# Run once at install (or whenever Hanzo rotates its Plivo).
|
|
seed-plivo:
|
|
@./scripts/seed-plivo.sh
|
|
.PHONY: seed-plivo
|
|
|
|
###############################################################################
|
|
|
|
.DEFAULT_GOAL := ci
|