mirror of
https://github.com/mattermost/mattermost.git
synced 2026-04-13 13:08:56 -04:00
* Add shared AI bridge seam
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Add AI bridge test helper API
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Add AI bridge seam test coverage
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Add Playwright AI bridge recap helpers
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Fix recap channel persistence test
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Restore bridge client compatibility shim
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Expand recap card in Playwright spec
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Recaps e2e test coverage (#35543)
* Add Recaps Playwright page object
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Expand AI recap Playwright coverage
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Format recap Playwright coverage
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Fix recap regeneration test flows
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Fix AI bridge lint and OpenAPI docs
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Fix recap lint shadowing
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Stabilize failed recap regeneration spec
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Fill AI bridge i18n strings
Co-authored-by: Nick Misasi <nick13misasi@gmail.com>
* Fix i18n
* Add service completion bridge path and operation tracking fields
Extend AgentsBridge with CompleteService for service-based completions,
add ClientOperation/OperationSubType tracking to BridgeCompletionRequest,
and propagate operation metadata through to the bridge client.
Made-with: Cursor
* Fill empty i18n translation strings for enterprise keys
The previous "Fix i18n" commit added 145 i18n entries with empty
translation strings, causing the i18n check to fail in CI. Fill in
all translations based on the corresponding error messages in the
enterprise and server source code.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix i18n
* Fix i18n again
* Rename Complete/CompleteService to AgentCompletion/ServiceCompletion
Align the AgentsBridge interface method names with the underlying
bridge client methods they delegate to (AgentCompletion, ServiceCompletion).
Made-with: Cursor
* Refactor
* Add e2eAgentsBridge implementation
The new file was missed from the prior refactor commit.
Made-with: Cursor
* Address CodeRabbit review feedback
- Add 400 BadRequest response to AI bridge PUT endpoint OpenAPI spec
- Add missing client_operation, operation_sub_type, service_id fields to
AIBridgeTestHelperRecordedRequest schema
- Deep-clone nested JSON schema values in cloneJSONOutputFormat
- Populate ChannelID on recap summary bridge requests
- Fix msg_count assertion to mention_count for mark-as-read verification
- Make AgentCompletion/ServiceCompletion mutex usage atomic
Made-with: Cursor
* fix(playwright): align recaps page object with placeholder and channel menu
Made-with: Cursor
* fix(playwright): update recaps expectEmptyState to match RecapsList empty state
After the master merge, the recaps page now renders RecapsList's
"You're all caught up" empty state instead of the old placeholder.
Made-with: Cursor
* chore(playwright): update package-lock.json after npm install
Made-with: Cursor
* Revert "chore(playwright): update package-lock.json after npm install"
This reverts commit 95c670863a.
* style(playwright): fix prettier formatting in recaps page object
Made-with: Cursor
* fix(playwright): handle both recaps empty states correctly
The recaps page has two distinct empty states:
- Setup placeholder ("Set up your recap") when allRecaps is empty
- RecapsList caught-up state ("You're all caught up") when the
filtered tab list is empty
Split expectEmptyState into expectSetupPlaceholder and
expectCaughtUpEmptyState, used by the delete and bridge-unavailable
tests respectively.
Made-with: Cursor
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
144 lines
3.9 KiB
Go
144 lines
3.9 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package app
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
|
"github.com/mattermost/mattermost/server/v8/channels/app/platform"
|
|
"github.com/mattermost/mattermost/server/v8/channels/store"
|
|
"github.com/mattermost/mattermost/server/v8/channels/store/sqlstore"
|
|
"github.com/mattermost/mattermost/server/v8/config"
|
|
"github.com/mattermost/mattermost/server/v8/einterfaces"
|
|
"github.com/mattermost/mattermost/server/v8/platform/shared/filestore"
|
|
)
|
|
|
|
type Option func(s *Server) error
|
|
|
|
// By default, the app will use the store specified by the configuration. This allows you to
|
|
// construct an app with a different store.
|
|
//
|
|
// The override parameter must be either a store.Store or func(App) store.Store().
|
|
func StoreOverride(override any) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.StoreOverride(override))
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func StoreOverrideWithCache(override store.Store) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.StoreOverrideWithCache(override))
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func StoreOption(option sqlstore.Option) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.StoreOption(option))
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// Config applies the given config dsn, whether a path to config.json
|
|
// or a database connection string. It receives as well a set of
|
|
// custom defaults that will be applied for any unset property of the
|
|
// config loaded from the dsn on top of the normal defaults
|
|
func Config(dsn string, readOnly bool, configDefaults *model.Config) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.Config(dsn, readOnly, configDefaults))
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// ConfigStore applies the given config store, typically to replace the traditional sources with a memory store for testing.
|
|
func ConfigStore(configStore *config.Store) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.ConfigStore(configStore))
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func SetFileStore(filestore filestore.FileBackend) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.SetFileStore(filestore))
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func ForceEnableRedis() Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.ForceEnableRedis())
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func RunEssentialJobs(s *Server) error {
|
|
s.runEssentialJobs = true
|
|
|
|
return nil
|
|
}
|
|
|
|
func JoinCluster(s *Server) error {
|
|
s.joinCluster = true
|
|
|
|
return nil
|
|
}
|
|
|
|
func StartMetrics(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.StartMetrics())
|
|
return nil
|
|
}
|
|
|
|
func WithLicense(license *model.License) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, func(p *platform.PlatformService) error {
|
|
p.SetLicense(license)
|
|
return nil
|
|
})
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// SetLogger requires platform service to be initialized before calling.
|
|
// If not, logger should be set after platform service are initialized.
|
|
func SetLogger(logger *mlog.Logger) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.SetLogger(logger))
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func SkipPostInitialization() Option {
|
|
return func(s *Server) error {
|
|
s.skipPostInit = true
|
|
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func WithAgentsBridge(bridge AgentsBridge) Option {
|
|
return func(s *Server) error {
|
|
s.agentsBridgeOverride = bridge
|
|
return nil
|
|
}
|
|
}
|
|
|
|
type (
|
|
AppOption func(a *App)
|
|
AppOptionCreator func() []AppOption
|
|
)
|
|
|
|
func ServerConnector(ch *Channels) AppOption {
|
|
return func(a *App) {
|
|
a.ch = ch
|
|
}
|
|
}
|
|
|
|
func SetCluster(impl einterfaces.ClusterInterface) Option {
|
|
return func(s *Server) error {
|
|
s.platformOptions = append(s.platformOptions, platform.SetCluster(impl))
|
|
return nil
|
|
}
|
|
}
|