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

B 20641 upgrade go 1.23.1 nodejs 18.20.4 main #13724

Merged
merged 29 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6c43a9c
set exp deploy env
cameroncaci Sep 16, 2024
6e8228d
update go tool, lint, docker refs to support 1.23.0
cameroncaci Sep 16, 2024
73bb65f
linter fixes
cameroncaci Sep 16, 2024
71c0e3a
mocks gen
cameroncaci Sep 16, 2024
caf8254
bump nodejs version to lts 18.20.4
cameroncaci Sep 16, 2024
993b0f6
bump go mod sources
cameroncaci Sep 16, 2024
4a54dc2
bump mockery to latest 2.45.1
cameroncaci Sep 16, 2024
d0de637
adjust mockery compatibility deps
cameroncaci Sep 16, 2024
da2c990
mockery workaround
cameroncaci Sep 16, 2024
e5ce91a
move env var
cameroncaci Sep 16, 2024
6613354
add go debug mockery workaround to circleci
cameroncaci Sep 17, 2024
7935b9e
move godebug to mod
cameroncaci Sep 17, 2024
d1a3ae6
bump docker to go 1.23.1
cameroncaci Sep 17, 2024
a1a73d4
bump tools to 1.23.1
cameroncaci Sep 17, 2024
d0e10e8
bump go version ref
cameroncaci Sep 17, 2024
01e23c5
Revert "set exp deploy env"
cameroncaci Sep 19, 2024
ce1fcad
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
cameroncaci Sep 19, 2024
800aaad
Merge branch 'b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main' of githu…
cameroncaci Sep 25, 2024
39831ff
Merge remote-tracking branch 'origin/main' into b-20631-upgrade-go-1.…
cameroncaci Sep 25, 2024
537db39
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
danieljordan-caci Sep 25, 2024
5b57e32
fix writefile perm in test
cameroncaci Sep 25, 2024
2c0a7d0
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
cameroncaci Sep 25, 2024
5f9778a
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
cameroncaci Sep 25, 2024
34b828f
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
cameroncaci Sep 26, 2024
00ad52a
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
cameroncaci Sep 30, 2024
a1ae2c9
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
cameroncaci Oct 7, 2024
739c2c7
gosec comment
cameroncaci Oct 7, 2024
82bccea
mocks gen
cameroncaci Oct 7, 2024
bac42fc
Merge branch 'main' into b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
cameroncaci Oct 7, 2024
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ version: 2.1

# References for variables shared across the file
references:
circleci-docker: &circleci-docker milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d
circleci-docker: &circleci-docker milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed

# the playwright image to use
playwright: &playwright cimg/node:18.13.0-browsers
Expand Down Expand Up @@ -277,13 +277,13 @@ commands:
- create_dot_go_version
- restore_cache:
keys:
- go-mod-sources-v7-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}
- go-mod-sources-v8-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}

save_cache_for_go:
steps:
- create_dot_go_version
- save_cache:
key: go-mod-sources-v7-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}
key: go-mod-sources-v8-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}
paths:
- '~/go'
- '~/transcom/mymove/bin/swagger'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
go-version: '1.23.1'
- name: Tidy
run: |
go version
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ repos:
)$
- repo: https://github.com/golangci/golangci-lint
rev: v1.57.2
rev: v1.61.0
hooks:
- id: golangci-lint
entry: bash -c 'exec golangci-lint run ${GOLANGCI_LINT_VERBOSE} -j=${GOLANGCI_LINT_CONCURRENCY:-1}' # custom bash so we can override concurrency for faster dev runs
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang 1.22.2
nodejs 18.20.2
golang 1.23.1
nodejs 18.20.4
2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.migrations_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.reviewapp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###########

# Base builder so the ci build image hash is referenced once
FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=docker
ENV REACT_APP_NODE_ENV=development
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.tasks_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.tools_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhook_client
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

# Prepare public DOD certificates.
# hadolint ignore=DL3002
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhook_client_dp3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

# Prepare public DOD certificates.
# hadolint ignore=DL3002
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhook_client_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

