* [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>
* [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>
* 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.
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
```
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
```
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
```
* 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
```
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
```
* 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>
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
```
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
* 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>
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
```
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.