Skip to content

Commit 92f33b2

Browse files
Merge branch 'main' into sfitzgerald/add-samesite-sticky-session-cookie
2 parents 7441ead + 2759a5e commit 92f33b2

25 files changed

+316
-314
lines changed

.github/workflows/api-ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ jobs:
6161
working-directory: api
6262
run: go mod tidy
6363
- name: golangci-lint
64-
uses: golangci/golangci-lint-action@v3
64+
uses: golangci/golangci-lint-action@v6
6565
with:
66-
version: v1.56.2
66+
version: v1.63.4
6767
github-token: ${{ secrets.GITHUB_TOKEN }}
68-
args: --timeout 10m0s --out-format=tab
68+
args: --timeout 20m0s --out-format=tab -v
6969
skip-pkg-cache: true
7070
working-directory: api
7171
test-api:

.github/workflows/cli-ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
run: |
3737
cd cli && go mod tidy
3838
- name: golangci-lint
39-
uses: golangci/golangci-lint-action@v3
39+
uses: golangci/golangci-lint-action@v6
4040
with:
41-
version: v1.56.2
41+
version: v1.63.4
4242
github-token: ${{ secrets.GITHUB_TOKEN }}
43-
args: --timeout 10m0s --out-format=tab
43+
args: --timeout 20m0s --out-format=tab -v
4444
working-directory: cli
4545
skip-pkg-cache: true
4646

.github/workflows/hvm-ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
working-directory: hvm
3737
run: go mod tidy
3838
- name: golangci-lint
39-
uses: golangci/golangci-lint-action@v3
39+
uses: golangci/golangci-lint-action@v6
4040
with:
41-
version: v1.56.2
41+
version: v1.63.4
4242
github-token: ${{ secrets.GITHUB_TOKEN }}
43-
args: --timeout 10m0s
43+
args: --timeout 20m0s -v
4444
working-directory: hvm
4545
skip-pkg-cache: true
4646

.github/workflows/provider-ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ jobs:
3434
go-version-file: terraform/provider/go.mod
3535
cache: true
3636
- name: golangci-lint
37-
uses: golangci/golangci-lint-action@v3
37+
uses: golangci/golangci-lint-action@v6
3838
with:
39-
version: v1.56.2
39+
version: v1.63.4
4040
github-token: ${{ secrets.GITHUB_TOKEN }}
41-
args: --timeout 10m0s
41+
args: --timeout 20m0s -v
4242
working-directory: terraform/provider
4343
skip-pkg-cache: true
4444

.github/workflows/shared-ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
run: |
3838
cd shared && go mod tidy
3939
- name: golangci-lint
40-
uses: golangci/golangci-lint-action@v3
40+
uses: golangci/golangci-lint-action@v6
4141
with:
42-
version: v1.56.2
42+
version: v1.63.4
4343
github-token: ${{ secrets.GITHUB_TOKEN }}
44-
args: --timeout 10m0s
44+
args: --timeout 20m0s -v
4545
working-directory: shared
4646
skip-pkg-cache: true
4747

Dockerfile.api

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22-alpine AS builder
1+
FROM golang:1.23-alpine AS builder
22

33
RUN apk update && apk add --no-cache git gcc
44
RUN apk add --no-cache sqlite-libs sqlite-dev
@@ -20,7 +20,7 @@ RUN --mount=type=cache,mode=0755,target=/go/pkg/mod GO111MODULE=on CGO_ENABLED=0
2020

2121
# --------------------------------------------------------------------------------------------------
2222

23-
FROM golang:1.22-alpine
23+
FROM golang:1.23-alpine
2424
COPY --from=builder /code/api/dist/happy-api .
2525
COPY --from=builder /code/api/app-config*.yaml .
2626

api/.golangci.yml

+13-36
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,30 @@
1+
2+
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
13
linters:
24
enable:
3-
- deadcode
4-
- errcheck
5-
- errorlint
65
- forbidigo
7-
- gci
8-
- gofmt
9-
- goimports
10-
- gosimple
11-
- govet
12-
- ineffassign
13-
- staticcheck
14-
- structcheck
15-
- typecheck
16-
- unused
17-
- varcheck
18-
- whitespace
196

