Граф коммитов

15222 Коммитов

Автор SHA1 Сообщение Дата
Mattermod
5ea2ca8a3a Update minor version to 7.3.0 (#20815)
Co-authored-by: Mmbot <mmbot@mattermost>
2022-08-15 16:33:58 +03:00
Akis Maziotis
efed80a90c [CLD-3942] Container Image used for e2e testing, migration from Alpine to Debian Linux (#20807)
* [fix] Dockerfile using Debian instead of Alpine

We are switching to building docker container for Matermmost-server & enterprise
from Alpine Linux(unsupported) to Debian(supported)

This image is used for e2e testing.

Rationalle:
Alpine is actually unsupported distro for Mattermost-server. https://docs.mattermost.com/install/software-hardware-requirements.html#mattermost-server-operating-system
On top of that, Alpine linux uses musl libc vs glibc, which can cause several issues when testing
Finally We got to a point of being unable to run Alpine based mattermost instances with: `Error relocating ./mattermost: fcntl64: symbol not found`
Details @ https://github.com/mattermost/mattermost-server/pull/20735

Specifically the following changes are introduced:

- switching to using Debian Buster as being a supported linux flavor for Mattermost
- pinning the Debian base image with SHA hash
- defining Shell as bash, and enabling pipefail
- pinning additional packages installed using apt
- removing unused cache
- improving MM_PACKAGE variable checking logic introducing non zero exit code (127) when failing
- migrating adduser and addgroup command, to debian compatible
- removing unused chown dirs

Signed-off-by: Akis Maziotis <akis.maziotis@mattermost.com>

* [fix] Using bash as a more capable shell

* [fix] Installing optional packages needed for tests

These packages are needed to perform succesfull end to end testing.
Relevant documentation:
https://docs.mattermost.com/configure/file-storage-configuration-settings.html#enable-document-search-by-content

Signed-off-by: Akis Maziotis <akis.maziotis@mattermost.com>
2022-08-13 06:44:32 +08:00
Amy Blais
6aa57e6242 Revert "MM-45272: Fix getPostThread permissions (#20565)" (#20811)
Automatic Merge
2022-08-12 18:43:49 +03:00
Akis Maziotis
1ef24221e3 [feat] CI essential multi-product architecture changes (#20783)
* [feat] essential multi-product architecture changes

This takes care of aligning mattermost-server CircleCI pipeline to the mutlti-product architecture.
Specifically the following are performed:

- seperation of mattermost-server and mattermost-webapp clone/setup stages
- introduction of clone/setup stage for focalboard
- change to using cimg/base image instaed of  mattermost/mattermost-build-webapp when cloning/setup mattermost-server
- introduction of `configure-multirepo` stage, in which multi-module workspaces (golang) configuration is being performed for mattermost-server and focalboard
- introduction of parallel build of focalboard along with mattermost-server
- reorganisation of step dependencies, to accomodate `configure-multirepo` step

Ticket: https://mattermost.atlassian.net/browse/CLD-3801
Signed-off-by: Akis Maziotis <akis.maziotis@mattermost.com>
2022-08-11 18:16:59 +03:00
Martin Kraft
55b3961b98 MM-45120: Track team join times. Add API to retrieve new team members since a given time. (#20708)
* MM-45120: Starts tracking team join time. Adds API to retrieve team members who joined after a given time.

* MM-45120: Updates json casing to match model.User.
2022-08-11 10:38:52 -04:00
Tim Scheuermann
1738bd6e92 [MM-45991] Check and return JSON errors (#20735) 2022-08-10 10:56:58 +02:00
Jesse Hallam
fdee1df6fe Pre-package Playbooks v1.31.0 (#20797) 2022-08-10 01:09:02 -03:00
Christopher Poile
f6307be7f4 prepackage calls 0.7.1 (#20788)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-09 15:38:00 -04:00
Tim Scheuermann
b4570afa90 Replace deprecated ioutil with io and os (#20776)
* Replace ioutil with io and os

* Replace ioutil in utils/file.go

* Minor fix to tests and excluded files

Co-authored-by: Tim Scheuermann <tim.scheuermann@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-09 14:25:46 +03:00
Ashish Bhate
15b6046a62 MM-44922: Flush log buffer before assert (#20795)
Summary
Flush log buffer before asserting log text.

Ticket Link
https://mattermost.atlassian.net/browse/MM-44922
2022-08-09 16:49:43 +05:30
Shivashis Padhi
afbbc31205 Merge pull request #20761 from plant99/improve-top-user-reactions
[MM-45561] Improve user top reactions query
2022-08-09 11:57:52 +05:30
Agniva De Sarker
97b3ffd7ea MM-43202: Change some 501 response codes to fix SLO violations (#20767)
There were lots of cases where we were using the code 501
in an incorrect manner, and since 5xx codes are considered
as SLO violations, these were flagged by our monitoring incorrectly.

These were the guidelines to change the codes:
1. Any case of missing license or config not correctly enabled
is set as Forbidden. The logic is that the user is correctly
authenticated with a session, but does not have enough privileges
to have the higher license, or hasn't changed the config correctly.
2. Any case of incorrectly formed request is obviously a 400.

https://mattermost.atlassian.net/browse/MM-43202

```release-note
NONE
```
2022-08-08 20:02:49 +05:30
Ibrahim Serdar Acikgoz
f0e4794cda Move config store into Platform Service (#20718)
* update config methods
2022-08-08 16:52:31 +03:00
Agniva De Sarker
b826421716 MM-45534: Fix flaky TestCreateGroupChannel (#20781)
The returned elements weren't in a specific order.
Therefore, we need to perform an order insensitive match.

https://mattermost.atlassian.net/browse/MM-45534

```release-note
NONE
```
2022-08-08 14:14:18 +05:30
Mustafa Kara
236716f9c7 Stop applying server lint rules to focalbard repo. (#20772)
* Stop applying server lint rules to focalbard repo.
* Remove board packages from the tests.

Signed-off-by: Mustafa Kara <mustafa.kara@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-05 12:49:45 +03:00
Agniva De Sarker
14246abdef MM-45993: Return errors during sending websocket messages (#20760)
During attaching an object to a websocket message, we would
marshal it to json and attach the string output. But if the
marshalling failed, we would just log a warning and move on.

This would add an empty string to the message. But the client
assumes that the object is correctly attached and would
fail silently if it cannot find it.

So we become more strict and return the error so that
it reaches the caller.

https://mattermost.atlassian.net/browse/MM-45993

```release-note
NONE
```
2022-08-05 08:49:01 +05:30
Agniva De Sarker
151f295d82 MM-45021: Fix flaky testGetFlaggedPostsForUser (#20769)
The method a.postRemoveFromChannelMessage was being called
from a goroutine. Therefore, when SystemAdminClient.GetFlaggedPostsForUser
was being called later in the test with a mock post store,
it would naturally fail because the store would now be a
different store but the goroutine was supposed to be finished.

A hacky solution would be to add a sleep before
starting the mocked API call. But a deeper question
is why was the method run in a goroutine in the first place.

Removing a user from a channel is not a very common operation
and even if we look at the method, if the user is trying to
remove themselves, that message happens synchronously, but if
they are removing another user, that runs in a goroutine.

This seems like a very weird behavior. Therefore, to be consistent
I have just removed the goroutine and made everything synchronous.

The next step would be to stop logging an error and just return
the error upwards instead. Because that's what happens in the other
condition. But that would be exceeding the scope too much. Maybe
in a separate PR.

https://mattermost.atlassian.net/browse/MM-45021

```release-note
NONE
```
2022-08-04 22:07:19 +05:30
Tim Scheuermann
2365f1286b [MM-46054] Log missing default channels (#20738) 2022-08-04 11:15:54 +02:00
Ashish Dhama
34832e0a3f change post forwarding feature flag default value to true (#20759) 2022-08-04 11:25:35 +05:30
Agniva De Sarker
6cc9933b58 Fix minio client breakage with bifrost round 2 (#20758)
* Revert "Revert "MM-43828: Pass object length for some image operations (#20711)" (#20740)"

This reverts commit c7ae090dad.

* Fix to work in bifrost mode

```release-note
NONE
```
2022-08-04 11:21:51 +05:30
Mattermod
722bd3dc0c Merge branch 'master' into improve-top-user-reactions 2022-08-04 01:25:36 +03:00
Pablo Andrés Vélez Vidal
e7156476fa MM-45542 - do not fail if site url is not set when requesting trial (#20713)
* MM-45542 - do not fail if site url is not set when requesting trial

* remove unnecessary text

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-03 23:54:43 +02:00
Shivashis Padhi
3e36894ac7 Avoid joining with Posts table while getting top user reactions 2022-08-03 15:43:09 +05:30
Agniva De Sarker
334b199e7a Optimize AnalyticsPostCount (#20727)
We use * instead of a column name to use
index-only scan always even when other column filters
are applied.

Right now, index-only scan will only get applied
in the basic query of "select count(p.id) as value
from posts p". But it won't get applied if the query
is "select count(p.id) as value from posts p where
p.deleteat=0".

So this is a minor optimization which improves
some corner cases.

This was found from the slow query monitoring.

```release-note
NONE
```
2022-08-03 10:31:18 +05:30
Agniva De Sarker
ee41162b48 MM-46134: Skip flaky test PostStore//GetForThread (#20755)
https://mattermost.atlassian.net/browse/MM-46134

```release-note
NONE
```
2022-08-02 19:12:40 -04:00
Agniva De Sarker
f07c31c5d9 MM-45196: Migration api4/command and app/cmd to logger context (#20730)
```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-02 20:48:54 +05:30
Allan Guwatudde
5c7ed6a1b1 fix feature flag treatment (#20753) 2022-08-02 18:09:19 +03:00
Akis Maziotis
928bcf87ba [chore] Update Node and Npm build image (#20752)
This updates the build-images used for CI to:
- node: 16.10.0
- npm: 7.24.0

Ticket: https://mattermost.atlassian.net/browse/CLD-3848
Signed-off-by: Akis Maziotis <akis.maziotis@mattermost.com>
2022-08-02 17:27:50 +03:00
Ibrahim Serdar Acikgoz
ac79a887a2 Move metrics under platform service (continued) (#20732)
* move metrics into platform

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2022-08-02 10:59:29 +03:00
Vishal
276594608c Remove the read_channel permission to unfollow a thread (#20662) 2022-08-02 12:12:41 +05:30
Vishal
fa768e0fa7 [MM-45726] Fix Sentry crash: nil deference in app/post_helpers.go:85 (#20654)
* Avoid adding duplicate post
2022-08-02 12:10:26 +05:30
Dimitris Oik
8444c45959 MM-44576 autocomplete names including utf 8 chars (#20367)
* Added unaccent extension

* Changed comment

* Deletes migrations, changes query method

* Mionr changes

* Creates test for multilingual queries

* Minor formatting changes

* Adds two more tests

* Changes name in test function

* Minor change

* Retriggers tests

* Removes % from Postgres query

* Lint fix

* Changes variable name

* Removes SetDefaultTextSearchConfig method

* Removes mocks

* Adds error handling on test raw queries

* Lint fix

* Deletes unused generated file

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-01 06:58:31 -04:00
Agniva De Sarker
55f64195b1 MM-45195: Use api4/bot and app/bot to use logger context (#20729)
https://mattermost.atlassian.net/browse/MM-45195

```release-note
NONE
```
2022-08-01 13:48:45 +05:30
Agniva De Sarker
c7ae090dad Revert "MM-43828: Pass object length for some image operations (#20711)" (#20740)
Automatic Merge
2022-07-29 17:53:14 +03:00
Kyriakos Z
562388501e MM-43939: fixes LastReplyAt when deleting the last reply (#20615)
* MM-43939: fixes lastreplyat when deleting the last reply

Currently we are not updating the Threads.LastReplyAt when the last
reply gets deleted. This can lead to threads appearing unread when
actually there is no unread thread.

This commit updates the value of Threads.LastReplyAt when a reply gets
deleted, to the most recent post's timestamp in the thread.

* Updates ReplyCount to current value on post delete

* Addresses review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-29 10:03:52 -04:00
Agniva De Sarker
887bc0173e MM-45715: Fix incorrect permissions (Round 2) (#20731)
We missed a case to return if there are no
items in the slice. Otherwise it falls through
and returns false incorrectly.

Rectified the tests to trigger the case.

https://mattermost.atlassian.net/browse/MM-45715

```release-note
NONE
```
2022-07-29 09:58:44 +05:30
Ashish Bhate
b9d062ddfa Update post reminder text (#20733)
Summary
Changing reminder text as suggested in Hackathon: Post Reminders mattermost-webapp#10688 (review),

Ticket Link
N/A
2022-07-28 22:39:13 +05:30
Tim Scheuermann
832736da37 [MM-45990] log JSON parsing errors in API4 (#20724) 2022-07-28 17:05:03 +02:00
Ashish Bhate
04cd6d35e9 MM-45272: Fix getPostThread permissions (#20565)
Summary
Fix permissions for the the getPostThread API Method.
User can view thread if user is member of the channel
User can view threads in public channels (in the user's team) that they're not a member of, only if compliance export is disabled.

Ticket Link
https://mattermost.atlassian.net/browse/MM-45272
2022-07-28 20:25:20 +05:30
Pablo Andrés Vélez Vidal
0ee05ce054 MM-45713 - change 500 error to json object (#20682)
* MM-45713 - change 500 error to json object

* validate possible encoding errors and follow standards

* replace normal debugging string with true string

* use bool type instead of string

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-28 15:07:54 +02:00
Agniva De Sarker
0e75cecc4f Fix bad merge due to https://github.com/mattermost/mattermost-server/pull/20674 (#20728)
```release-note
NONE
```
2022-07-28 10:34:02 +05:30
Agniva De Sarker
d4b710b3ab MM-45194: Switch app/user and api4/user to logger context (#20674)
```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-28 10:04:21 +05:30
Agniva De Sarker
90c6350410 Revert "move metrics server into platform service (#20683)" (#20726)
This reverts commit b18a42313b.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-27 21:30:25 +02:00
Tim Scheuermann
f199be6aa5 [MM-45715] Check for correct permission when requesting teams (#20715) 2022-07-27 19:17:02 +02:00
Agniva De Sarker
072c859219 MM-43828: Pass object length for some image operations (#20711)
For user profile and plugin upload, we use a bytes.Buffer.
In that case, we know the object size and can find
it out from the length of the buffer.

This helps reduce multi-part uploads.

This approach can also be taken in thumbnail and preview
images. However, they use an io.Pipe to directly upload
the image as it is being encoded. We could make the whole
process in separate parts of writing the full image in the
buffer and then upload it. But taking a conservative approach
for now.

Also, while here, removed some unused code.

https://mattermost.atlassian.net/browse/MM-43828

```release-note
NONE
```
2022-07-27 19:02:24 +05:30
Tim Scheuermann
eba08cbb11 Replace ioutil.Discard with io.Discard (#20707) 2022-07-27 11:40:33 +02:00
Carrie Warner (Mattermost)
c00609ab8e Added schema migration template to PR template (#20717)
A schema migration template is now available to help guide release note development.
2022-07-26 16:17:50 -04:00
Michael Kochell
c6913f7d9e support plugin setting property hosting (#20677)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-26 11:31:34 -04:00
Julien Tant
1044fba449 [MM-45817] Set cloud cookies whenever user gets logged in (#20692) 2022-07-26 07:47:09 -07:00
Agniva De Sarker
20cb042362 Hackathon: Post Reminders (#20555)
This PR adds the post reminder backend work.

We add a new API endpoint via which a user can set a reminder for a post. An ephemeral message will be sent down the line to let the user know about the action. And then after the time is over, the system admin bot will send a DM message to the user about the reminder post.
2022-07-26 16:12:56 +05:30