Skip to content

Commit

Permalink
Fix build and upgrade tooling (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash authored Feb 15, 2024
1 parent 4367766 commit 04c2953
Show file tree
Hide file tree
Showing 10 changed files with 5,611 additions and 3,114 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ concurrency:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
image: postgres:14.2
image: postgres:16.1
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -41,12 +41,12 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.22.x

- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '20'

- name: Cache node modules
uses: actions/cache@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
golangci:
name: lint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand All @@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.22.x

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ linters-settings:
enabled: true
- name: increment-decrement
- name: var-naming
arguments:
- ["IDS"] # AllowList
- name: var-declaration
- name: package-comments
- name: range
Expand Down
33 changes: 17 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/stashapp/stash-box

go 1.20
go 1.22

require (
github.com/99designs/gqlgen v0.17.24
github.com/99designs/gqlgen v0.17.44
github.com/disintegration/imaging v1.6.2
github.com/go-chi/chi/v5 v5.0.8
github.com/gofrs/uuid v4.3.1+incompatible
Expand All @@ -22,30 +22,30 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/vektah/dataloaden v0.3.0
github.com/vektah/gqlparser/v2 v2.5.1
github.com/vektah/gqlparser/v2 v2.5.11
go.deanishe.net/favicon v0.1.0
golang.org/x/crypto v0.6.0
golang.org/x/crypto v0.18.0
golang.org/x/image v0.5.0
golang.org/x/net v0.7.0
golang.org/x/sync v0.1.0
golang.org/x/net v0.20.0
golang.org/x/sync v0.6.0
gotest.tools/v3 v3.4.0
)

require (
github.com/PuerkitoBio/goquery v1.6.0 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/andybalholm/cascadia v1.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/friendsofgo/errors v0.9.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
Expand All @@ -58,17 +58,18 @@ require (
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sosodev/duration v1.2.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/urfave/cli/v2 v2.8.1 // indirect
github.com/urfave/cli/v2 v2.27.1 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.1.12 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
79 changes: 41 additions & 38 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/api/resolver_model_scene_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ func (r *sceneEditResolver) Tags(ctx context.Context, obj *models.SceneEdit) ([]
return nil, err
}

tagIds, err := fac.Scene().GetEditTags(id, obj)
tagIDs, err := fac.Scene().GetEditTags(id, obj)
if err != nil {
return nil, err
}

tags, errs := fac.Tag().FindByIds(tagIds)
tags, errs := fac.Tag().FindByIds(tagIDs)
if len(errs) > 0 {
return nil, errs[0]
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/api/resolver_query_find_scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ func (r *queryResolver) FindScenesBySceneFingerprints(ctx context.Context, scene
}

// Find ids for all scenes matching a fingerprint
sceneIds, err := qb.FindIdsBySceneFingerprints(fingerprints)
sceneIDs, err := qb.FindIdsBySceneFingerprints(fingerprints)
if err != nil {
return nil, err
}

var ids []uuid.UUID
for _, id := range sceneIds {
for _, id := range sceneIDs {
ids = append(ids, id...)
}

Expand All @@ -100,7 +100,7 @@ func (r *queryResolver) FindScenesBySceneFingerprints(ctx context.Context, scene
for i, scene := range sceneFingerprints {
sceneIDMap := make(map[uuid.UUID]bool)
for _, fp := range scene {
for _, id := range sceneIds[fp.Hash] {
for _, id := range sceneIDs[fp.Hash] {
sceneIDMap[id] = true
}
}
Expand Down
Loading

0 comments on commit 04c2953

Please sign in to comment.