207
linters-settings:
218
forbidigo:
229
# These are forbidden in non-test files
23-
# If you have mock functions,etc that are meant to be used in tests
24-
# please add them here
10+
# If you have mock functions,etc that are meant to be used in tests please add them here
2511
forbid:
26-
- ^fmt\.Errorf$
2712
- ^fmt\.Print.*$
2813
- ^spew\.Dump$
2914
- ^println$
30-
depguard:
31-
list-type: denylist
32-
include-go-root: true
33-
packages-with-error-message:
34-
- errors: "please use github.com/pkg/errors instead"
35-
- golang.org/x/xerrors: "please use github.com/pkg/errors instead"
36-
- gopkg.in/yaml.v2: "please use gopkg.in/yaml.v3 instead"
37-
additional-guards:
38-
# Do not allow test code into "real" code
39-
- list-type: denylist
40-
include-go-root: false
41-
packages:
42-
- github.com/stretchr/testify
43-
- github.com/happy/pkg/backend/aws/testbackend
44-
ignore-file-rules:
45-
- "**/*_test.go"
46-
- "**/mock/**/*.go"
47-
- "pkg/backend/aws/testbackend/*.go"
15+
4816
issues:
17+
fix: true
4918
exclude-rules:
5019
# Exclude some linters from running on tests files.
5120
- path: _test\.go
5221
linters:
5322
- forbidigo
23+
24+
output:
25+
formats:
26+
- format: tab
27+
show-stats: true
28+
29+
run:
30+
timeout: 20m

api/go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module github.com/chanzuckerberg/happy/api
22

3-
go 1.22.0
3+
go 1.23.0
44

5-
toolchain go1.22.10
5+
toolchain go1.23.5
66

