mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* Upgrade Go to 1.24.3 Updates the following files: - server/.go-version: 1.23.9 → 1.24.3 - server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye - server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 - server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking: - Added response() helper function in slashcommands/util.go for simple string responses - Removed unused responsef() function from slashcommands/util.go - Replaced responsef() with response() for translated strings that don't need formatting - Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation - Updated marketplace buildURL to handle format strings conditionally * Update generated mocks for Go 1.24.3 Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3. This addresses mock generation failures that occurred with the Go upgrade. * Update to bookworm and fix non-existent sha Signed-off-by: Stavros Foteinopoulos <[email protected]> * fix non-constant format string --------- Signed-off-by: Stavros Foteinopoulos <[email protected]> Co-authored-by: Stavros Foteinopoulos <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
523 lines
13 KiB
Go
523 lines
13 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make store-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
request "github.com/mattermost/mattermost/server/public/shared/request"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// JobStore is an autogenerated mock type for the JobStore type
|
|
type JobStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Cleanup provides a mock function with given fields: expiryTime, batchSize
|
|
func (_m *JobStore) Cleanup(expiryTime int64, batchSize int) error {
|
|
ret := _m.Called(expiryTime, batchSize)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Cleanup")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(int64, int) error); ok {
|
|
r0 = rf(expiryTime, batchSize)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: id
|
|
func (_m *JobStore) Delete(id string) (string, error) {
|
|
ret := _m.Called(id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Delete")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (string, error)); ok {
|
|
return rf(id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) string); ok {
|
|
r0 = rf(id)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Get provides a mock function with given fields: c, id
|
|
func (_m *JobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
|
ret := _m.Called(c, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.Job, error)); ok {
|
|
return rf(c, id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.Job); ok {
|
|
r0 = rf(c, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
|
r1 = rf(c, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAllByStatus provides a mock function with given fields: c, status
|
|
func (_m *JobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
|
ret := _m.Called(c, status)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAllByStatus")
|
|
}
|
|
|
|
var r0 []*model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
|
return rf(c, status)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
|
r0 = rf(c, status)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
|
r1 = rf(c, status)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAllByType provides a mock function with given fields: c, jobType
|
|
func (_m *JobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
|
ret := _m.Called(c, jobType)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAllByType")
|
|
}
|
|
|
|
var r0 []*model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
|
return rf(c, jobType)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
|
r0 = rf(c, jobType)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
|
r1 = rf(c, jobType)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAllByTypeAndStatus provides a mock function with given fields: c, jobType, status
|
|
func (_m *JobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
|
ret := _m.Called(c, jobType, status)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAllByTypeAndStatus")
|
|
}
|
|
|
|
var r0 []*model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) ([]*model.Job, error)); ok {
|
|
return rf(c, jobType, status)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) []*model.Job); ok {
|
|
r0 = rf(c, jobType, status)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
|
r1 = rf(c, jobType, status)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAllByTypeAndStatusPage provides a mock function with given fields: c, jobType, status, offset, limit
|
|
func (_m *JobStore) GetAllByTypeAndStatusPage(c request.CTX, jobType []string, status string, offset int, limit int) ([]*model.Job, error) {
|
|
ret := _m.Called(c, jobType, status, offset, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAllByTypeAndStatusPage")
|
|
}
|
|
|
|
var r0 []*model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, []string, string, int, int) ([]*model.Job, error)); ok {
|
|
return rf(c, jobType, status, offset, limit)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, []string, string, int, int) []*model.Job); ok {
|
|
r0 = rf(c, jobType, status, offset, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, []string, string, int, int) error); ok {
|
|
r1 = rf(c, jobType, status, offset, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAllByTypePage provides a mock function with given fields: c, jobType, offset, limit
|
|
func (_m *JobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
|
ret := _m.Called(c, jobType, offset, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAllByTypePage")
|
|
}
|
|
|
|
var r0 []*model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) ([]*model.Job, error)); ok {
|
|
return rf(c, jobType, offset, limit)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) []*model.Job); ok {
|
|
r0 = rf(c, jobType, offset, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, int, int) error); ok {
|
|
r1 = rf(c, jobType, offset, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAllByTypesPage provides a mock function with given fields: c, jobTypes, offset, limit
|
|
func (_m *JobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
|
ret := _m.Called(c, jobTypes, offset, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAllByTypesPage")
|
|
}
|
|
|
|
var r0 []*model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) ([]*model.Job, error)); ok {
|
|
return rf(c, jobTypes, offset, limit)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) []*model.Job); ok {
|
|
r0 = rf(c, jobTypes, offset, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, []string, int, int) error); ok {
|
|
r1 = rf(c, jobTypes, offset, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetCountByStatusAndType provides a mock function with given fields: status, jobType
|
|
func (_m *JobStore) GetCountByStatusAndType(status string, jobType string) (int64, error) {
|
|
ret := _m.Called(status, jobType)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetCountByStatusAndType")
|
|
}
|
|
|
|
var r0 int64
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, string) (int64, error)); ok {
|
|
return rf(status, jobType)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, string) int64); ok {
|
|
r0 = rf(status, jobType)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
|
r1 = rf(status, jobType)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetNewestJobByStatusAndType provides a mock function with given fields: status, jobType
|
|
func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, error) {
|
|
ret := _m.Called(status, jobType)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetNewestJobByStatusAndType")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.Job, error)); ok {
|
|
return rf(status, jobType)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.Job); ok {
|
|
r0 = rf(status, jobType)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
|
r1 = rf(status, jobType)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetNewestJobByStatusesAndType provides a mock function with given fields: statuses, jobType
|
|
func (_m *JobStore) GetNewestJobByStatusesAndType(statuses []string, jobType string) (*model.Job, error) {
|
|
ret := _m.Called(statuses, jobType)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetNewestJobByStatusesAndType")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func([]string, string) (*model.Job, error)); ok {
|
|
return rf(statuses, jobType)
|
|
}
|
|
if rf, ok := ret.Get(0).(func([]string, string) *model.Job); ok {
|
|
r0 = rf(statuses, jobType)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func([]string, string) error); ok {
|
|
r1 = rf(statuses, jobType)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Save provides a mock function with given fields: job
|
|
func (_m *JobStore) Save(job *model.Job) (*model.Job, error) {
|
|
ret := _m.Called(job)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Save")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.Job) (*model.Job, error)); ok {
|
|
return rf(job)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.Job) *model.Job); ok {
|
|
r0 = rf(job)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Job) error); ok {
|
|
r1 = rf(job)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SaveOnce provides a mock function with given fields: job
|
|
func (_m *JobStore) SaveOnce(job *model.Job) (*model.Job, error) {
|
|
ret := _m.Called(job)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveOnce")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.Job) (*model.Job, error)); ok {
|
|
return rf(job)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.Job) *model.Job); ok {
|
|
r0 = rf(job)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Job) error); ok {
|
|
r1 = rf(job)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdateOptimistically provides a mock function with given fields: job, currentStatus
|
|
func (_m *JobStore) UpdateOptimistically(job *model.Job, currentStatus string) (bool, error) {
|
|
ret := _m.Called(job, currentStatus)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateOptimistically")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.Job, string) (bool, error)); ok {
|
|
return rf(job, currentStatus)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.Job, string) bool); ok {
|
|
r0 = rf(job, currentStatus)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Job, string) error); ok {
|
|
r1 = rf(job, currentStatus)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdateStatus provides a mock function with given fields: id, status
|
|
func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, error) {
|
|
ret := _m.Called(id, status)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateStatus")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.Job, error)); ok {
|
|
return rf(id, status)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.Job); ok {
|
|
r0 = rf(id, status)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
|
r1 = rf(id, status)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdateStatusOptimistically provides a mock function with given fields: id, currentStatus, newStatus
|
|
func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (*model.Job, error) {
|
|
ret := _m.Called(id, currentStatus, newStatus)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateStatusOptimistically")
|
|
}
|
|
|
|
var r0 *model.Job
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, string, string) (*model.Job, error)); ok {
|
|
return rf(id, currentStatus, newStatus)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.Job); ok {
|
|
r0 = rf(id, currentStatus, newStatus)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Job)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
|
r1 = rf(id, currentStatus, newStatus)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewJobStore creates a new instance of JobStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewJobStore(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *JobStore {
|
|
mock := &JobStore{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|