From f55d2b3587cc62bd44891c157c04e2932519afeb Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Tue, 21 May 2024 08:27:10 +0100 Subject: [PATCH 1/5] Update go to 1.22 --- .github/workflows/build.yml | 4 ++-- CONTRIBUTING.md | 2 +- Dockerfile | 2 +- go.mod | 4 ++-- go.sum | 6 ++++++ 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd0e9c16b..7a7f047de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,10 +49,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Use Go 1.19 + - name: Use Go 1.22 uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.22 - name: Use Node.js 18.x uses: actions/setup-node@v1 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4783199f7..25197445b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ If you know these technologies or would like to learn them, lucky you! This is t | Software | How to install | What is it used for | | ----------- | -------------------------------------------------------------- | --------------------------------------------------------- | -| Go 1.19+ | https://golang.org/ | To compile server side code | +| Go 1.22+ | https://golang.org/ | To compile server side code | | Node.js 18+ | https://nodejs.org/ or run `nvm use` if you have nvm installed | To compile TypeScript and bundle all the client side code | | Docker | https://www.docker.com/ | To start local PostgreSQL instances | diff --git a/Dockerfile b/Dockerfile index cc823a2ca..c276a3ce1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ##################### ### Server Build Step ##################### -FROM --platform=${TARGETPLATFORM:-linux/amd64} golang:1.19-bullseye AS server-builder +FROM --platform=${TARGETPLATFORM:-linux/amd64} golang:1.22-bullseye AS server-builder RUN mkdir /server diff --git a/go.mod b/go.mod index a44b25568..1595cafb2 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -// +heroku goVersion go1.19 +// +heroku goVersion go1.22 module github.com/getfider/fider -go 1.19 +go 1.22.0 require ( github.com/aws/aws-sdk-go v1.41.14 diff --git a/go.sum b/go.sum index b567b09d0..83602b71a 100644 --- a/go.sum +++ b/go.sum @@ -144,6 +144,7 @@ github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4 github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -301,6 +302,7 @@ github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3 github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= +github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gotnospirit/makeplural v0.0.0-20180622080156-a5f48d94d976 h1:b70jEaX2iaJSPZULSUxKtm73LBfsCrMsIlYCUgNGSIs= github.com/gotnospirit/makeplural v0.0.0-20180622080156-a5f48d94d976/go.mod h1:ZGQeOwybjD8lkCjIyJfqR5LD2wMVHJ31d6GdPxoTsWY= github.com/gotnospirit/messageformat v0.0.0-20190719172517-c1d0bdacdea2 h1:yUr520KXfjzq/QTGZ2h+DvEydkyBfvifw6ksyDW3Lpg= @@ -367,6 +369,7 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -445,7 +448,9 @@ github.com/nunnatsa/ginkgolinter v0.7.1/go.mod h1:jTgd60EAdXDmmIPZi+xoMDqAYo/4Aa github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.3.1 h1:8SbseP7qM32WcvE6VaN6vfXxv698izmsJ1UQX9ve7T8= +github.com/onsi/ginkgo/v2 v2.3.1/go.mod h1:Sv4yQXwG5VmF7tm3Q5Z+RWUpPo24LF1mpnz2crUb8Ys= github.com/onsi/gomega v1.22.1 h1:pY8O4lBfsHKZHM/6nrxkhVPUznOlIu3quZcKP/M20KI= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= @@ -510,6 +515,7 @@ github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= From 851b39e366edda2dea330ede10838ae156107a5d Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Tue, 21 May 2024 19:39:38 +0100 Subject: [PATCH 2/5] Node 18 -> 22 --- .github/workflows/build.yml | 18 +++++++++--------- .nvmrc | 2 +- CONTRIBUTING.md | 2 +- package-lock.json | 4 ++-- package.json | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a7f047de..7c3a7d74b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build +22: build on: push: @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js 18.x + - name: Use Node.js 22.x uses: actions/setup-node@v1 with: - node-version: 18.x + node-version: 22.x - run: npm ci - run: make lint-ui - run: make test-ui @@ -53,10 +53,10 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.22 - - name: Use Node.js 18.x + - name: Use Node.js 22.x uses: actions/setup-node@v1 with: - node-version: 18.x + node-version: 22.x - run: npm ci # required for esbuild - name: install golangci-lint run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.0 @@ -124,10 +124,10 @@ jobs: browser: ["chromium", "webkit", "firefox"] steps: - uses: actions/checkout@v2 - - name: Use Node.js 18.x + - name: Use Node.js 22.x uses: actions/setup-node@v1 with: - node-version: 18.x + node-version: 22.x - uses: actions/download-artifact@v2 with: name: fider-image @@ -178,10 +178,10 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v2 - - name: Use Node.js 18.x + - name: Use Node.js 22.x uses: actions/setup-node@v1 with: - node-version: 18.x + node-version: 22.x - uses: actions/download-artifact@v2 with: name: fider-image diff --git a/.nvmrc b/.nvmrc index f8824128a..1fba266e9 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.* +v22.* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25197445b..39f89154d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ If you know these technologies or would like to learn them, lucky you! This is t | Software | How to install | What is it used for | | ----------- | -------------------------------------------------------------- | --------------------------------------------------------- | | Go 1.22+ | https://golang.org/ | To compile server side code | -| Node.js 18+ | https://nodejs.org/ or run `nvm use` if you have nvm installed | To compile TypeScript and bundle all the client side code | +| Node.js 22+ | https://nodejs.org/ or run `nvm use` if you have nvm installed | To compile TypeScript and bundle all the client side code | | Docker | https://www.docker.com/ | To start local PostgreSQL instances | #### 2. To setup your development workspace: diff --git a/package-lock.json b/package-lock.json index 10ba18bd3..5c9407e75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,8 +67,8 @@ "webpack-cli": "4.9.2" }, "engines": { - "node": "16.x || 17.x", - "npm": "8.x" + "node": "21.x || 22.x", + "npm": "10.x" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index 660828f15..b3febf87d 100644 --- a/package.json +++ b/package.json @@ -116,8 +116,8 @@ } }, "engines": { - "npm": "8.x", - "node": "18.x || 19.x" + "npm": "10.x", + "node": "21.x || 22.x" }, "scripts": { "heroku-postbuild": "make build-ssr && make build-ui" From 4cd9c37b11b952385129d78bba3a72ae0a515af6 Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Wed, 22 May 2024 15:25:50 +0100 Subject: [PATCH 3/5] Fix build script. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c3a7d74b..618e4d05e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -22: build +name: build on: push: From 10ec8e381cdd4e590ea6b9077ec7b0e7d0054ee5 Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Mon, 8 Jul 2024 15:11:06 +0100 Subject: [PATCH 4/5] Update golint-ci --- .github/workflows/build.yml | 4 +++- CONTRIBUTING.md | 2 +- go.mod | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 618e4d05e..954c9d9a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: node-version: 22.x - run: npm ci # required for esbuild - name: install golangci-lint - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.0 + run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1 - name: install godotenv run: go install github.com/joho/godotenv/cmd/godotenv - run: make lint-server @@ -84,6 +84,8 @@ jobs: echo sha7=${GITHUB_SHA::7} id: vars + + - run: docker build -t fider-image . - run: mkdir -p ./out diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 39f89154d..3a2a569d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ If you know these technologies or would like to learn them, lucky you! This is t 2. navigate into the cloned repository. 3. run `go install github.com/cosmtrek/air` to install air, a cli tool for live reload, when you change the code, it automatically recompiles the application. 4. run `go install github.com/joho/godotenv/cmd/godotenv` to install godotenv, a cli tool to load environment variables from a `.env` so that you don't have to change your machine environment variables. -5. run `go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0` to install golangci-lint, a linter for Go apps. +5. run `go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1` to install golangci-lint, a linter for Go apps. 6. run `npm install` to install client side packages. 7. run `docker-compose up -d` to start a local PostgreSQL database and Local SMTP (with [MailHog](https://github.com/mailhog/MailHog)) on Docker. 8. run `cp .example.env .env` to create a local environment configuration file. diff --git a/go.mod b/go.mod index 1595cafb2..7f545033b 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/goenning/imagic v0.0.1 github.com/goenning/letteravatar v0.0.0-20180605200324-553181ed4055 github.com/golang-jwt/jwt/v4 v4.1.0 - github.com/golangci/golangci-lint v1.51.0 + github.com/golangci/golangci-lint v1.59.1 github.com/gomarkdown/markdown v0.0.0-20220527210340-c82b80a9daf2 github.com/gosimple/slug v1.11.0 github.com/gotnospirit/messageformat v0.0.0-20190719172517-c1d0bdacdea2 From d5ce6a0d92c2cc7ea279e971f5c62199ca441f09 Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Mon, 8 Jul 2024 15:14:02 +0100 Subject: [PATCH 5/5] More time for lint-server --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f8a5a24db..aeb0bc9cf 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ watch-ui: ## Build and run server in watch mode lint: lint-server lint-ui ## Lint server and ui lint-server: ## Lint server code - golangci-lint run --timeout 2m + golangci-lint run --timeout 3m lint-ui: ## Lint ui code npx eslint .