Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions .env.bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GIT_CLONES="\
https://github.com/forestrie/taskfiles.git#../taskfiles
https://github.com/robinbryce/go-datatrails-common.git#../go-datatrails-common
https://github.com/robinbryce/go-datatrails-merklelog.git#../go-datatrails-merklelog
https://github.com/forestrie/go-merklelog-datatrails.git#../go-merklelog-datatrails
https://github.com/datatrails/go-datatrails-simplehash.git#../go-datatrails-simplehash
https://github.com/datatrails/go-datatrails-serialization.git#../go-datatrails-serialization
https://github.com/robinbryce/go-merklelog-azure.git#../go-merklelog-azure
https://github.com/robinbryce/go-merklelog-fs.git#../go-merklelog-fs
https://github.com/robinbryce/go-merklelog-provider-testing.git#../go-merklelog-provider-testing
"

export GIT_CHECKOUTS="\
https://github.com/robinbryce/go-datatrails-common.git#../go-datatrails-common^robin/accept-uint64-reading-cose-keys
https://github.com/datatrails/go-datatrails-serialization.git#../go-datatrails-serialization@eventsv1/v0.0.3
"
41 changes: 21 additions & 20 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: [

jobs:
build:
name: Quality Control
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -32,28 +32,25 @@ jobs:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Code quality checks
- name: Bootstrap
run: |
# Note: it is by design that we don't use the builder
task format
task lint
task bootstrap

- name: Unit tests
run: |
# Note: it is by design that we don't use the builder
task test:unit
- name: Integration tests
run: |
# Note: it is by design that we don't use the builder
task test:integration
- name: Azurite logs
run: |
task azurite:logs
- name: Stop azurite
if: always()
- name: DataTrails public log tests
run: |
task azurite:stop
# Note: it is by design that we don't use the builder
task test:datatrails:public

systemtest:
name: System Test
name: Built binary tests
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
Expand All @@ -74,15 +71,19 @@ jobs:

- name: Build project
run: |
task bootstrap
task build
export VERACITY_INSTALL=$(readlink -f ./veracity) >> $GITHUB_ENV
./veracity --help
./veracity --version

- name: System tests
run: |
echo "Veracity Installation Path: $VERACITY_INSTALL"
task test:system
# - name: Test the built binary
# run: |
# echo "Veracity Installation Path: $VERACITY_INSTALL"
# task bootstrap
# task test:binary

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
with:
report_paths: ./tests/systemtest/res.xml
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v4
# with:
# report_paths: ./tests/systemtest/res.xml
201 changes: 80 additions & 121 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,120 +1,7 @@
linters-settings:
funlen:
lines: 350
statements: 135
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
dupl:
threshold: 100
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors.
# See the https://github.com/polyfloyd/go-errorlint for caveats.
# Default: true
errorf: false
# Permit more than 1 %w verb, valid per Go 1.20 (Requires errorf:true)
# Default: true
errorf-multi: true
# Check for plain type assertions and type switches.
# Default: true
asserts: true
# Check for plain error comparisons.
# Default: true
comparison: true
exhaustive:
# Program elements to check for exhaustiveness.
# Default: [ switch ]
check:
- switch
- map
# Check switch statements in generated files also.
# Default: false
check-generated: true
# Presence of "default" case in switch statements satisfies exhaustiveness,
# even if all enum members are not listed.
# Default: false
default-signifies-exhaustive: true
# Enum members matching the supplied regex do not have to be listed in
# switch statements to satisfy exhaustiveness.
# Default: ""
ignore-enum-members: "Example.+"
# Enum types matching the supplied regex do not have to be listed in
# switch statements to satisfy exhaustiveness.
# Default: ""
ignore-enum-types: "Example.+"
# Consider enums only in package scopes, not in inner scopes.
# Default: false
package-scope-only: true
# Only run exhaustive check on switches with "//exhaustive:enforce" comment.
# Default: false
explicit-exhaustive-switch: false
# Only run exhaustive check on map literals with "//exhaustive:enforce" comment.
# Default: false
explicit-exhaustive-map: false
gci:
local-prefixes: github.com/datatrails/go-datatrails-merklelog
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc
gocognit:
min-complexity: 75
gocyclo:
min-complexity: 10
goimports:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
govet:
check-shadowing: true
settings:
printf:
funcs:
- Infof
- Warnf
- Errorf
- Fatalf
lll:
line-length: 500
maligned:
suggest-new: true
misspell:
locale: UK
run:
timeout: 5m
build-tags: "golangcilint unit integration e2e azurite"

# depguard (control upstream repos) not needed
# dupl - see ticket #3095
# funlen - it is to anoying for test code and this sort of subjective judgement is what PR reviews are for
# exhaustive - see ticket #3096
# gci - disabled as confusing and not really useful
# gochecknoglobals - not really useful
# goconst - see ticket #3097
# goerr113 - disabled see https://github.com/Djarvur/go-err113/issues/10
# gofumpt - not useful - confusing messages
# gomnd - see ticket #3116
# govet - see ticket #3117
# nilreturn onwardis not yet evaluated...
# maligned - this guards against performance issues due to accessing
# mis-aligned structs. We don't have direct evidence of this being a
# real problem for us. We use a lot of generated code in our hot
# paths anyway (we have no control over there layout). Until we get
# direct evidence this is hurting us, we prefer our stucts layed out
# logically and don't want to have to nolint tag everything.
#
# misspell - expected UK spelling with misspell, but customer facing text needs to be US.
# tagalign - suppress until we can get a golang code formatter that will fix this (cosmetic)
#
# WARN: typecheck cannot be disabled as golang-ci uses it internally to detect uncompilable code.
# Unfortunately the src/azb2c package triggers this erroneously so we add it to skip-dirs below.
#
linters:
enable-all: true
disable:
Expand All @@ -132,8 +19,7 @@ linters:
- exhaustruct
- forbidigo
- forcetypeassert
# DONT re-enable funlen please
- funlen
- funlen # DONT re-enable funlen please
- gci
- gochecknoglobals
- goconst
Expand Down Expand Up @@ -192,9 +78,82 @@ linters:
- wsl
- wrapcheck

run:
build-tags:
- golangcilint
linters-settings:
funlen:
lines: 350
statements: 135

depguard:
list-type: blacklist
packages:
- github.com/sirupsen/logrus # only allowed in logutils

dupl:
threshold: 100

errorlint:
errorf: false
errorf-multi: true
asserts: true
comparison: true

exhaustive:
check:
- switch
- map
check-generated: true
default-signifies-exhaustive: true
ignore-enum-members: "Example.+"
ignore-enum-types: "Example.+"
package-scope-only: true
explicit-exhaustive-switch: false
explicit-exhaustive-map: false

gci:
local-prefixes: github.com/datatrails/go-datatrails-merklelog

goconst:
min-len: 2
min-occurrences: 2

gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc

gocognit:
min-complexity: 75

gocyclo:
min-complexity: 10

goimports:
local-prefixes: github.com/golangci/golangci-lint

golint:
min-confidence: 0

govet:
check-shadowing: true
settings:
printf:
funcs:
- Infof
- Warnf
- Errorf
- Fatalf

lll:
line-length: 500

maligned:
suggest-new: true

misspell:
locale: UK

issues:
exclude-rules:
Expand Down
Loading
Loading