Skip to content

Commit

Permalink
[MM-60187] Update Golang to v1.22 (#866)
Browse files Browse the repository at this point in the history
* Update Golang to v1.22

* Bump sister dependencies

* Update README
  • Loading branch information
streamer45 authored Oct 1, 2024
1 parent 07abe87 commit 1909e4b
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 54 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,26 @@ jobs:
plugin-ci:
uses: mattermost/actions-workflows/.github/workflows/plugin-ci.yml@0142d75f52214c0bdc625c9cbbb6c832874eb683
with:
golangci-lint-version: "v1.57.2"
golang-version: "1.21"
golangci-lint-version: "v1.61.0"
golang-version: "1.22"
secrets: inherit

lt:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
- name: Install system dependencies
shell: bash
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libopus-dev libopusfile-dev
- name: Install golangci-lint
shell: bash
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Run linter
shell: bash
run: cd ./lt && golangci-lint run ./...
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
working-directory: ./lt
14 changes: 7 additions & 7 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: e2e/checkout-mattermost-plugin-calls-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: e2e/setup-go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: e2e/setup-node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
Expand All @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: e2e/checkout-transcriber-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v4
with:
repository: mattermost/calls-transcriber
path: calls-transcriber
Expand Down Expand Up @@ -111,10 +111,10 @@ jobs:
matrix: ${{ fromJson(needs.generate-matrix.outputs.parallelism-matrix) }}
steps:
- name: e2e/checkout-mattermost-plugin-calls-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v4

- name: e2e/checkout-mattermost-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v4
with:
repository: mattermost/mattermost
path: mattermost
Expand All @@ -123,7 +123,7 @@ jobs:
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: e2e/setup-go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
uses: actions/setup-go@v5
with:
go-version-file: mattermost/server/go.mod

Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linters:
- ineffassign # Detects when assignments to existing variables are not used
- unconvert # Removes unnecessary type conversions
- unused # Checks Go code for unused constants, variables, functions and types
- exportloopref # Checks for pointers to enclosing loop variables
- copyloopvar # Checks for pointers to enclosing loop variables
- errcheck # Detects unchecked errors
- misspell # Finds commonly misspelled English words
- goimports # Check import statements are formatted according to the 'goimports' command
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ This plugin demands some network configuration changes to allow audio/video comm

## Documentation

[End-user documentation](https://docs.mattermost.com/channels/make-calls.html)
[Calls self-hosted deployment](https://docs.mattermost.com/configure/calls-deployment.html)
[Configuration settings](https://docs.mattermost.com/configure/plugins-configuration-settings.html#calls)
[End-user documentation](https://docs.mattermost.com/channels/make-calls.html)
[Calls self-hosted deployment](https://docs.mattermost.com/configure/calls-deployment.html)
[Configuration settings](https://docs.mattermost.com/configure/plugins-configuration-settings.html#calls)

## Development

> **_Note_**
>
> Building the plugin requires the following:
> - Golang: version >= **1.21**
> - Golang: version >= **1.22**
> - NodeJS: version **20.11**
> - NPM: version **10.x**
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/mattermost/mattermost-plugin-calls

go 1.21.9
go 1.22.7

require (
github.com/pion/ice/v2 v2.3.25 // indirect
Expand All @@ -17,14 +17,14 @@ require (
github.com/grafana/pyroscope-go/godeltaprof v0.1.7
github.com/jmoiron/sqlx v1.3.5
github.com/lib/pq v1.10.9
github.com/mattermost/calls-offloader v0.8.0
github.com/mattermost/calls-recorder v0.7.4
github.com/mattermost/calls-transcriber v0.4.0
github.com/mattermost/calls-offloader v0.8.1-0.20240925183132-f81d68d229b8
github.com/mattermost/calls-recorder v0.7.6-0.20240925183149-030e2c11508d
github.com/mattermost/calls-transcriber v0.4.1-0.20240925183146-a4131b656fa5
github.com/mattermost/logr/v2 v2.0.21
github.com/mattermost/mattermost-plugin-calls/server/public v0.0.3
github.com/mattermost/mattermost/server/public v0.1.5-0.20240613070149-4b0ae20ef7b4
github.com/mattermost/morph v1.1.0
github.com/mattermost/rtcd v0.17.1
github.com/mattermost/rtcd v0.17.2-0.20240925183117-466f6a8ed02f
github.com/mattermost/squirrel v0.2.0
github.com/pkg/errors v0.9.1
github.com/rudderlabs/analytics-go v3.3.3+incompatible
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,12 @@ github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPK
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattermost/calls-offloader v0.8.0 h1:XCAAMR11V/wSlLIJl1DuUQ8PGT8RRwPFbtM4YGZvfLw=
github.com/mattermost/calls-offloader v0.8.0/go.mod h1:xmVZZfWM9KfTcOp2Zb8XdFRin4JBNcQqg+vcwtTmdPc=
github.com/mattermost/calls-recorder v0.7.4 h1:Qh2KUJXyi5Sr2vjUSqBRWxEcgeboTJqJPcJxlXfdhlg=
github.com/mattermost/calls-recorder v0.7.4/go.mod h1:I2jcogTW6A3FmD1MaVmxebqzygozpBkKEAvevgVTsvg=
github.com/mattermost/calls-transcriber v0.4.0 h1:02xQ5JQiwquPdLkD6dMnlEYroUWuTRuwI/NOgaQ8xF8=
github.com/mattermost/calls-transcriber v0.4.0/go.mod h1:7PQ11l7azyClIVWV5qJJviu2nHySSZdl71yVCGEIGSA=
github.com/mattermost/calls-offloader v0.8.1-0.20240925183132-f81d68d229b8 h1:IBGmBxcwSc4QZqEKgGJ3HmwYWQWH9o8++AlPQjVgPVQ=
github.com/mattermost/calls-offloader v0.8.1-0.20240925183132-f81d68d229b8/go.mod h1:arpWosQVXZxZem+fIJLrUox64U6CN3lmJjzB55CM2yE=
github.com/mattermost/calls-recorder v0.7.6-0.20240925183149-030e2c11508d h1:YjKTvQqn2pd3HsQj3AyCrH2r25E3kxNl9lV7DY6Hr/o=
github.com/mattermost/calls-recorder v0.7.6-0.20240925183149-030e2c11508d/go.mod h1:evcawpSj6ZIXdrJL4+U1N0nvjtNtugAnA/8r+LD9otQ=
github.com/mattermost/calls-transcriber v0.4.1-0.20240925183146-a4131b656fa5 h1:i9P0EwF1LbKwc/CvczMI7sZ5JRrFfusyepr4/E91hc0=
github.com/mattermost/calls-transcriber v0.4.1-0.20240925183146-a4131b656fa5/go.mod h1:AD7SIYgPAtj9Vtpw7sLpnWwtJ8CPFR0/hW5nlSMEiOY=
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404 h1:Khvh6waxG1cHc4Cz5ef9n3XVCxRWpAKUtqg9PJl5+y8=
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404/go.mod h1:RyS7FDNQlzF1PsjbJWHRI35exqaKGSO9qD4iv8QjE34=
github.com/mattermost/ldap v3.0.4+incompatible h1:SOeNnz+JNR+foQ3yHkYqijb9MLPhXN2BZP/PdX23VDU=
Expand All @@ -380,8 +380,8 @@ github.com/mattermost/mattermost/server/public v0.1.5-0.20240613070149-4b0ae20ef
github.com/mattermost/mattermost/server/public v0.1.5-0.20240613070149-4b0ae20ef7b4/go.mod h1:PDPb/iqzJJ5ZvK/m70oDF55AXN/cOvVFj96Yu4e6j+Q=
github.com/mattermost/morph v1.1.0 h1:Q9vrJbeM3s2jfweGheq12EFIzdNp9a/6IovcbvOQ6Cw=
github.com/mattermost/morph v1.1.0/go.mod h1:gD+EaqX2UMyyuzmF4PFh4r33XneQ8Nzi+0E8nXjMa3A=
github.com/mattermost/rtcd v0.17.1 h1:LsThJFMRuWKf6F7k7IilYUm/9oWb3uQ0N0wBnq3pa+k=
github.com/mattermost/rtcd v0.17.1/go.mod h1:bpGyHeb+JDkDzbrQheenpbrqfPhphW0jr09Jh+rpmpY=
github.com/mattermost/rtcd v0.17.2-0.20240925183117-466f6a8ed02f h1:bJiMgr9Lub1HR0S8yQ/QeXRlHUd0WmmYek72hW3sTk8=
github.com/mattermost/rtcd v0.17.2-0.20240925183117-466f6a8ed02f/go.mod h1:twellAs4hvfjDI/8PIq5viG5ej2zoBzvTGzFscbjKZc=
github.com/mattermost/squirrel v0.2.0 h1:8ZWeyf+MWQ2cL7hu9REZgLtz2IJi51qqZEovI3T3TT8=
github.com/mattermost/squirrel v0.2.0/go.mod h1:NPPtk+CdpWre4GxMGoOpzEVFVc0ZoEFyJBZGCtn9nSU=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
Expand Down
4 changes: 2 additions & 2 deletions lt/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/mattermost/mattermost-plugin-calls/lt

go 1.21.9
go 1.22.7

require (
github.com/aws/aws-sdk-go v1.50.3
github.com/hajimehoshi/go-mp3 v0.3.4
github.com/mattermost/mattermost/server/public v0.0.12
github.com/mattermost/rtcd v0.17.1
github.com/mattermost/rtcd v0.17.2-0.20240925183117-466f6a8ed02f
github.com/pion/rtp v1.8.6
github.com/pion/webrtc/v3 v3.2.41
gopkg.in/hraban/opus.v2 v2.0.0-20230925203106-0188a62cb302
Expand Down
4 changes: 2 additions & 2 deletions lt/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ github.com/mattermost/logr/v2 v2.0.21 h1:CMHsP+nrbRlEC4g7BwOk1GAnMtHkniFhlSQPXy5
github.com/mattermost/logr/v2 v2.0.21/go.mod h1:kZkB/zqKL9e+RY5gB3vGpsyenC+TpuiOenjMkvJJbzc=
github.com/mattermost/mattermost/server/public v0.0.12 h1:iunc9q4/XkArOrndEUn73uFw6v9TOEXEtp6Nm6Iv218=
github.com/mattermost/mattermost/server/public v0.0.12/go.mod h1:Bk+atJcELCIk9Yeq5FoqTr+gra9704+X4amrlwlTgSc=
github.com/mattermost/rtcd v0.17.1 h1:LsThJFMRuWKf6F7k7IilYUm/9oWb3uQ0N0wBnq3pa+k=
github.com/mattermost/rtcd v0.17.1/go.mod h1:bpGyHeb+JDkDzbrQheenpbrqfPhphW0jr09Jh+rpmpY=
github.com/mattermost/rtcd v0.17.2-0.20240925183117-466f6a8ed02f h1:bJiMgr9Lub1HR0S8yQ/QeXRlHUd0WmmYek72hW3sTk8=
github.com/mattermost/rtcd v0.17.2-0.20240925183117-466f6a8ed02f/go.mod h1:twellAs4hvfjDI/8PIq5viG5ej2zoBzvTGzFscbjKZc=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down
8 changes: 4 additions & 4 deletions server/db/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ func newPostgresStore(t *testing.T, binaryParams bool) (*Store, func()) {
settings.DriverName = model.NewString(model.DatabaseDriverPostgres)

mockLogger.On("Info", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})
mockLogger.On("Debug", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})
mockMetrics.On("IncStoreOp", mock.AnythingOfType("string"))
mockMetrics.On("ObserveStoreMethodsTime", mock.AnythingOfType("string"), mock.AnythingOfType("float64"))
Expand Down Expand Up @@ -173,10 +173,10 @@ func newMySQLStore(t *testing.T) (*Store, func()) {
require.NotNil(t, conn)

mockLogger.On("Info", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})
mockLogger.On("Debug", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})
mockMetrics.On("IncStoreOp", mock.AnythingOfType("string"))
mockMetrics.On("ObserveStoreMethodsTime", mock.AnythingOfType("string"), mock.AnythingOfType("float64"))
Expand Down
4 changes: 2 additions & 2 deletions server/db/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
func TestSetupConn(t *testing.T) {
mockLogger := &mlogMocks.MockLoggerIFace{}
mockLogger.On("Info", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})
mockLogger.On("Debug", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})

for _, driverName := range []string{model.DatabaseDriverPostgres, model.DatabaseDriverMysql} {
Expand Down
4 changes: 2 additions & 2 deletions server/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ func NewTestStore(t *testing.T) (*db.Store, func()) {
settings.DriverName = model.NewString(model.DatabaseDriverPostgres)

mockLogger.On("Info", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})
mockLogger.On("Debug", mock.Anything).Run(func(args mock.Arguments) {
log.Printf(args.Get(0).(string))
log.Print(args.Get(0).(string))
})
mockMetrics.On("IncStoreOp", mock.AnythingOfType("string"))
mockMetrics.On("ObserveStoreMethodsTime", mock.AnythingOfType("string"), mock.AnythingOfType("float64"))
Expand Down
2 changes: 1 addition & 1 deletion server/public/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/mattermost/mattermost-plugin-calls/server/public

go 1.19
go 1.22.7

require github.com/stretchr/testify v1.8.4

Expand Down
2 changes: 1 addition & 1 deletion server/slash_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,6 @@ func (p *Plugin) ExecuteCommand(_ *plugin.Context, args *model.CommandArgs) (*mo

return &model.CommandResponse{
ResponseType: model.CommandResponseTypeEphemeral,
Text: fmt.Sprintf("Invalid subcommand: " + subCmd),
Text: "Invalid subcommand: " + subCmd,
}, nil
}

0 comments on commit 1909e4b

Please sign in to comment.