-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address profile data loss #590
Merged
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
869c7da
fix Makefile
Integralist 10eb994
add new dependencies
Integralist 1bf4ced
retry config read
Integralist 68f83be
update Read docs
Integralist 9ae58d2
add lock around in-mem data access
Integralist e600a05
acquire file lock around read retries
Integralist 7502f50
fix bug in file lock related to file creation
Integralist 2c32435
clarify issue with static fallback
Integralist dd0828c
add file lock to WRITE
Integralist a042fd1
rearrange mutex access
Integralist f190948
use mutex from config package
Integralist 37e0a5e
prevent mutex deadlocks
Integralist c9cc44d
fix up more mutex usage potential problems (even though tests pass)
Integralist cccf699
remove duplicated note
Integralist 5dfaae8
prevent overwriting write error
Integralist 08bad46
switch to RLock for file READ
Integralist f6cd3cd
remove flock
Integralist c253f9e
go mod tidy
Integralist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,11 @@ SHELL := /bin/bash -o pipefail | |
# the output is consistent across environments. | ||
VERSION ?= $(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD) | ||
|
||
# allows for passing additional args to the build e.g. | ||
# make build GO_ARGS='--ldflags "-s -w"' | ||
GO_ARGS ?= "" | ||
# Allows overriding go executable. | ||
GO_BIN ?= go | ||
|
||
# Enables support for tools such as https://github.com/rakyll/gotest | ||
TEST_COMMAND ?= go test | ||
TEST_COMMAND ?= $(GO_BIN) test | ||
|
||
# The compute tests can sometimes exceed the default 10m limit. | ||
TEST_ARGS ?= -timeout 15m ./{cmd,pkg}/... | ||
|
@@ -19,37 +18,36 @@ CLI_ENV ?= "development" | |
|
||
GOHOSTOS ?= $(shell go env GOHOSTOS || echo unknown) | ||
GOHOSTARCH ?= $(shell go env GOHOSTARCH || echo unknown) | ||
|
||
GO_FILES = $(shell find cmd pkg -type f -name '*.go') | ||
GO_FILES = $(shell find cmd pkg -type f -name '*.go') | ||
|
||
# You can pass flags to goreleaser via GORELEASER_ARGS | ||
# --skip-validate will skip the checks | ||
# --rm-dist will save you deleting the dist dir | ||
# --single-target will be quicker and only build for your os & architecture | ||
# e.g. | ||
# make fastly GORELEASER_ARGS="--skip-validate --rm-dist" | ||
fastly: $(GO_FILES) | ||
fastly: dependencies $(GO_FILES) | ||
@GOHOSTOS="${GOHOSTOS}" GOHOSTARCH="${GOHOSTARCH}" goreleaser build ${GORELEASER_ARGS} | ||
|
||
|
||
# useful for attaching a debugger such as https://github.com/go-delve/delve | ||
debug: | ||
@go build -gcflags="all=-N -l" $(GO_ARGS) -o "fastly" ./cmd/fastly | ||
@$(GO_BIN) build -gcflags="all=-N -l" $(GO_ARGS) -o "fastly" ./cmd/fastly | ||
|
||
.PHONY: all | ||
all: dependencies config tidy fmt vet staticcheck gosec test build install | ||
|
||
# update goreleaser inline with the release GHA workflow | ||
.PHONY: dependencies | ||
dependencies: | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
go install github.com/mgechev/revive@latest | ||
go install github.com/goreleaser/[email protected] | ||
$(GO_BIN) install github.com/securego/gosec/v2/cmd/gosec@latest | ||
$(GO_BIN) install honnef.co/go/tools/cmd/staticcheck@latest | ||
$(GO_BIN) install github.com/mgechev/revive@latest | ||
$(GO_BIN) install github.com/goreleaser/[email protected] | ||
|
||
.PHONY: tidy | ||
tidy: | ||
go mod tidy | ||
$(GO_BIN) mod tidy | ||
|
||
.PHONY: fmt | ||
fmt: | ||
|
@@ -58,7 +56,7 @@ fmt: | |
|
||
.PHONY: vet | ||
vet: | ||
go vet ./{cmd,pkg}/... | ||
$(GO_BIN) vet ./{cmd,pkg}/... | ||
|
||
.PHONY: revive | ||
revive: | ||
|
@@ -76,13 +74,16 @@ staticcheck: | |
test: config | ||
@$(TEST_COMMAND) -race $(TEST_ARGS) | ||
|
||
# GO_ARGS allows for passing additional args to the build e.g. | ||
# make build GO_ARGS='--ldflags "-s -w"' | ||
.PHONY: build | ||
build: config | ||
go build $(GO_ARGS) ./cmd/fastly | ||
$(GO_BIN) build $(GO_ARGS) ./cmd/fastly | ||
|
||
# GO_ARGS allows for passing additional args to the build e.g. | ||
.PHONY: install | ||
install: config | ||
go install $(GO_ARGS) ./cmd/fastly | ||
$(GO_BIN) install $(GO_ARGS) ./cmd/fastly | ||
|
||
.PHONY: changelog | ||
changelog: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this lets me validate changes across different versions of
go
.