Skip to content

Commit

Permalink
go 1.20.8 build image (and thus govulncheck will stop complaining) (#837
Browse files Browse the repository at this point in the history
)

* go 1.20.8 build image (and thus govulncheck will stop complaining)

* looks like gocognit doesn't complain anymore?

* fold some dependabot queued MRs into this one

* stop creating json files each time tests are run in rapi/ use tmp instead

* prep for 1.60.0

* Fix #830

* fix #833
  • Loading branch information
ldemailly authored Sep 13, 2023
1 parent dcf94ed commit c52758c
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaultEnv:
&defaultEnv
docker:
# specify the version
- image: docker.io/fortio/fortio.build:v62@sha256:f7d431202f97b3dd7aab8bdfcf0ea9a4217740fb9ea0ffcb434d27bcbbe67301
- image: docker.io/fortio/fortio.build:v63@sha256:5aa4391129408742ad58c82c642e57549980f06a6e2322044bb430babb490cb6
working_directory: /build/fortio

jobs:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v62@sha256:f7d431202f97b3dd7aab8bdfcf0ea9a4217740fb9ea0ffcb434d27bcbbe67301 as build
FROM docker.io/fortio/fortio.build:v63@sha256:5aa4391129408742ad58c82c642e57549980f06a6e2322044bb430babb490cb6 as build
WORKDIR /build
COPY --chown=build:build . fortio
ARG MODE=install
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dependencies and linters for build:
FROM golang:1.20.7@sha256:bc5f0b5e43282627279fe5262ae275fecb3d2eae3b33977a7fd200c7a760d6f1
FROM golang:1.20.8@sha256:6e1a67ec11cc4eaa7a9699bc6e5385b00001669531284005ebd2ada4129138d9
# Need gcc for -race test (and some linters though those work with CGO_ENABLED=0)
RUN apt-get -y update && \
apt-get --no-install-recommends -y upgrade && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.echosrv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v62@sha256:f7d431202f97b3dd7aab8bdfcf0ea9a4217740fb9ea0ffcb434d27bcbbe67301 as build
FROM docker.io/fortio/fortio.build:v63@sha256:5aa4391129408742ad58c82c642e57549980f06a6e2322044bb430babb490cb6 as build
WORKDIR /build
COPY . fortio
RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/echosrv
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.fcurl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v62@sha256:f7d431202f97b3dd7aab8bdfcf0ea9a4217740fb9ea0ffcb434d27bcbbe67301 as build
FROM docker.io/fortio/fortio.build:v63@sha256:5aa4391129408742ad58c82c642e57549980f06a6e2322044bb430babb490cb6 as build
WORKDIR /build
COPY . fortio
RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/fcurl
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
IMAGES=echosrv fcurl # plus the combo image / Dockerfile without ext.

DOCKER_PREFIX := docker.io/fortio/fortio
BUILD_IMAGE_TAG := v62@sha256:f7d431202f97b3dd7aab8bdfcf0ea9a4217740fb9ea0ffcb434d27bcbbe67301
BUILD_IMAGE_TAG := v63@sha256:5aa4391129408742ad58c82c642e57549980f06a6e2322044bb430babb490cb6
BUILDX_PLATFORMS := linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
BUILDX_POSTFIX :=
ifeq '$(shell echo $(BUILDX_PLATFORMS) | awk -F "," "{print NF-1}")' '0'
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- 1.59.0 -->
<!-- 1.60.0 -->
# Fortio

