Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/api/entgo.io/ent-0.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlokshin-czi committed Jan 29, 2025
2 parents 600d968 + c6d7b8a commit c94d9dc
Show file tree
Hide file tree
Showing 23 changed files with 229 additions and 275 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
6 changes: 3 additions & 3 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23.0
toolchain go1.23.5

require (
entgo.io/contrib v0.5.0
entgo.io/contrib v0.6.0
entgo.io/ent v0.14.1
github.com/aws/aws-sdk-go-v2 v1.34.0
github.com/aws/aws-sdk-go-v2/config v1.18.44
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 Expand Up @@ -184,7 +184,7 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
Expand Down
14 changes: 9 additions & 5 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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=
Expand All @@ -8,6 +8,10 @@ entgo.io/contrib v0.5.0 h1:M4IqodImfUm327RDwNAITLNz3PsxVeC3rD4DPeVA8Gs=
entgo.io/contrib v0.5.0/go.mod h1:q8dXQCmzqpSlVdT2bWDydjgznGcy3y4zmsYmVFC9V/U=
entgo.io/ent v0.14.1 h1:fUERL506Pqr92EPHJqr8EYxbPioflJo6PudkrEA8a/s=
entgo.io/ent v0.14.1/go.mod h1:MH6XLG0KXpkcDQhKiHfANZSzR55TJyPL5IGNpI8wpco=
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 Expand Up @@ -112,7 +116,7 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/coreos/go-oidc/v3 v3.12.0 h1:sJk+8G2qq94rDI6ehZ71Bol3oUHy63qNYmkiSjrc/Jo=
github.com/coreos/go-oidc/v3 v3.12.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
Expand Down Expand Up @@ -421,8 +425,8 @@ github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
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
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
14 changes: 10 additions & 4 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ source "https://rubygems.org"
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# NOTE(elopez): commenting version out per https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll
# gem "jekyll", "~> 4.2.0"
# gem "jekyll", "~> 4.3.3"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", "~> 214", group: :jekyll_plugins
gem "github-pages", "~> 231", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
Expand All @@ -22,10 +21,17 @@ end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", "~> 1.2"
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem "webrick", "~> 1.8"

gem "just-the-docs", "~> 0.8.2"
Loading

0 comments on commit c94d9dc

Please sign in to comment.