* Expose metrics under a source available license
* do not assume Cluster()
* allow metrics if licensed or dev
* temporary vet override
* simplify BULID_TAGS handling
* auto clean old imports.go
* fix license listener
* e2e test metrics & license semantics
* update from enterprise
* switch back to mattermost-govet/v2@new now
* update metrics from upstream
* Update license_spec.js
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
* Update license_spec.js
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
* Update e2e-tests/cypress/tests/integration/channels/enterprise/metrics/license_spec.js
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
* Update e2e-tests/cypress/tests/integration/channels/enterprise/metrics/license_spec.js
* split up specs
* require/delete license earlier in e2e test
* expanded expect to debug failures
* more logging
* Revert "more logging"
This reverts commit 0bc513fd92.
* e2e: try deleting license first
* update from enterprise
* toggleMetricsOn to work around license delete
* eslint
* ensure admin before deleting license
* update from enterprise
* updates from enterprise
* fix cypress logging
* temp: log at DEBUG for Cypress tests
---------
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* updated go mod and sum files
* fixed var-naming errors in channels/app and channels/api4 dir
* Revert "updated go mod and sum files"
This reverts commit 088dd00a84.
* renamed a cost .
We directly instruct the server to read from the local filesystem
in case the local_mode key is set.
There is now no need to upload the file in --local mode and a warning
is thrown accordingly.
https://mattermost.atlassian.net/browse/MM-55987
```release-note
Now the mmctl bulk import process command in local mode supports processing an import file without actually uploading it to the server. Simply pass the file path to the import file and the server will directly read from it, and pass the --bypass-upload flag. There is no need to use the import upload command. NOTE: all of this is applicable only in local mode.
```
Co-authored-by: Mattermost Build <build@mattermost.com>
* feat: add log warn when app is run as root user
* Modify warning message
* Move warning message condition to L415
* move check to cmd/mattermost/main.go
* Update server/channels/app/server.go
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
* Moved checkForRootUser to root.go
* format root.go
* remove unnecessary space
---------
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* pass a logger instead of embedding on job
* leverage mlog.Millis
* use worker logger with HandleJobPanic
* rely on existing LogClone instead
* guard Job.LogClone against nil Job
* s/workername/worker_name
* Revert "rely on existing LogClone instead"
This reverts commit 17303cbac9.
* Revert "guard Job.LogClone against nil Job"
This reverts commit f1ae22dee5.
* Refactor: Use generic to change func StringInSlice to Contains
* Refactor: Use generic to change func stringNotInSlice to Contains
Make utils.go (dir server/public/utils) and func Contains
* Refactor: Move func Contains from channels/utils to public/utils
Move func Contains from channels/utils to public/utils
Fix import declarations line
* Docs: Add a description of the Contains function
* Test: add TestContains
Add a test code for a Contain function
There were multiple problems with loading of a license.
1. It was called from inside app/server.go and app/platform/service.go. The first one wasn't really needed anymore, so we remove it.
2. To make loading of a license work across a cluster, the license load action was attached along with the `InvalidateAllCachesSkipSend` method. But the problem with that was that it would even get called in the caller node as well, putting it in a recursive loop.
```
LoadLicense -> SaveLicense -> InvalidateAllCaches -> InvalidateAllCachesSkipSend -> LoadLicense
```
To fix this, we create a dedicated loadLicense cluster event and move it away from the `InvalidateAllCachesSkipSend` method. And then from the caller side, we just trigger this action.
3. We also remove the first call to check license expiration which would load the license again. This is unnecessary because if the license is expired, server wouldn't start at all.
While here, we also make some other improvements like removing unnecessary goroutine spawning while publishing websocket events. They are already handled asynchronously, so there is no need
to create a goroutine for that.
We also remove
```
ps.ReloadConfig()
ps.InvalidateAllCaches()
```
from requestTrialLicense as they are already called from inside `*PlatformService.SaveLicense`.
And lastly, we remove the `*model.AppError` return from `*PlatformService.InvalidateAllCaches` because there was nothing to return at all.
https://mattermost.atlassian.net/browse/MM-53879
```release-note
Fix several issues with loading of a license
```
- Prevents commands from receiving potential whitespace characters
- Adds a new root test case ensuring various whitespace characters are removed
Co-authored-by: Nathan Geist <ngeist@spiria.com>
If the store fails to initialize (e.g. run a migration), it would `log.Fatal` and then `os.Exit`. Unfortunately, this trips up `TestMain`, which happily keeps running tests, now guaranteed to fail.
Avoid this by instead returning an error from the store initialization, handling appropriately at the layer above.
* Remove build references
* Remove playbooks webapp and server, and add the prepackaged plugin
* Remove translations
* Add ProductSettings to the playwright type
* Restore playbooks as a prepackaged plugin for cypress e2e tests
https://mattermost.atlassian.net/browse/MM-52532
- Replace golint with revive
- Add makezero linter
- Fix all the required linter failures
Some issues in enterprise and public modules
are yet to be fixed. We send this to expediate things.
It was a good decision in hindsight to keep the public module as 0.x
because this would have been a breaking change again.
https://mattermost.atlassian.net/browse/MM-53032
```release-note
Changed the Go module path from github.com/mattermost/mattermost-server/server/v8 to github.com/mattermost/mattermost/server/v8.
For the public facing module, it's path is also changed from github.com/mattermost/mattermost-server/server/public to github.com/mattermost/mattermost/server/public
```
* Migrate all method in model/client4.go to accept a context.Context
* Fix th.*Client
* Fix remaining issues
* Empty commit to triger CI
* Fix test
* Add cancellation test
* Test that returned error is context.Canceled
* Fix bad merge
* Update mmctl code
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Includes mmctl into the mono-repo
* Update to use the new public module paths
* Adds docs check to the mmctl CI
* Fix public utils import path
* Tidy up modules
* Fix linter
* Update CI tasks to use the new file structure
* Update CI references
I mistakenly assumed that those packages are naturally imported.
And also atleast one test would have broken.
None of them are true. :)
So we just import it again at a better place
This reverts commit 30a053314b.
```release-note
NONE
```
* Enable products for channels tests
* increase unit test timeout; check IsConfigReadOnly
* make app-layers
* Avoid loading boards tempaltes between tests to improve speed
* Fix delete query to be compatible with both databases
* Avoid preserving the templates for boards store tests
* Run all tests in one command
* Revert "Run all tests in one command"
This reverts commit 0330f7cd8f.
* concurrent pkg group tests in CI
* Revert "Revert "Run all tests in one command""
This reverts commit 73892fec77.
* Revert "concurrent pkg group tests in CI"
This reverts commit 550fb6cdd4.
* try testing 3 subsets of packages concurrently to improve time taken
* Revert "try testing 3 subsets of packages concurrently to improve time taken"
This reverts commit 97475f3c4e.
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: wiggin77 <wiggin77@warpmail.net>
* bind to localhost:0 for tests
Explicitly bind to `localhost:0` instead of just `:0` to avoid binding to all available interfaces and in turn avoid triggering firewall warnings on MacOS.
* fix Playbooks to use dynamic port
* TestMetrics: handle ipv4 localhost too
* TestMetrics: linting