77
require (
8-
entgo.io/contrib v0.5.0
9-
entgo.io/ent v0.13.1
8+
entgo.io/contrib v0.6.0
9+
entgo.io/ent v0.14.1
1010
github.com/aws/aws-sdk-go-v2 v1.34.0
1111
github.com/aws/aws-sdk-go-v2/config v1.18.44
1212
github.com/blang/semver v3.5.1+incompatible
@@ -49,7 +49,7 @@ require (
4949
)
5050

5151
require (
52-
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 // indirect
52+
ariga.io/atlas v0.25.1-0.20240717145915-af51d3945208 // indirect
5353
cirello.io/dynamolock/v2 v2.1.0 // indirect
5454
dario.cat/mergo v1.0.0 // indirect
5555
github.com/AlecAivazis/survey/v2 v2.3.7 // indirect

api/go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 h1:GwdJbXydHCYPedeeLt4x/lrlIISQ4JTH1mRWuE5ZZ14=
2-
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43/go.mod h1:uj3pm+hUTVN/X5yfdBexHlZv+1Xu5u5ZbZx7+CDavNU=
1+
ariga.io/atlas v0.25.1-0.20240717145915-af51d3945208 h1:ixs1c/fAXGS3mTdalyKQrtvfkFjgChih/unX66YTzYk=
2+
ariga.io/atlas v0.25.1-0.20240717145915-af51d3945208/go.mod h1:KPLc7Zj+nzoXfWshrcY1RwlOh94dsATQEy4UPrF2RkM=
33
cirello.io/dynamolock/v2 v2.1.0 h1:e6LzkovE5gNZwswiApUj/LPkLRguXvxgpRi/IO9dl5o=
44
cirello.io/dynamolock/v2 v2.1.0/go.mod h1:HG0kb97+cRxO9Ce+3brresQgLGSGKPbnNLnJJr4ieYo=
55
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
66
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
7-
entgo.io/contrib v0.5.0 h1:M4IqodImfUm327RDwNAITLNz3PsxVeC3rD4DPeVA8Gs=
8-
entgo.io/contrib v0.5.0/go.mod h1:q8dXQCmzqpSlVdT2bWDydjgznGcy3y4zmsYmVFC9V/U=
9-
entgo.io/ent v0.13.1 h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=
10-
entgo.io/ent v0.13.1/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
7+
entgo.io/contrib v0.6.0 h1:xfo4TbJE7sJZWx7BV7YrpSz7IPFvS8MzL3fnfzZjKvQ=
8+
entgo.io/contrib v0.6.0/go.mod h1:3qWIseJ/9Wx2Hu5zVh15FDzv7d/UvKNcYKdViywWCQg=
9+
entgo.io/ent v0.14.1 h1:fUERL506Pqr92EPHJqr8EYxbPioflJo6PudkrEA8a/s=
10+
entgo.io/ent v0.14.1/go.mod h1:MH6XLG0KXpkcDQhKiHfANZSzR55TJyPL5IGNpI8wpco=
1111
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
1212
github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
1313
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=

api/pkg/api/app_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestVersionCheckSucceed(t *testing.T) {
6363
"happy-cli/%s",
6464
func() string {
6565
ver := semver.MustParse(request.MinimumVersions["happy-cli"])
66-
ver.Minor = ver.Minor + 1
66+
ver.Minor++
6767
return ver.String()
6868
}(),
6969
),
@@ -104,7 +104,7 @@ func TestVersionCheckFail(t *testing.T) {
104104
"happy-cli/%s",
105105
func() string {
106106
ver := semver.MustParse(request.MinimumVersions["happy-cli"])
107-
ver.Minor = ver.Minor - 1
107+
ver.Minor--
108108
return ver.String()
109109
}(),
110110
),

api/pkg/ent/appconfig_query.go

+11-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/pkg/ent/ent.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/pkg/ent/runtime/runtime.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/pkg/request/auth.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func MakeVerifierFromConfig(ctx context.Context, cfg *setup.Configuration) OIDCV
229229
func MakeFiberAuthMiddleware(verifier OIDCVerifier) fiber.Handler {
230230
return func(c *fiber.Ctx) error {
231231
authHeader := c.GetReqHeaders()[fiber.HeaderAuthorization]
232-
if len(authHeader) <= 0 || len(authHeader[0]) <= 0 {
232+
if len(authHeader) == 0 || len(authHeader[0]) == 0 {
233233
return response.AuthErrorResponse(c, "missing auth header")
234234
}
235235

@@ -246,7 +246,7 @@ func MakeFiberAuthMiddleware(verifier OIDCVerifier) fiber.Handler {
246246
func MakeOgentAuthMiddleware(verifier OIDCVerifier) ogent.Middleware {
247247
return func(req middleware.Request, next middleware.Next) (middleware.Response, error) {
248248
authHeader := req.Raw.Header.Get("Authorization")
249-
if len(authHeader) <= 0 {
249+
if len(authHeader) == 0 {
250250
return middleware.Response{}, response.NewForbiddenError("missing auth header")
251251
}
252252

cli/.golangci.yml

-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
linters:
22
enable:
3-
- deadcode
4-
- errcheck
5-
- errorlint
63
- forbidigo
7-
- gci
8-
- gofmt
9-
- goimports
10-
- gosimple
11-
- govet
12-
- ineffassign
13-
- staticcheck
14-
- structcheck
15-
- typecheck
16-
- unused
17-
- varcheck
18-
- whitespace
194

205
linters-settings:
216
forbidigo:

cli/go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
go 1.22.0
2-
3-
toolchain go1.22.7
1+
go 1.23.0
42

53
module github.com/chanzuckerberg/happy/cli
64

cli/pkg/log/formatter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error) {
3030
levelColor = color.FgHiBlack
3131
}
3232

33-
level := color.New(levelColor).Sprintf(strings.ToUpper(entry.Level.String()))
33+
level := color.New(levelColor).Sprintf("%s", strings.ToUpper(entry.Level.String()))
3434

3535
messageColorizer := color.New(color.FgHiBlack).Sprintf
3636

0 commit comments

Comments
 (0)