There is a race between go mod tidy and go mod vendor
due to https://github.com/golang/go/issues/37376.
However, if we give priority to go mod vendor, then
gopls complains of inconsistent vendoring. We make go mod tidy happy
as it's a more commonly used command than go mod vendor,
and is a common problem faced by other devs too
* Don't downgrade plugins with feature flag for on-prem
* Update app/plugin.go
Co-authored-by: Christopher Poile <cpoile@gmail.com>
* Short circut for plugin doesn't exist.
Co-authored-by: Christopher Poile <cpoile@gmail.com>
* MM-30892: Avoid unnecessary table scan in AnalyticsPostCount.
[AnalyticsPostCount](d9e8402dc2/store/sqlstore/post_store.go (L1513-L1541)) unconditionally joins on the `Channels` table even when not filtering to a team.
This is a proposal to stop doing this, reducing this to a simple index query when no team is specified. Note that this is technically a subtle semantic difference, since orphaned posts (from deleted or invalid channel ids) are currently excluded. But I submit the benefits outweigh the technical differences here.
Fixes: https://mattermost.atlassian.net/browse/MM-30892
* Update store/sqlstore/post_store.go
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
* Update store/sqlstore/post_store.go
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
* Add search engine support for files
* Fixing i18n
* Fix golangci-lint
* Fix consistency problem in the Search receiver functio of the SqlFileStore
* Fixing some tests
* Fixing test
* Apply suggestions from code review
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
* Addressing PR review comments
* Removing some empty lines
* Address PR review comments
* Fixing problem after merge master
* Fixing spelling problem
* Add missed translations
* Fixing certain global variable usages after merge master
* Fixing some constants usage
* Fixing goimports order
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
There was a mistake in my earlier analysis. t.Parallel only
applies to the current test and not its subtests.
There is some other test running with t.Parallel that is causing duplicate
file watcher events to be fired. I have now verified that removing this
causes the race to go away in CI
* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w`
* added goimports lint check to .golangci.yml
* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w` for a corner case
* make app-layers, *-mocks and store-layers for ci check
Co-authored-by: Mahmudul Haque <mahmudulhaque@protonmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-31715: Flip ExperimentalGossip to be true by default
https://mattermost.atlassian.net/browse/MM-31715
```release-notes
The UseExperimentalGossip field under ClusterSettings is now true by default.
This means that new installations will use the gossip protocol for cluster communication.
There will be no changes to existing installations.
```
* update test config
* MM-31370: Fix racy TestClusterShutdownRace
This race wasn't specific to this test, but somehow got triggered by it.
This was a critical race because the PluginsLock is widely used
throughout the codebase to gate access to the PluginsEnvironment.
However, a config listener can often run in its own goroutine leading to
a wide variety of races.
https://mattermost.atlassian.net/browse/MM-31370
```release-note
NONE
```
* incorporate review comments
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-31061: Remove pointers to slice
This PR removes instances of pointers
to slices in the codebase. There are some other instances in app/import_functions.go
but that's necessary to prevent empty arrays from appearing in the JSON output.
```release-note
NONE
```
https://mattermost.atlassian.net/browse/MM-31061
* fix tests
* Installing plugins specified by feature flags using the marketplace.
* Switch back to using getplugins client.
* Respect disabling automatic installation of pluings.
* pluginid -> plugin_id
* Debug logs for enable plugin error
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Since this test had t.Parallel set, it would run the sub-tests
in parallel. The issue was that the same file path was being written
from the 2 sub-tests causing duplicate firing of the event handlers.
This would cause a race where the store would be closing, and at the same time,
an event handler would fire, trying to read the fs.watcher field.
Having two separate file paths resolves this.
https://mattermost.atlassian.net/browse/MM-31369
```release-note
NONE
```
* MM-31063: Change constants to use CamelCase
* store package
* change allcaps to camel case (#16615)
* New tools.mod
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* Added log to print golang version before running Server
* Minor fix
* Review Fixes
* Review Fixes - 2
* Update app/server.go
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
The package paths were changed. Therefore, go mod tidy
on master failed with:
```
go: finding module for package github.com/hmhealey/go-opengraph/opengraph
go: found github.com/hmhealey/go-opengraph/opengraph in github.com/hmhealey/go-opengraph v0.0.0-20201209151214-f2d823730dba
go: github.com/hmhealey/go-opengraph@v0.0.0-20201209151214-f2d823730dba used for two different module paths (github.com/dyatlov/go-opengraph and github.com/hmhealey/go-opengraph)
```
https://mattermost.atlassian.net/browse/MM-31511
```release-note
NONE
```
* MM-31356: Add a minimum required version check for Postgres
To keep conformance with our failing fast and obvious philosophy,
we add a check to prevent Mattermost server from starting
if the postgres version is below 10.0.
This gives customers a chance to upgrade their database before upgrading
their Mattermost version, than to run into weird compatibility issues
after they have finished the upgrade.
https://mattermost.atlassian.net/browse/MM-31356
```release-note
NONE
```
* fix lint errors
* Use a function to pretty-print version string
* rectify comment