Skip to content
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

56 dockter 1 #57

Merged
merged 8 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 2 additions & 0 deletions .github/linters/.checkov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
quiet: true
skip-check: CKV_DOCKER_7
47 changes: 47 additions & 0 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
run:
modules-download-mode: readonly
show-stats: true

output:
print-linter-name: false
sort-results: true

linters:
enable:
# List generated from: https://golangci-lint.run/usage/linters/
# We are enabling all defaults as well as any bug/security related
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- durationcheck
- errcheck
- errchkjson
- errorlint
- exhaustive
- exportloopref
- gocheckcompilerdirectives
- gochecksumtype
- gocritic
- gofmt
- gosec
- gosimple
- gosmopolitan
- govet
- ineffassign
- loggercheck
- makezero
- musttag
- nilerr
- noctx
- protogetter
- reassign
- revive
- rowserrcheck
- spancheck
- sqlclosecheck
- staticcheck
- testifylint
- unused
- zerologlint
5 changes: 5 additions & 0 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ignore": [
"**/*.go,**/go-test*.yaml"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/add-labels-standardized.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
secrets:
ORG_MEMBERSHIP_TOKEN: ${{ secrets.ORG_MEMBERSHIP_TOKEN }}
SENZING_MEMBERS: ${{ secrets.SENZING_MEMBERS }}
uses: senzing-factory/build-resources/.github/workflows/add-labels-to-issue.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/add-labels-to-issue.yaml@v2
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project-garage-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
add-to-project-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@v2
with:
project: ${{ vars.SENZING_PROJECT_GARAGE }}
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project-garage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
add-to-project:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/add-to-project.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/add-to-project.yaml@v2
with:
classic: false
project-number: ${{ vars.SENZING_PROJECT_GARAGE }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/dependabot-approve-and-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
pull_request:
branches: [main]

permissions:
contents: write
pull-requests: write

jobs:
dependabot-approve-and-merge:
permissions:
contents: write
pull-requests: write
secrets:
SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN: ${{ secrets.SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@v2
17 changes: 14 additions & 3 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: go test darwin

on: [push]
on: [pull_request, workflow_dispatch]

permissions:
contents: read
Expand All @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
go: ["1.21"]
os: [macos-latest]
os: [macos-13]

steps:
- name: checkout repository
Expand All @@ -26,4 +26,15 @@ jobs:
go-version: ${{ matrix.go }}

- name: run go test
run: go test -v -p 1 ./...
run: go test -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./...

- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: cover.out
path: ./cover.out

coverage:
name: coverage
needs: go-test-darwin
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v2
13 changes: 12 additions & 1 deletion .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,15 @@ jobs:
go-version: ${{ matrix.go }}

- name: run go test
run: go test -v -p 1 ./...
run: go test -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./...

- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: cover.out
path: ./cover.out

coverage:
name: coverage
needs: go-test-linux
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v2
17 changes: 15 additions & 2 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: go test windows

on: [push]
on: [pull_request, workflow_dispatch]

permissions:
contents: read
Expand All @@ -26,4 +26,17 @@ jobs:
go-version: ${{ matrix.go }}

- name: run go test
run: go test -v -p 1 ./...
run: |
go test -v -p 1 -coverprofile=cover -covermode=atomic -coverpkg=./... ./...
cp cover cover.out

- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: cover.out
path: cover.out

coverage:
name: coverage
needs: go-test-windows
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v2
12 changes: 0 additions & 12 deletions .github/workflows/gofmt.yaml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: golangci-lint

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --config=${{ github.workspace }}/.github/linters/.golangci.yml
only-new-issues: false
version: latest
27 changes: 0 additions & 27 deletions .github/workflows/gosec.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ permissions:

jobs:
lint-workflows:
uses: senzing-factory/build-resources/.github/workflows/lint-workflows.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/lint-workflows.yaml@v2
2 changes: 1 addition & 1 deletion .github/workflows/move-pr-to-done-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
move-pr-to-done-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/move-pr-to-done-dependabot.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/move-pr-to-done-dependabot.yaml@v2
with:
project: ${{ vars.SENZING_PROJECT_GARAGE }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ target/

.coverage
python/typedef/__pycache__/
coverage.html
49 changes: 49 additions & 0 deletions .testcoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# (mandatory)
# Path to coverprofile file (output of `go test -coverprofile` command).
#
# For cases where there are many coverage profiles, such as when running
# unit tests and integration tests separately, you can combine all those
# profiles into one. In this case, the profile should have a comma-separated list
# of profile files, e.g., 'cover_unit.out,cover_integration.out'.
profile: cover.out

# (optional; but recommended to set)
# When specified reported file paths will not contain local prefix in the output
local-prefix: "github.com/org/project"

# Holds coverage thresholds percentages, values should be in range [0-100]
threshold:
# (optional; default 0)
# The minimum coverage that each file should have
file: 85

# (optional; default 0)
# The minimum coverage that each package should have
package: 85

# (optional; default 0)
# The minimum total coverage project should have
total: 85
# Holds regexp rules which will override thresholds for matched files or packages
# using their paths.
#
# First rule from this list that matches file or package is going to apply
# new threshold to it. If project has multiple rules that match same path,
# override rules should be listed in order from specific to more general rules.
#override:
# Increase coverage threshold to 100% for `foo` package
# (default is 80, as configured above in this example)
#- threshold: 100
# path: ^pkg/lib/foo$

# Holds regexp rules which will exclude matched files or packages
# from coverage statistics
#exclude:
# Exclude files or packages matching their paths
#paths:
# - \.pb\.go$ # excludes all protobuf generated files
# - ^pkg/bar # exclude package `pkg/bar`

# NOTES:
# - symbol `/` in all path regexps will be replaced by current OS file path separator
# to properly work on Windows
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

-

## [1.4.2] - 2024-05-31

### Changed in 1.4.2

- `NewJson()` is now `NewJSON()`
- Default id prefix changed from `senzing-` to `SZSDK`

## [1.4.1] - 2024-04-19

### Changed in 1.4.1
Expand Down
33 changes: 31 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ GO_ARCH = $(word 2, $(GO_OSARCH))

# Conditional assignment. ('?=')
# Can be overridden with "export"
# Example: "export LD_LIBRARY_PATH=/path/to/my/senzing/g2/lib"
# Example: "export LD_LIBRARY_PATH=/path/to/my/senzing-garage/g2/lib"

LD_LIBRARY_PATH ?= /opt/senzing/g2/lib
GOBIN ?= $(shell go env GOPATH)/bin

# Export environment variables.

Expand Down Expand Up @@ -128,6 +129,12 @@ generate-typescript:
# Dependency management
# -----------------------------------------------------------------------------

.PHONY: make-dependencies
make-dependencies:
@go install github.com/vladopajic/go-test-coverage/v2@latest
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.58.1


.PHONY: dependencies
dependencies:
@go get -u ./...
Expand Down Expand Up @@ -155,6 +162,28 @@ build: build-osarch-specific
.PHONY: test
test: test-osarch-specific

# -----------------------------------------------------------------------------
# Coverage
# -----------------------------------------------------------------------------

.PHONY: coverage
coverage: coverage-osarch-specific


.PHONY: check-coverage
check-coverage: export SENZING_LOG_LEVEL=TRACE
check-coverage:
go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
${GOBIN}/go-test-coverage --config=./.testcoverage.yml

# -----------------------------------------------------------------------------
# Lint
# -----------------------------------------------------------------------------

.PHONY: run-golangci-lint
run-golangci-lint:
${GOBIN}/golangci-lint run --config=.github/linters/.golangci.yml

# -----------------------------------------------------------------------------
# Run
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -216,7 +245,7 @@ clean: clean-osarch-specific
.PHONY: clean-generated code
clean-generated code: clean-go clean-java clean-python clean-ruby clean-rust clean-typescript


.PHONY: help
help:
@echo "Build $(PROGRAM_NAME) version $(BUILD_VERSION)-$(BUILD_ITERATION)".
Expand Down
Loading