Skip to content

Commit

Permalink
Upgrade gqlgenc and regenerate stash-box client (#5391)
Browse files Browse the repository at this point in the history
* Upgrade gqlgenc and regenerate stash-box client
* Fix go version
* Don't generate resolvers
* Bump go version in compiler image. Bump freebsd version
  • Loading branch information
WithoutPants authored Oct 29, 2024
1 parent f949fab commit 89f539e
Show file tree
Hide file tree
Showing 12 changed files with 1,194 additions and 569 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

env:
COMPILER_IMAGE: stashapp/compiler:9
COMPILER_IMAGE: stashapp/compiler:10

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
COMPILER_IMAGE: stashapp/compiler:9
COMPILER_IMAGE: stashapp/compiler:10

jobs:
golangci:
Expand Down
6 changes: 3 additions & 3 deletions docker/compiler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22
FROM golang:1.22.8

LABEL maintainer="https://discord.gg/2TsNFKt"

Expand Down Expand Up @@ -26,9 +26,9 @@ RUN apt-get update && \

# FreeBSD cross-compilation setup
# https://github.com/smartmontools/docker-build/blob/6b8c92560d17d325310ba02d9f5a4b250cb0764a/Dockerfile#L66
ENV FREEBSD_VERSION 12.4
ENV FREEBSD_VERSION 13.4
ENV FREEBSD_DOWNLOAD_URL http://ftp.plusline.de/FreeBSD/releases/amd64/${FREEBSD_VERSION}-RELEASE/base.txz
ENV FREEBSD_SHA 581c7edacfd2fca2bdf5791f667402d22fccd8a5e184635e0cac075564d57aa8
ENV FREEBSD_SHA 8e13b0a93daba349b8d28ad246d7beb327659b2ef4fe44d89f447392daec5a7c

RUN cd /tmp && \
curl -o base.txz $FREEBSD_DOWNLOAD_URL && \
Expand Down
2 changes: 1 addition & 1 deletion docker/compiler/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
user=stashapp
repo=compiler
version=9
version=10

latest:
docker build -t ${user}/${repo}:latest .
Expand Down
32 changes: 16 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/stashapp/stash

go 1.22
go 1.22.8

require (
github.com/99designs/gqlgen v0.17.49
github.com/99designs/gqlgen v0.17.55
github.com/WithoutPants/sortorder v0.0.0-20230616003020-921c9ef69552
github.com/Yamashou/gqlgenc v0.0.6
github.com/Yamashou/gqlgenc v0.25.3
github.com/anacrolix/dms v1.2.2
github.com/antchfx/htmlquery v1.3.0
github.com/asticode/go-astisub v0.25.1
Expand Down Expand Up @@ -47,27 +47,27 @@ require (
github.com/tidwall/gjson v1.16.0
github.com/vearutop/statigz v1.4.0
github.com/vektah/dataloaden v0.3.0
github.com/vektah/gqlparser/v2 v2.5.16
github.com/vektah/gqlparser/v2 v2.5.18
github.com/vektra/mockery/v2 v2.10.0
github.com/xWTF/chardet v0.0.0-20230208095535-c780f2ac244e
github.com/zencoder/go-dash/v3 v3.0.2
golang.org/x/crypto v0.24.0
golang.org/x/crypto v0.28.0
golang.org/x/image v0.18.0
golang.org/x/net v0.26.0
golang.org/x/sys v0.21.0
golang.org/x/term v0.21.0
golang.org/x/text v0.16.0
golang.org/x/net v0.30.0
golang.org/x/sys v0.26.0
golang.org/x/term v0.25.0
golang.org/x/text v0.19.0
gopkg.in/guregu/null.v4 v4.0.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/agnivade/levenshtein v1.2.0 // indirect
github.com/antchfx/xpath v1.2.3 // indirect
github.com/asticode/go-astikit v0.20.0 // indirect
github.com/asticode/go-astits v1.8.0 // indirect
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand Down Expand Up @@ -108,12 +108,12 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/urfave/cli/v2 v2.27.2 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
github.com/urfave/cli/v2 v2.27.5 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/tools v0.26.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
88 changes: 34 additions & 54 deletions go.sum

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ exec:
filename: internal/api/generated_exec.go
model:
filename: internal/api/generated_models.go
resolver:
filename: internal/api/resolver.go
type: Resolver

struct_tag: gqlgen

Expand Down
3 changes: 2 additions & 1 deletion internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/go-chi/httplog"
"github.com/gorilla/websocket"
"github.com/vearutop/statigz"
"github.com/vektah/gqlparser/v2/ast"

"github.com/stashapp/stash/internal/api/loaders"
"github.com/stashapp/stash/internal/build"
Expand Down Expand Up @@ -185,7 +186,7 @@ func Initialize() (*Server, error) {
MaxUploadSize: cfg.GetMaxUploadSize(),
})

gqlSrv.SetQueryCache(gqlLru.New(1000))
gqlSrv.SetQueryCache(gqlLru.New[*ast.QueryDocument](1000))
gqlSrv.Use(gqlExtension.Introspection{})

gqlSrv.SetErrorPresenter(gqlErrorHandler)
Expand Down
4 changes: 2 additions & 2 deletions internal/manager/task_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ type handlerRequiredFilter struct {
GalleryFinder galleryFinder
CaptionUpdater video.CaptionUpdater

FolderCache *lru.LRU
FolderCache *lru.LRU[bool]

videoFileNamingAlgorithm models.HashAlgorithm
}
Expand All @@ -138,7 +138,7 @@ func newHandlerRequiredFilter(c *config.Config, repo models.Repository) *handler
ImageFinder: repo.Image,
GalleryFinder: repo.Gallery,
CaptionUpdater: repo.File,
FolderCache: lru.New(processes * 2),
FolderCache: lru.New[bool](processes * 2),
videoFileNamingAlgorithm: c.GetVideoFileNamingAlgorithm(),
}
}
Expand Down
Loading

0 comments on commit 89f539e

Please sign in to comment.