# Prepare public DOD certificates.
# hadolint ignore=DL3002
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ build_tools: bin/gin \
build: server_build build_tools client_build ## Build the server, tools, and client

.PHONY: mocks_generate
mocks_generate: bin/mockery ## Generate mockery mocks for tests
mocks_generate: bin/mockery ## Generate mockery mocks for tests.
go generate $$(go list ./... | grep -v \\/pkg\\/gen\\/ | grep -v \\/cmd\\/)

.PHONY: server_test_setup
Expand Down Expand Up @@ -1057,7 +1057,7 @@ pretty: gofmt ## Run code through JS and Golang formatters

.PHONY: docker_circleci
docker_circleci: ## Run CircleCI container locally with project mounted
docker run -it --pull=always --rm=true -v $(PWD):$(PWD) -w $(PWD) -e CIRCLECI=1 milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d bash
docker run -it --pull=always --rm=true -v $(PWD):$(PWD) -w $(PWD) -e CIRCLECI=1 milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed bash

.PHONY: docker_local_ssh_server_with_password
docker_local_ssh_server_with_password:
Expand Down
2 changes: 1 addition & 1 deletion cmd/ghc-pricing-parser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func summarizeModel(appCtx appcontext.AppContext, header string, modelInstance i
if err != nil {
return err
}
pterm.Printf(pterm.Gray("(representative rows above; " + pterm.Green(length) + " rows total)\n\n"))
pterm.Printf(pterm.Gray("(representative rows above; %s rows total)\n\n"), pterm.Green(length))

return nil
}
Expand Down
12 changes: 8 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module github.com/transcom/mymove

go 1.22
go 1.23

// Temporary workaroudn to mockery alias generation issue with go 1.23
// found at https://github.com/vektra/mockery/issues/803
godebug gotypesalias=0

