Skip to content

Commit

Permalink
chore: bump entgo.io/contrib from 0.5.0 to 0.6.0 in /api (#3458)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Lokshin <alokshin@chanzuckerberg.com>
Co-authored-by: alexlokshin-czi <alexlokshin-czi@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 29, 2025
1 parent 79781a6 commit c6d7b8a
Show file tree
Hide file tree
Showing 22 changed files with 220 additions and 269 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/api-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ jobs:
working-directory: api
run: go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.63.4
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --timeout 10m0s --out-format=tab
args: --timeout 20m0s --out-format=tab -v
skip-pkg-cache: true
working-directory: api
test-api:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cli-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
run: |
cd cli && go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.63.4
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --timeout 10m0s --out-format=tab
args: --timeout 20m0s --out-format=tab -v
working-directory: cli
skip-pkg-cache: true

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/hvm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
working-directory: hvm
run: go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.63.4
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --timeout 10m0s
args: --timeout 20m0s -v
working-directory: hvm
skip-pkg-cache: true

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/provider-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
go-version-file: terraform/provider/go.mod
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.63.4
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --timeout 10m0s
args: --timeout 20m0s -v
working-directory: terraform/provider
skip-pkg-cache: true

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
run: |
cd shared && go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.63.4
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --timeout 10m0s
args: --timeout 20m0s -v
working-directory: shared
skip-pkg-cache: true

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.api
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine AS builder
FROM golang:1.23-alpine AS builder

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

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

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

Expand Down
49 changes: 13 additions & 36 deletions api/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,30 @@

# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
linters:
enable:
- deadcode
- errcheck
- errorlint
- forbidigo
- gci
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- whitespace

linters-settings:
forbidigo:
# These are forbidden in non-test files
# If you have mock functions,etc that are meant to be used in tests
# please add them here
# If you have mock functions,etc that are meant to be used in tests please add them here
forbid:
- ^fmt\.Errorf$
- ^fmt\.Print.*$
- ^spew\.Dump$
- ^println$
depguard:
list-type: denylist
include-go-root: true
packages-with-error-message:
- errors: "please use github.com/pkg/errors instead"
- golang.org/x/xerrors: "please use github.com/pkg/errors instead"
- gopkg.in/yaml.v2: "please use gopkg.in/yaml.v3 instead"
additional-guards:
# Do not allow test code into "real" code
- list-type: denylist
include-go-root: false
packages:
- github.com/stretchr/testify
- github.com/happy/pkg/backend/aws/testbackend
ignore-file-rules:
- "**/*_test.go"
- "**/mock/**/*.go"
- "pkg/backend/aws/testbackend/*.go"

issues:
fix: true
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- forbidigo

output:
formats:
- format: tab
show-stats: true

run:
timeout: 20m
10 changes: 5 additions & 5 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/chanzuckerberg/happy/api

go 1.22.0
go 1.23.0

toolchain go1.22.10
toolchain go1.23.5

require (
entgo.io/contrib v0.5.0
entgo.io/ent v0.13.1
entgo.io/contrib v0.6.0
entgo.io/ent v0.13.2-0.20240717044502-34158f2c129b
github.com/aws/aws-sdk-go-v2 v1.34.0
github.com/aws/aws-sdk-go-v2/config v1.18.44
github.com/blang/semver v3.5.1+incompatible
Expand Down Expand Up @@ -49,7 +49,7 @@ require (
)

require (
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 // indirect
ariga.io/atlas v0.25.1-0.20240717145915-af51d3945208 // indirect
cirello.io/dynamolock/v2 v2.1.0 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AlecAivazis/survey/v2 v2.3.7 // indirect
Expand Down
12 changes: 6 additions & 6 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 h1:GwdJbXydHCYPedeeLt4x/lrlIISQ4JTH1mRWuE5ZZ14=
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43/go.mod h1:uj3pm+hUTVN/X5yfdBexHlZv+1Xu5u5ZbZx7+CDavNU=
ariga.io/atlas v0.25.1-0.20240717145915-af51d3945208 h1:ixs1c/fAXGS3mTdalyKQrtvfkFjgChih/unX66YTzYk=
ariga.io/atlas v0.25.1-0.20240717145915-af51d3945208/go.mod h1:KPLc7Zj+nzoXfWshrcY1RwlOh94dsATQEy4UPrF2RkM=
cirello.io/dynamolock/v2 v2.1.0 h1:e6LzkovE5gNZwswiApUj/LPkLRguXvxgpRi/IO9dl5o=
cirello.io/dynamolock/v2 v2.1.0/go.mod h1:HG0kb97+cRxO9Ce+3brresQgLGSGKPbnNLnJJr4ieYo=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
entgo.io/contrib v0.5.0 h1:M4IqodImfUm327RDwNAITLNz3PsxVeC3rD4DPeVA8Gs=
entgo.io/contrib v0.5.0/go.mod h1:q8dXQCmzqpSlVdT2bWDydjgznGcy3y4zmsYmVFC9V/U=
entgo.io/ent v0.13.1 h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=
entgo.io/ent v0.13.1/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
entgo.io/contrib v0.6.0 h1:xfo4TbJE7sJZWx7BV7YrpSz7IPFvS8MzL3fnfzZjKvQ=
entgo.io/contrib v0.6.0/go.mod h1:3qWIseJ/9Wx2Hu5zVh15FDzv7d/UvKNcYKdViywWCQg=
entgo.io/ent v0.13.2-0.20240717044502-34158f2c129b h1:kC+uzL8UFWwtXQ+yY0wUdvVUgPlJPGU3Fx1uttM8PJA=
entgo.io/ent v0.13.2-0.20240717044502-34158f2c129b/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
Expand Down
4 changes: 2 additions & 2 deletions api/pkg/api/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestVersionCheckSucceed(t *testing.T) {
"happy-cli/%s",
func() string {
ver := semver.MustParse(request.MinimumVersions["happy-cli"])
ver.Minor = ver.Minor + 1
ver.Minor++
return ver.String()
}(),
),
Expand Down Expand Up @@ -104,7 +104,7 @@ func TestVersionCheckFail(t *testing.T) {
"happy-cli/%s",
func() string {
ver := semver.MustParse(request.MinimumVersions["happy-cli"])
ver.Minor = ver.Minor - 1
ver.Minor--
return ver.String()
}(),
),
Expand Down
21 changes: 11 additions & 10 deletions api/pkg/ent/appconfig_query.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/pkg/ent/runtime/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/pkg/request/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func MakeVerifierFromConfig(ctx context.Context, cfg *setup.Configuration) OIDCV
func MakeFiberAuthMiddleware(verifier OIDCVerifier) fiber.Handler {
return func(c *fiber.Ctx) error {
authHeader := c.GetReqHeaders()[fiber.HeaderAuthorization]
if len(authHeader) <= 0 || len(authHeader[0]) <= 0 {
if len(authHeader) == 0 || len(authHeader[0]) == 0 {
return response.AuthErrorResponse(c, "missing auth header")
}

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

Expand Down
15 changes: 0 additions & 15 deletions cli/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
linters:
enable:
- deadcode
- errcheck
- errorlint
- forbidigo
- gci
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- whitespace

linters-settings:
forbidigo:
Expand Down
4 changes: 1 addition & 3 deletions cli/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
go 1.22.0

toolchain go1.22.7
go 1.23.0

module github.com/chanzuckerberg/happy/cli

Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/log/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error) {
levelColor = color.FgHiBlack
}

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

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

Expand Down
Loading

0 comments on commit c6d7b8a

Please sign in to comment.