1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-07-15 23:54:29 +02:00

Multi product architecture (#3381)

- provides support for compiling Boards directly into the Mattermost suite server
- a ServicesAPI interface replaces the PluginAPI to allow for implementations coming from pluginAPI and suite server.
- a new product package provides a place to register Boards as a suite product and handles life-cycle events
- a new boards package replaces much of the mattermost-plugin logic, allowing this to be shared between plugin and product
- Boards now uses module workspaces; run make setup-go-work
This commit is contained in:
Miguel de la Cruz
2022-07-18 19:21:57 +02:00
committed by GitHub
parent 3d753a15e5
commit 4b0fb92fba
68 changed files with 2854 additions and 1110 deletions

View File

@ -67,7 +67,6 @@ type TestHelper struct {
type FakePermissionPluginAPI struct{}
func (*FakePermissionPluginAPI) LogError(str string, params ...interface{}) {}
func (*FakePermissionPluginAPI) HasPermissionToTeam(userID string, teamID string, permission *mmModel.Permission) bool {
if userID == userNoTeamMember {
return false
@ -195,7 +194,7 @@ func NewTestServerPluginMode() *server.Server {
db := NewPluginTestStore(innerStore)
permissionsService := mmpermissions.New(db, &FakePermissionPluginAPI{})
permissionsService := mmpermissions.New(db, &FakePermissionPluginAPI{}, logger)
params := server.Params{
Cfg: cfg,
@ -345,7 +344,11 @@ func (th *TestHelper) InitBasic() *TestHelper {
var ErrRegisterFail = errors.New("register failed")
func (th *TestHelper) TearDown() {
defer func() { _ = th.Server.Logger().Shutdown() }()
logger := th.Server.Logger()
if l, ok := logger.(*mlog.Logger); ok {
defer func() { _ = l.Shutdown() }()
}
err := th.Server.Shutdown()
if err != nil {
@ -355,7 +358,7 @@ func (th *TestHelper) TearDown() {
os.RemoveAll(th.Server.Config().FilesPath)
if err := os.Remove(th.Server.Config().DBConfigString); err == nil {
th.Server.Logger().Debug("Removed test database", mlog.String("file", th.Server.Config().DBConfigString))
logger.Debug("Removed test database", mlog.String("file", th.Server.Config().DBConfigString))
}
}