require (
github.com/DATA-DOG/go-txdb v0.1.7
Expand Down Expand Up @@ -71,7 +75,7 @@ require (
github.com/tcnksm/go-input v0.0.0-20180404061846-548a7d7a8ee8
github.com/tealeg/xlsx/v3 v3.3.7
github.com/tiaguinho/gosoap v1.4.4
github.com/vektra/mockery/v2 v2.33.2
github.com/vektra/mockery/v2 v2.45.1
github.com/xuri/excelize/v2 v2.8.1
go.flipt.io/flipt/rpc/flipt v1.45.0
go.flipt.io/flipt/sdk/go v0.5.0
Expand Down Expand Up @@ -148,7 +152,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20221221133751-67e37ae746cd // indirect
github.com/chigopher/pathlib v1.0.0 // indirect
github.com/chigopher/pathlib v0.19.1 // indirect
github.com/codegangsta/envy v0.0.0-20141216192214-4b78388c8ce4 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
Expand Down Expand Up @@ -192,7 +196,7 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hhrutter/lzw v1.0.0 // indirect
github.com/hhrutter/tiff v1.0.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
Expand Down
11 changes: 6 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20221221133751-67e37ae746cd
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chigopher/pathlib v1.0.0 h1:SbsCrFX4vDf4M2d8mT/RTzuVlKOjTKoPHK0HidsQFak=
github.com/chigopher/pathlib v1.0.0/go.mod h1:3+YPPV21mU9vyw8Mjp+F33CyCfE6iOzinpiqBcccv7I=
github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A=
github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
Expand Down Expand Up @@ -313,8 +313,9 @@ github.com/hhrutter/lzw v1.0.0 h1:laL89Llp86W3rRs83LvKbwYRx6INE8gDn0XNb1oXtm0=
github.com/hhrutter/lzw v1.0.0/go.mod h1:2HC6DJSn/n6iAZfgM3Pg+cP1KxeWc3ezG8bBqW5+WEo=
github.com/hhrutter/tiff v1.0.1 h1:MIus8caHU5U6823gx7C6jrfoEvfSTGtEFRiM8/LOzC0=
github.com/hhrutter/tiff v1.0.1/go.mod h1:zU/dNgDm0cMIa8y8YwcYBeuEEveI4B0owqHyiPpJPHc=
github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
Expand Down Expand Up @@ -632,8 +633,8 @@ github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9r
github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM=
github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk=
github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vektra/mockery/v2 v2.33.2 h1:znIUwQ3FxnA5jvPy8irYBoiIqMZhuOJhoPOJYNoTJqU=
github.com/vektra/mockery/v2 v2.33.2/go.mod h1:9lREs4VEeQiUS3rizYQx1saxHu2JiIhThP0q9+fDegM=
github.com/vektra/mockery/v2 v2.45.1 h1:6HpdnKiLCjVtzlRLQPUNIM0u7yrvAoZ7VWF1TltJvTM=
github.com/vektra/mockery/v2 v2.45.1/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
Expand Down
4 changes: 2 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ buildEnv {
(import
(builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "go-1.22.2";
name = "go-1.23.1";
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixpkgs-unstable";
rev = "dfcffbd74fd6f0419370d8240e445252a39f4d10";
})
{ }).go_1_22_2
{ }).go_1_23_1

(import
(builtins.fetchGit {
Expand Down
6 changes: 3 additions & 3 deletions pkg/apperror/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func NewInvalidInputError(id uuid.UUID, err error, validationErrors *validate.Er

func (e InvalidInputError) Error() string {
if e.message != "" {
return fmt.Sprintf(e.message)
return e.message
} else if e.id == uuid.Nil && e.ValidationErrors != nil {
return fmt.Sprintf("Invalid input received. %s", e.ValidationErrors)
} else if e.ValidationErrors != nil {
Expand All @@ -244,7 +244,7 @@ type QueryError struct {

func (e QueryError) Error() string {
if e.message != "" {
return fmt.Sprintf(e.message)
return e.message
}
return fmt.Sprintf("Could not complete query related to object of type: %s.", e.objectType)
}
Expand Down Expand Up @@ -281,7 +281,7 @@ func NewInvalidCreateInputError(validationErrors *validate.Errors, message strin

func (e InvalidCreateInputError) Error() string {
if e.message != "" {
return fmt.Sprintf(e.message)
return e.message
}
return fmt.Sprintf("Invalid input for ID: %s", e.ValidationErrors)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func ServeCustomError(rw http.ResponseWriter, r *http.Request, err error) {
default:
rw.WriteHeader(http.StatusInternalServerError)
if r == nil || r.Method != http.MethodHead {
_, _ = rw.Write(errorAsJSON(openapierrors.New(http.StatusInternalServerError, err.Error()), traceID))
_, _ = rw.Write(errorAsJSON(openapierrors.New(http.StatusInternalServerError, "%s", err.Error()), traceID))
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func Order(order *models.Order) *ghcmessages.Order {

var moveCode string
var moveTaskOrderID strfmt.UUID
if order.Moves != nil && len(order.Moves) > 0 {
if len(order.Moves) > 0 {
moveCode = order.Moves[0].Locator
moveTaskOrderID = strfmt.UUID(order.Moves[0].ID.String())
}
Expand Down Expand Up @@ -1428,7 +1428,7 @@ func MTOShipment(storer storage.FileStorer, mtoShipment *models.MTOShipment, sit
payload.SitDaysAllowance = handlers.FmtIntPtrToInt64(&totalSITAllowance)
}

if mtoShipment.SITDurationUpdates != nil && len(mtoShipment.SITDurationUpdates) > 0 {
if len(mtoShipment.SITDurationUpdates) > 0 {
payload.SitExtensions = *SITDurationUpdates(&mtoShipment.SITDurationUpdates)
}

Expand Down Expand Up @@ -1550,7 +1550,7 @@ func PaymentRequests(appCtx appcontext.AppContext, prs *models.PaymentRequests,
func PaymentRequest(appCtx appcontext.AppContext, pr *models.PaymentRequest, storer storage.FileStorer) (*ghcmessages.PaymentRequest, error) {
serviceDocs := make(ghcmessages.ProofOfServiceDocs, len(pr.ProofOfServiceDocs))

if pr.ProofOfServiceDocs != nil && len(pr.ProofOfServiceDocs) > 0 {
if len(pr.ProofOfServiceDocs) > 0 {
for i, proofOfService := range pr.ProofOfServiceDocs {
payload, err := ProofOfServiceDoc(proofOfService, storer)
if err != nil {
Expand Down Expand Up @@ -1695,7 +1695,7 @@ func ServiceRequestDoc(serviceRequest models.ServiceRequestDocument, storer stor

uploads := make([]*ghcmessages.Upload, len(serviceRequest.ServiceRequestDocumentUploads))

if serviceRequest.ServiceRequestDocumentUploads != nil && len(serviceRequest.ServiceRequestDocumentUploads) > 0 {
if len(serviceRequest.ServiceRequestDocumentUploads) > 0 {
for i, serviceRequestUpload := range serviceRequest.ServiceRequestDocumentUploads {
url, err := storer.PresignedURL(serviceRequestUpload.Upload.StorageKey, serviceRequestUpload.Upload.ContentType)
if err != nil {
Expand Down Expand Up @@ -1743,7 +1743,7 @@ func MTOServiceItemModel(s *models.MTOServiceItem, storer storage.FileStorer) *g

serviceRequestDocs := make(ghcmessages.ServiceRequestDocuments, len(s.ServiceRequestDocuments))

if s.ServiceRequestDocuments != nil && len(s.ServiceRequestDocuments) > 0 {
if len(s.ServiceRequestDocuments) > 0 {
for i, serviceRequest := range s.ServiceRequestDocuments {
payload, err := ServiceRequestDoc(serviceRequest, storer)
if err != nil {
Expand Down Expand Up @@ -1932,7 +1932,7 @@ func WeightTicketUpload(storer storage.FileStorer, upload models.Upload, url str
func ProofOfServiceDoc(proofOfService models.ProofOfServiceDoc, storer storage.FileStorer) (*ghcmessages.ProofOfServiceDoc, error) {

uploads := make([]*ghcmessages.Upload, len(proofOfService.PrimeUploads))
if proofOfService.PrimeUploads != nil && len(proofOfService.PrimeUploads) > 0 {
if len(proofOfService.PrimeUploads) > 0 {
for i, primeUpload := range proofOfService.PrimeUploads {
url, err := storer.PresignedURL(primeUpload.Upload.StorageKey, primeUpload.Upload.ContentType)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/handlers/primeapi/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func MTOAgents(mtoAgents *models.MTOAgents) *primemessages.MTOAgents {

func ProofOfServiceDoc(proofOfServiceDoc models.ProofOfServiceDoc) *primemessages.ProofOfServiceDoc {
uploads := make([]*primemessages.UploadWithOmissions, len(proofOfServiceDoc.PrimeUploads))
if proofOfServiceDoc.PrimeUploads != nil && len(proofOfServiceDoc.PrimeUploads) > 0 {
if len(proofOfServiceDoc.PrimeUploads) > 0 {
for i, primeUpload := range proofOfServiceDoc.PrimeUploads {
uploads[i] = basicUpload(&primeUpload.Upload) //#nosec G601
}
Expand All @@ -333,7 +333,7 @@ func PaymentRequest(paymentRequest *models.PaymentRequest) *primemessages.Paymen

serviceDocs := make(primemessages.ProofOfServiceDocs, len(paymentRequest.ProofOfServiceDocs))

if paymentRequest.ProofOfServiceDocs != nil && len(paymentRequest.ProofOfServiceDocs) > 0 {
if len(paymentRequest.ProofOfServiceDocs) > 0 {
for i, proofOfService := range paymentRequest.ProofOfServiceDocs {
serviceDocs[i] = ProofOfServiceDoc(proofOfService)
}
Expand Down Expand Up @@ -445,7 +445,7 @@ func PaymentServiceItemParams(paymentServiceItemParams *models.PaymentServiceIte
//nolint:gosec //G601
func ServiceRequestDocument(serviceRequestDocument models.ServiceRequestDocument) *primemessages.ServiceRequestDocument {
uploads := make([]*primemessages.UploadWithOmissions, len(serviceRequestDocument.ServiceRequestDocumentUploads))
if serviceRequestDocument.ServiceRequestDocumentUploads != nil && len(serviceRequestDocument.ServiceRequestDocumentUploads) > 0 {
if len(serviceRequestDocument.ServiceRequestDocumentUploads) > 0 {
for i, proofOfServiceDocumentUpload := range serviceRequestDocument.ServiceRequestDocumentUploads {
uploads[i] = basicUpload(&proofOfServiceDocumentUpload.Upload)
}
Expand Down Expand Up @@ -705,7 +705,7 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) primemessages.MTOServ

serviceRequestDocuments := make(primemessages.ServiceRequestDocuments, len(mtoServiceItem.ServiceRequestDocuments))

if mtoServiceItem.ServiceRequestDocuments != nil && len(mtoServiceItem.ServiceRequestDocuments) > 0 {
if len(mtoServiceItem.ServiceRequestDocuments) > 0 {
for i, serviceRequestDocument := range mtoServiceItem.ServiceRequestDocuments {
serviceRequestDocuments[i] = ServiceRequestDocument(serviceRequestDocument)
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/handlers/primeapiv2/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func MTOAgents(mtoAgents *models.MTOAgents) *primev2messages.MTOAgents {

func ProofOfServiceDoc(proofOfServiceDoc models.ProofOfServiceDoc) *primev2messages.ProofOfServiceDoc {
uploads := make([]*primev2messages.UploadWithOmissions, len(proofOfServiceDoc.PrimeUploads))
if proofOfServiceDoc.PrimeUploads != nil && len(proofOfServiceDoc.PrimeUploads) > 0 {
if len(proofOfServiceDoc.PrimeUploads) > 0 {
for i, primeUpload := range proofOfServiceDoc.PrimeUploads { //#nosec G601 new in 1.22.2
uploads[i] = basicUpload(&primeUpload.Upload)
}
Expand All @@ -278,7 +278,7 @@ func PaymentRequest(paymentRequest *models.PaymentRequest) *primev2messages.Paym

serviceDocs := make(primev2messages.ProofOfServiceDocs, len(paymentRequest.ProofOfServiceDocs))

if paymentRequest.ProofOfServiceDocs != nil && len(paymentRequest.ProofOfServiceDocs) > 0 {
if len(paymentRequest.ProofOfServiceDocs) > 0 {
for i, proofOfService := range paymentRequest.ProofOfServiceDocs {
serviceDocs[i] = ProofOfServiceDoc(proofOfService)
}
Expand Down Expand Up @@ -389,7 +389,7 @@ func PaymentServiceItemParams(paymentServiceItemParams *models.PaymentServiceIte

func ServiceRequestDocument(serviceRequestDocument models.ServiceRequestDocument) *primev2messages.ServiceRequestDocument {
uploads := make([]*primev2messages.UploadWithOmissions, len(serviceRequestDocument.ServiceRequestDocumentUploads))
if serviceRequestDocument.ServiceRequestDocumentUploads != nil && len(serviceRequestDocument.ServiceRequestDocumentUploads) > 0 {
if len(serviceRequestDocument.ServiceRequestDocumentUploads) > 0 {
for i, proofOfServiceDocumentUpload := range serviceRequestDocument.ServiceRequestDocumentUploads { //#nosec G601 new in 1.22.2
uploads[i] = basicUpload(&proofOfServiceDocumentUpload.Upload)
}
Expand Down Expand Up @@ -633,7 +633,7 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) primev2messages.MTOSe

serviceRequestDocuments := make(primev2messages.ServiceRequestDocuments, len(mtoServiceItem.ServiceRequestDocuments))

if mtoServiceItem.ServiceRequestDocuments != nil && len(mtoServiceItem.ServiceRequestDocuments) > 0 {
if len(mtoServiceItem.ServiceRequestDocuments) > 0 {
for i, serviceRequestDocument := range mtoServiceItem.ServiceRequestDocuments {
serviceRequestDocuments[i] = ServiceRequestDocument(serviceRequestDocument)
}
Expand Down
Loading
Loading