forked from spaceapegames/go-wavefront
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ingestion Policy (New API Updates) (#55)
Bumping the major version of the repository to 2.0.0. Changes to the API broke the old API contract. Old versions of this code no longer work against the currently deployed versions of the server. The ingestion policy response and request payloads were changed (e.g. types of some parameters changed from strings to arrays or maps). * I fixed all IngestionPolicy functions. * Update Ingestion Policy test fixtures. * Created new acceptance tests for IngestionPolicy functions; so, API parity is easier to maintain. * Misc: * Tidy typos, comment clarity and whitespace. * Most notable: I converted a couple multi-line function signatures into one-liners. (Seems to be the more common pattern in the repo and I found them confusing.) * Rebuilt and standardized the GitHub Workflows. * Build against multiple versions, ensure tests are run (to name a few.) * Add a Makefile to help simplify / standardize development in this repository. * Fixed broken helper scripts. * Add `.envrc` to .gitignore (best not to commit this file if you have one.) * Update mods. Signed-off-by: Brendan Winter <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,552 additions
and
192 deletions.
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
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 |
---|---|---|
@@ -1,30 +1,29 @@ | ||
name: golangci-lint | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
- v* | ||
branches: | ||
- master | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: v1.48 | ||
skip-pkg-cache: true | ||
skip-build-cache: true | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# args: --issues-exit-code=0 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: # Required: the version of golangci-lint is required and must be specified without a patch version: | ||
# we always use the latest patch version. | ||
version: v1.52 | ||
# Optional: if set to `true` then the all caching functionality will be complete disabled, | ||
# takes precedence over all other caching options. | ||
skip-cache: true | ||
args: --issues-exit-code=1 | ||
only-new-issues: true |
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 |
---|---|---|
|
@@ -6,3 +6,6 @@ vendor/*/ | |
|
||
# Vim swap files | ||
.*.swp | ||
|
||
# direnv config. | ||
.envrc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
TEST?=$$(go list ./... | grep -v 'vendor') | ||
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor) | ||
|
||
default: build | ||
|
||
build: fmtcheck | ||
go install | ||
|
||
fmt: | ||
@echo "==> Fixing source code with gofmt..." | ||
gofmt -s -w $(GOFMT_FILES) | ||
|
||
fmtcheck: | ||
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" | ||
|
||
lint: | ||
@echo "==> Checking source code against linters..." | ||
golangci-lint run ./... | ||
|
||
test: fmtcheck | ||
go test $(TEST) -v $(TESTARGS) -timeout=120s -short -race | ||
|
||
testacc: fmtcheck | ||
go test $(TEST) -v $(TESTARGS) -timeout=120s -run "TestAcc" | ||
|
||
tidy: | ||
go mod tidy | ||
|
||
vet: | ||
@echo "go vet ." | ||
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \ | ||
echo ""; \ | ||
echo "Vet found suspicious constructs. Please check the reported constructs"; \ | ||
echo "and fix them if necessary before submitting the code for review."; \ | ||
exit 1; \ | ||
fi | ||
|
||
.PHONY: build fmt fmtcheck lint test testacc tidy vet |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.