Skip to content

Commit

Permalink
Merge branch 'main' into templates
Browse files Browse the repository at this point in the history
  • Loading branch information
sylr authored Aug 8, 2023
2 parents a6c4bb9 + ab15e58 commit 8492960
Show file tree
Hide file tree
Showing 114 changed files with 3,099 additions and 844 deletions.
File renamed without changes.
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "Go & Mongo DB",
"name": "Quickfix/Go Development",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"features": {
"ruby": "latest"
},
"customizations": {
"vscode": {
"settings": {
Expand Down
17 changes: 8 additions & 9 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
app:
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile.dev
volumes:
- ..:/workspace:cached

- /var/run/docker.sock:/var/run/docker.sock
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

Expand All @@ -21,16 +21,15 @@ services:
# (Adding the "ports" property to this file will not forward from a Codespace.)

db:
image: mongo:latest
image: bitnami/mongodb:latest
restart: unless-stopped
volumes:
- mongodb-data:/data/db

# Uncomment to change startup options
# environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: example
# MONGO_INITDB_DATABASE: your-database-here
ports:
- 27017:27017
environment:
MONGODB_REPLICA_SET_MODE: primary
ALLOW_EMPTY_PASSWORD: 'yes'

# Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
Expand Down
43 changes: 24 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ jobs:
- name: Install golangci-lint
run: |
curl -sSLO https://github.com/golangci/golangci-lint/releases/download/v$GOLANGCI_LINT_VERSION/golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz
shasum -a 256 golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz | grep "^$GOLANGCI_LINT_SHA256 " > /dev/null
tar -xf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz
sudo mv golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64/golangci-lint /usr/local/bin/golangci-lint
rm -rf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64*
env:
GOLANGCI_LINT_VERSION: '1.46.2'
GOLANGCI_LINT_SHA256: '242cd4f2d6ac0556e315192e8555784d13da5d1874e51304711570769c4f2b9b'
- name: Test style
run: make test-style
GOLANGCI_LINT_VERSION: '1.50.1'
- name: Run Lint
run: make lint

build:
name: build
Expand All @@ -47,26 +45,33 @@ jobs:
matrix:
go: [1.18]
fix-version:
- FIX_TEST=
- FIX_TEST=fix40
- FIX_TEST=fix41
- FIX_TEST=fix42
- FIX_TEST=fix43
- FIX_TEST=fix44
- FIX_TEST=fix50
- FIX_TEST=fix50sp1
- FIX_TEST=fix50sp2
-
- fix40
- fix41
- fix42
- fix43
- fix44
- fix50
- fix50sp1
- fix50sp2
steps:
- name: Setup
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out source
uses: actions/checkout@v2
- name: Run Mongo
run: docker run -d -p 27017:27017 mongo
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-replica-set: replicaset
- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Test
env:
GO111MODULE: "on"
MONGODB_TEST_CXN: "localhost"
run: make generate; if [ -z "$FIX_TEST" ]; then make build; make; else make build_accept; make $FIX_TEST; fi
GO111MODULE: on
MONGODB_TEST_CXN: mongodb://localhost:27017
FIX_TEST: ${{ matrix.fix-version }}
run: if [ -z $FIX_TEST ]; then make build-src && make test-ci; else make generate-ci && make build && make $FIX_TEST; fi
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ run:
linters:
disable-all: true
enable:
- deadcode
- dupl
- gofmt
- goimports
Expand All @@ -17,8 +16,8 @@ linters:
- misspell
- revive
- unused
- varcheck
- staticcheck
- godot

linters-settings:
gofmt:
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## 0.7.0 (January 2, 2023)

FEATURES

* PersistMessages Config [GH 297]
* MaxLatency [GH 242]
* ResetOnDisconnect Configuration [GH 68]
* Support for High Precision Timestamps [GH 288]
* LogonTimeout [GH 295]
* LogoutTimeout [GH 296]
* Socks Proxy [GH 375]

ENHANCEMENTS

* Add SocketUseSSL parameter to allow SSL/TLS without client certs [GH 311]
* Support for RejectInvalidMessage configuration [GH 336]
* Add deep copy for Messages [GH 338]
* Add Go Module support [GH 340]
* Support timeout on ssl connection [GH 347, 349]
* Dynamic Sessions [GH 521]
* Upgrade Mongo Driver to support transactions [GH 527]

BUG FIXES

* header and trailer templates use rootpath [GH 302]
* Initiator stop panic if stop chan's already closed [GH 359]
* Connection closed when inbound logon has a too-low sequence number [GH 369]
* TLS server name config [GH 384]
* Fix concurrent map write [GH 436]
* Race condition during bilateral initial resend request [GH 439]
* Deadlock when disconnecting dynamic session [GH 524]
* Align session's ticker with round second [GH 533]
* Seqnum persist and increment fix [GH 528]


## 0.6.0 (August 14, 2017)

FEATURES
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The QuickFIX Software License, Version 1.0

Copyright (c) 2001-2010 quickfixengine.org All rights
Copyright (c) 2001- quickfixengine.org All rights
reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
72 changes: 31 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,62 +1,35 @@
GOBIN = $(shell go env GOBIN)
ifeq ($(GOBIN),)
GOBIN = $(shell go env GOPATH)/bin
endif
GOX = $(GOBIN)/gox
GOIMPORTS = $(GOBIN)/goimports
ARCH = $(shell uname -p)

# ------------------------------------------------------------------------------
# dependencies

# If go install is run from inside the project directory it will add the
# dependencies to the go.mod file. To avoid that we change to a directory
# without a go.mod file when downloading the following dependencies

$(GOX):
(cd /; GO111MODULE=on go install github.com/mitchellh/gox@latest)

$(GOIMPORTS):
(cd /; GO111MODULE=on go install golang.org/x/tools/cmd/goimports@latest)

# ------------------------------------------------------------------------------

all: vet test

clean:
rm -rf gen

generate: clean
mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go ../spec/*.xml
go get -u all

generate-dist:
cd ..; go run quickfix/cmd/generate-fix/generate-fix.go quickfix/spec/*.xml

test-style:
GO111MODULE=on golangci-lint run

.PHONY: format
format: $(GOIMPORTS)
GO111MODULE=on go list -f '{{.Dir}}' ./... | xargs $(GOIMPORTS) -w -local github.com/quickfixgo/quickfix
mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go -pkg-root=github.com/quickfixgo/quickfix/gen ../spec/*.xml

fmt:
go fmt `go list ./... | grep -v quickfix/gen`
gofmt -l -w -s $(shell find . -type f -name '*.go')

vet:
go vet `go list ./... | grep -v quickfix/gen`

test:
MONGODB_TEST_CXN=localhost go test -v -cover . ./datadictionary ./internal
MONGODB_TEST_CXN=mongodb://db:27017 go test -v -cover . ./datadictionary ./internal

_build_all:
go build -v `go list ./...`
linters-install:
@golangci-lint --version >/dev/null 2>&1 || { \
echo "installing linting tools..."; \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.50.1; \
}

build_accept:
cd _test; go build -o echo_server
lint: linters-install
golangci-lint run

build: _build_all build_accept
# ---------------------------------------------------------------
# Targets related to running acceptance tests -

build-test-srv:
cd _test; go build -o echo_server ./test-server/
fix40:
cd _test; ./runat.sh $@.cfg 5001 "definitions/server/$@/*.def"
fix41:
Expand All @@ -78,3 +51,20 @@ ACCEPT_SUITE=fix40 fix41 fix42 fix43 fix44 fix50 fix50sp1 fix50sp2
accept: $(ACCEPT_SUITE)

.PHONY: test $(ACCEPT_SUITE)
# ---------------------------------------------------------------

# ---------------------------------------------------------------
# These targets are specific to the Github CI Runner -

build-src:
go build -v `go list ./...`

build: build-src build-test-srv

test-ci:
go test -v -cover . ./datadictionary ./internal

generate-ci: clean
mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go -pkg-root=github.com/quickfixgo/quickfix/gen ../spec/$(shell echo $(FIX_TEST) | tr '[:lower:]' '[:upper:]').xml;

# ---------------------------------------------------------------
Loading

0 comments on commit 8492960

Please sign in to comment.