[![Awesome Go](https://fortio.org/mentioned-badge.svg)](https://github.com/avelino/awesome-go#networking)
Expand Down Expand Up @@ -60,13 +60,13 @@ You can install from source:
The [releases](https://github.com/fortio/fortio/releases) page has binaries for many OS/architecture combinations (see assets):

```shell
curl -L https://github.com/fortio/fortio/releases/download/v1.59.0/fortio-linux_amd64-1.59.0.tgz \
curl -L https://github.com/fortio/fortio/releases/download/v1.60.0/fortio-linux_amd64-1.60.0.tgz \
| sudo tar -C / -xvzpf -
# or the debian package
wget https://github.com/fortio/fortio/releases/download/v1.59.0/fortio_1.59.0_amd64.deb
dpkg -i fortio_1.59.0_amd64.deb
wget https://github.com/fortio/fortio/releases/download/v1.60.0/fortio_1.60.0_amd64.deb
dpkg -i fortio_1.60.0_amd64.deb
# or the rpm
rpm -i https://github.com/fortio/fortio/releases/download/v1.59.0/fortio-1.59.0-1.x86_64.rpm
rpm -i https://github.com/fortio/fortio/releases/download/v1.60.0/fortio-1.60.0-1.x86_64.rpm
# and more, see assets in release page
```

Expand All @@ -76,7 +76,7 @@ On a MacOS you can also install Fortio using [Homebrew](https://brew.sh/):
brew install fortio
```

On Windows, download https://github.com/fortio/fortio/releases/download/v1.59.0/fortio_win_1.59.0.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt:
On Windows, download https://github.com/fortio/fortio/releases/download/v1.60.0/fortio_win_1.60.0.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt:
```
fortio.exe server
```
Expand Down Expand Up @@ -128,7 +128,7 @@ Full list of command line flags (`fortio help`):
<!-- use release/updateFlags.sh to update this section -->
<pre>
<!-- USAGE_START -->
Φορτίο 1.59.0 usage:
Φορτίο 1.60.0 usage:
fortio command [flags] target
where command is one of: load (load testing), server (starts ui, rest api,
http-echo, redirect, proxies, tcp-echo, udp-echo and grpc ping servers),
Expand Down Expand Up @@ -208,6 +208,8 @@ robin. (default cached-rr)
Setting for runtime.GOMAXPROCS, &lt;1 doesn't change the default
-grpc
Use GRPC (health check by default, add -ping for ping) for load testing
-grpc-compression
Enable grpc compression
-grpc-max-streams uint
MaxConcurrentStreams for the grpc server. Default (0) is to leave the option
unset.
Expand Down
2 changes: 1 addition & 1 deletion Webtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fi
PPROF_URL="$BASE_URL/debug/pprof/heap?debug=1"
$CURL "$PPROF_URL" | grep -i TotalAlloc # should find this in memory profile
# creating dummy container to hold a volume for test certs due to remote docker bind mount limitation.
DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v62@sha256:f7d431202f97b3dd7aab8bdfcf0ea9a4217740fb9ea0ffcb434d27bcbbe67301 sleep 120)
DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v63@sha256:5aa4391129408742ad58c82c642e57549980f06a6e2322044bb430babb490cb6 sleep 120)
# while we have something with actual curl binary do
# Test for h2c upgrade (#562)
docker exec $DOCKERSECVOLNAME /usr/bin/curl -v --http2 -m 10 -d foo42 http://localhost:8080/debug | tee >(cat 1>&2) | grep foo42
Expand Down
1 change: 0 additions & 1 deletion fgrpc/pingsrv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func init() {
log.SetLogLevel(log.Debug)
}

//nolint:gocognit
func TestPingServer(t *testing.T) {
TLSSecure := &fhttp.TLSOptions{CACert: caCrt, Insecure: false}
TLSSecureMissingCert := &fhttp.TLSOptions{Insecure: false}
Expand Down
1 change: 0 additions & 1 deletion fhttp/httprunner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ func gUnzipData(t *testing.T, data []byte) (resData []byte) {
return
}

//nolint:gocognit
func TestAccessLogAndTrace(t *testing.T) {
mux, addr := DynamicHTTPServer(false)
mux.HandleFunc("/echo-for-alog/", EchoHandler)
Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ require (
fortio.org/assert v1.2.0
fortio.org/cli v1.4.2
fortio.org/dflag v1.5.3
fortio.org/log v1.10.0
fortio.org/log v1.11.0
fortio.org/scli v1.11.0
fortio.org/sets v1.0.3
fortio.org/testscript v0.3.1
fortio.org/version v1.0.2
github.com/golang/protobuf v1.5.3
github.com/google/uuid v1.3.0
golang.org/x/net v0.14.0
google.golang.org/grpc v1.57.0
github.com/google/uuid v1.3.1
golang.org/x/net v0.15.0
google.golang.org/grpc v1.58.0
)

// Local dev of dependencies changes
Expand All @@ -29,10 +29,10 @@ require (

require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.8.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
36 changes: 18 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ fortio.org/cli v1.4.2 h1:pCYVPk5FpQuJtD31f9CG8sdgoTOWdv9Gls8As/MLJhU=
fortio.org/cli v1.4.2/go.mod h1:VGqFDEKpA6u3NbTM3aSz2lZfAYKnGaszl1pLxbBhxsY=
fortio.org/dflag v1.5.3 h1:+pCqZBCz95PYTxhcmenjrkVORWIRB1Je4eO/So574Bc=
fortio.org/dflag v1.5.3/go.mod h1:cM/ojIzdDv8FRA5yqSRpDK9jCGmASln0k7ag3zeiqbw=
fortio.org/log v1.10.0 h1:Id2z9HjGlof0VsIHi2XNI9k+tG7ujODVDnAAvkSgpuE=
fortio.org/log v1.10.0/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU=
fortio.org/log v1.11.0 h1:w7ueGPGbXz0A3+ApMz/5Q9gwEMrwSo/ohTlLo2Um6dU=
fortio.org/log v1.11.0/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU=
fortio.org/scli v1.11.0 h1:MI0kTivwCIF2L6eJJFUnTipd5d1KtCM1oVMB6Dcf6pY=
fortio.org/scli v1.11.0/go.mod h1:XfyQjPJWYlF74dY0zMascOzVPds0GCbam184DMuCySU=
fortio.org/sets v1.0.3 h1:HzewdGjH69YmyW06yzplL35lGr+X4OcqQt0qS6jbaO4=
Expand All @@ -21,24 +21,24 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI=
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 h1:eSaPbMR4T7WfH9FvABk36NBMacoTUKdWCvV0dx+KfOg=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I=
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb h1:Isk1sSH7bovx8Rti2wZK0UZF6oraBDK74uoyLEEVFN0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o=
google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
Expand Down
2 changes: 1 addition & 1 deletion rapi/restHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func RESTRunHandler(w http.ResponseWriter, r *http.Request) { //nolint:funlen
}
}
c, _ := strconv.Atoi(FormValue(r, jd, "c"))
out := io.Writer(os.Stderr)
out := io.Writer(os.Stdout)
if len(percList) == 0 && !strings.Contains(r.URL.RawQuery, "p=") {
percList = DefaultPercentileList
}
Expand Down
2 changes: 1 addition & 1 deletion rapi/restHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func TestHTTPRunnerRESTApiBadHost(t *testing.T) {
// otherwise log.SetLogLevel(log.Info)
mux, addr := fhttp.DynamicHTTPServer(false)
uiPath := "/f/"
AddHandlers(nil, mux, "", uiPath, ".")
AddHandlers(nil, mux, "", uiPath, "/tmp")
// Error with bad host
restURL := fmt.Sprintf("http://localhost:%d%s%s", addr.Port, uiPath, RestRunURI)
// sync first:
Expand Down
2 changes: 1 addition & 1 deletion release/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Concatenated after ../Dockerfile to create the tgz
FROM docker.io/fortio/fortio.build:v62@sha256:f7d431202f97b3dd7aab8bdfcf0ea9a4217740fb9ea0ffcb434d27bcbbe67301 as stage
FROM docker.io/fortio/fortio.build:v63@sha256:5aa4391129408742ad58c82c642e57549980f06a6e2322044bb430babb490cb6 as stage
ARG archs="amd64 arm64 ppc64le s390x"
ENV archs=${archs}
# Build image defaults to build user, switch back to root for
Expand Down
6 changes: 5 additions & 1 deletion ui/uihandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ const (
// Handler is the main UI handler creating the web forms and processing them.
// TODO: refactor common option/args/flag parsing between restHandle.go and this.
//
//nolint:funlen, gocognit, nestif // should be refactored indeed (TODO)
//nolint:funlen, nestif // should be refactored indeed (TODO)
func Handler(w http.ResponseWriter, r *http.Request) {
log.LogRequest(r, "UI")
if r.Method != http.MethodPost && r.Method != http.MethodGet {
// method is already logged by LogRequest so we just return (for HEAD etc... see Issue#830)
return
}
mode := menu
JSONOnly := false
runid := int64(0)
Expand Down

0 comments on commit c52758c

Please sign in to comment.