Skip to content

Commit

Permalink
chore: update dependencies (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop authored Feb 1, 2024
1 parent c5c23f1 commit 43644e8
Show file tree
Hide file tree
Showing 47 changed files with 2,249 additions and 462 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/gen_schedule_update_deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: "gen: update depenendencies"
on:
schedule:
- cron: '0 2 1 * *'

jobs:
run:
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write
pull-requests: write

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure aws
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}:role/github-actions-nhost-be
aws-region: eu-central-1

- uses: nixbuild/nix-quick-install-action@v26
with:
nix_version: 2.16.2
nix_conf: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
- name: Cache nix store
uses: actions/cache@v4
with:
path: /nix
key: nix-update-deps-${{ hashFiles('flakes.nix', 'flake.lock') }}

- name: Update nix flakes
run: nix flake update

- name: Update golang dependencies
run: |
nix develop -c bash -c "
go mod tidy
go get -u ./...
go mod tidy
go mod vendor
"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update dependencies
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: automated/update-deps
delete-branch: true
title: '[Scheduled] Update dependencies'
body: |
Dependencies updated
Note - If you see this PR and the checks haven't run, close and reopen the PR. See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
labels: |
dependencies
draft: false

- name: "Cache nix store on s3"
run: |
echo ${{ secrets.NIX_CACHE_PRIV_KEY }} > cache-priv-key.pem
nix build .\#devShells.x86_64-linux.default
nix store sign --key-file cache-priv-key.pem --all
nix copy --to s3://nhost-nix-cache\?region=eu-central-1 .\#devShells.x86_64-linux.default
- run: rm cache-priv-key.pem
if: always()
9 changes: 7 additions & 2 deletions client/delete_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ func (c *Client) DeleteFile(
ctx context.Context,
fileID string,
) error {
req, err := http.NewRequestWithContext(ctx, "DELETE", c.baseURL+"/files/"+fileID, nil)
req, err := http.NewRequestWithContext(
ctx,
"DELETE",
c.baseURL+"/files/"+fileID, //nolint:goconst
nil,
)
if err != nil {
return fmt.Errorf("problem creating request: %w", err)
}
req.Header.Set("Authorization", "Bearer "+c.jwt)
req.Header.Set("Authorization", "Bearer "+c.jwt) //nolint:goconst

resp, err := c.httpClient.Do(req)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions client/get_file_information.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ func WithIfUnmodifiedSince(modifiedSince string) GetFileInformationOpt {
func WithImageSize(newSizeX, newSizeY int) GetFileInformationOpt {
return func(req *http.Request) {
q := req.URL.Query()
q.Add("w", fmt.Sprintf("%d", newSizeX))
q.Add("h", fmt.Sprintf("%d", newSizeY))
q.Add("w", strconv.Itoa(newSizeX))
q.Add("h", strconv.Itoa(newSizeY))
req.URL.RawQuery = q.Encode()
}
}

func WithImageQuality(quality int) GetFileInformationOpt {
return func(req *http.Request) {
q := req.URL.Query()
q.Add("q", fmt.Sprintf("%d", quality))
q.Add("q", strconv.Itoa(quality))
req.URL.RawQuery = q.Encode()
}
}

func WithImageBlur(blur int) GetFileInformationOpt {
return func(req *http.Request) {
q := req.URL.Query()
q.Add("b", fmt.Sprintf("%d", blur))
q.Add("b", strconv.Itoa(blur))
req.URL.RawQuery = q.Encode()
}
}
Expand Down
3 changes: 2 additions & 1 deletion controller/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"net/http"
"net/url"
"strconv"
"time"

"github.com/gin-gonic/gin"
Expand Down Expand Up @@ -69,7 +70,7 @@ func (r *FileResponse) Write(ctx *gin.Context) {

if r.statusCode != http.StatusNotModified {
// https://www.rfc-editor.org/rfc/rfc7232#section-4.1
ctx.Header("Content-Length", fmt.Sprintf("%d", r.contentLength))
ctx.Header("Content-Length", strconv.FormatInt(r.contentLength, 10))
ctx.Header("Content-Type", r.contentType)
ctx.Header("Surrogate-Key", r.fileID)
ctx.Header("Last-modified", r.lastModified)
Expand Down
24 changes: 12 additions & 12 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
let
localOverlay = import ./nix/overlay.nix;
overlays = [
localOverlay
nixops.overlays.default
localOverlay
];
pkgs = import nixpkgs {
inherit system overlays;
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ module github.com/nhost/hasura-storage
go 1.21

require (
github.com/Yamashou/gqlgenc v0.16.2
github.com/Yamashou/gqlgenc v0.17.0
github.com/aws/aws-sdk-go-v2 v1.24.1
github.com/aws/aws-sdk-go-v2/config v1.26.3
github.com/aws/aws-sdk-go-v2/credentials v1.16.14
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.0
github.com/aws/aws-sdk-go-v2/config v1.26.6
github.com/aws/aws-sdk-go-v2/credentials v1.16.16
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1
github.com/davidbyttow/govips/v2 v2.13.0
github.com/gabriel-vasile/mimetype v1.4.3
github.com/gin-contrib/cors v1.5.0
github.com/gin-gonic/gin v1.9.1
github.com/golang-jwt/jwt/v5 v5.2.0
github.com/golang-migrate/migrate/v4 v4.17.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.5.0
github.com/google/uuid v1.6.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand All @@ -25,19 +25,19 @@ require (
)

require (
github.com/99designs/gqlgen v0.17.42 // indirect
github.com/99designs/gqlgen v0.17.43 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.18.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect
github.com/aws/smithy-go v1.19.0 // indirect
github.com/bytedance/sonic v1.10.2 // indirect
Expand All @@ -47,15 +47,15 @@ require (
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.16.0 // indirect
github.com/go-playground/validator/v10 v10.17.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/leodido/go-urn v1.3.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand All @@ -73,13 +73,13 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/vektah/gqlparser/v2 v2.5.10 // indirect
github.com/vektah/gqlparser/v2 v2.5.11 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e // indirect
golang.org/x/image v0.5.0 // indirect
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
Expand Down
Loading

0 comments on commit 43644e8

Please sign in to comment.