Commit Graph

357 Commits

Author SHA1 Message Date
Eli Yukelzon
c298678663 MM-28835 Configure/update notices setting for TeamAdmin (#15632) 2020-09-29 15:17:38 +03:00
Ashish Bhate
ee76ad435b [MM-28303]: check if mmctl exists before checking on Github and reduce requests to Github (#15387)
Summary:
Every make call would ping Github to find out the mmctl version to download. Each check made 4 requests to Github. So every make execution resulted in 4 requests to Github. This leads to frequent rate-limit errors from Github.
In this PR we check for the mmctl version only if mmctl doesn't already exist. We also print a more helpful error message.
Reduce the number the number of requests to Github from 4 to 2.

Ticket Link:
https://mattermost.atlassian.net/browse/MM-28303
2020-09-24 14:54:57 +05:30
Ben Schumacher
d535e66638 [MM-28520] Update bundled version of nps to 1.1.0 (#15537) 2020-09-23 18:00:08 +02:00
Eli Yukelzon
4e9ddd4686 MM-27918 In-Product notices support (#15316) 2020-09-21 10:28:46 +03:00
Jesse Hallam
1337fa919c MM-28103: prepackage incident-response (#15360)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-09-10 21:05:20 -03:00
Jesús Espino
44079785eb Moving diagnostics into a service (#14832)
* Moving diagnostics into a service

* Fixing golint checks

* Fixing tests

* Renaming from diagnostics to telemetry

* Adding missing files

* Initializing telemetry earlier in the server startup

* Fixing tests

* Adding a log for the telemetryID initialization error

* Addressing PR review comments

* Fixing merge problem

* Removing some extra Diagnostics mentions

* Making tests pass
2020-09-08 20:30:54 +02:00
Jason Deland
953899ad95 Updating the mmctl process to set the value once and than use it. Also added the basic auth code from agniva 2020-09-02 18:32:10 -04:00
Ibrahim Serdar Acikgoz
2b1da58e6d make test: ignore data directory while running make test (#15346)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-08-31 13:01:12 +02:00
Elisabeth Kulzer
c368dc7838 Implement empty translation check. (#15364) 2020-08-31 10:43:09 +02:00
Agniva De Sarker
e1ca3e348f MM-27512: Use an authenticated user to bump up request rate limit (#15251)
* MM-27512: Use an authenticated user to bump up request rate limit

An unauthenticated user can only make 60 requests per hour which means 1
request every minute. This can lead to frequent rate limit errors while
getting the latest release.

We change that to use an authenticated user which is already available
in the CI. This moves us to make 5000 requests per hour.

We also add additional logging in the Makefile targets in case
the command fails again so that it's clear what has happened, and not return
cryptic 404 errors again.

Ideally, we should be able to inspect the output of the curl command, but since
the output value of the entire bash script is fed into the variable, it is a bit
difficult to print debug output.

If this still gives error, then we need to either use a cached artifact somehow
or add additional logging and add a retry logic on top of it.

* fix mistake
2020-08-18 19:42:12 +05:30
Agniva De Sarker
91a76b2df9 MM-27456: Use reflect-free serialization for hot structs (#15171)
Automatic Merge
2020-08-13 03:35:57 -04:00
Claudio Costa
9333b7d896 Start required docker services before running tests (#15217) 2020-08-11 09:41:23 +01:00
Agniva De Sarker
fb0fa2a726 MM-26882: Ensure to start docker containers during test (#15113)
* MM-26882: Ensure to start docker containers during test

This starts up docker containers which can help avoid failures
during a test run if a developers forgets to manually start them.

* Start LDAP if EE build
2020-07-29 20:21:15 +05:30
Ashish Bhate
7e3d76b9a2 [MM-26886]: check enterprise prereqs before running tests (#15083) 2020-07-22 16:59:12 +05:30
Agniva De Sarker
7af4b50d64 MM-27150: Remove TE tests as part of tbs workflow (#15077)
* MM-27150: Remove TE tests as part of tbs workflow

There's no need to run TE all over again in tbs, when it's already run
in the normal workflow.

* add phony target

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-07-22 15:33:46 +05:30
Jesús Espino
5be023aa70 Upgrading go.tools.mod (#15081)
* Upgrading to the last mattermost-utilities/mmgotool

* Remove unneeded file

* Fixing mmgotools usage
2020-07-21 14:07:27 +02:00
Eli Yukelzon
b15c0484c6 MM-26834 - Move opentracing into a separate package (#15011) 2020-07-15 12:59:11 +03:00
Jesús Espino
e980dd7bd3 Configurable dev environment (#14869)
* Configurable dev environment

* Add a bit of documentation

* fixing gofmt

* A bit more doc

* Using  variable

* Adding license header

* Moving LDAP_DATA variable to the default-config.mk file

* Adding another docker-compose for the makefile to not brake anybody workflow

* Moving dejavu to the config

* Fixing docker-compose.makefile.yaml for dejavu

* Adding keycloak support to the dev environment

* Address PR review comments

* Removing minio from default docker images

* Changing the default version of mysql to the oldest supported (5.6)

* Change the restart option to no for the dev environment

* Fixing restart option

* Reverting unneded changes

* Restoring 5.7 to check if test passes

* Going back to 5.6 mysql image

* Fixing tests on mysql 5.6

* Skipping flaky test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-07-13 22:29:39 +02:00
Jason Frerich
a69c200574 update bundled plugins for server version 5.24 (#14727)
* update bundled plugins for server version 5.24

* github should be 1.0.0

* upgrade to welcomebot 1.2.0

* autolink 1.2.0 currently has breaking changes. revert to previous
version

* revert to jira 2.3.  users can still upgrade via marketplace

* correct the jira version

* revert to original versions.  Play conservative
2020-06-09 11:20:26 -07:00
Agniva De Sarker
932d6c2cbf Migrate tool dependencies to go.tools.mod (#14646)
Go 1.14 introduces usage of alternate go.mod files to track
other dependencies which are not related to the main app.
We use this to track all tool dependencies so that everybody uses
the same version of all tools, including CI.

This will prevent version conflicts due to everybody using different
versions of the tools.
And it will not try to upgrade the tool version, every single time,
one runs the tool command.

While here, we also re-generate some filestore mocks which weren't up to date.

Fixes #13088

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-25 23:20:44 +05:30
Nev Angelova
6362926b5c [MM-23827] - Update nps plugin version (#14369)
Co-authored-by: Nevyana Angelova <nevyangelova@Nevyanas-MBP.fritz.box>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-28 10:54:07 +02:00
Eli Yukelzon
819f57037b fixed app-layer generator, re-enabled struct2interface in make… (#14260)
* fixed app-layer generator, re-enabled struct2interface in makefile
2020-04-09 11:08:39 +03:00
Eli Yukelzon
92380d83fc OpenAPI Mattermost Go Vet integration (#14216)
* integrating govet
* added api spec check to CI
2020-04-07 16:18:08 +03:00
Agniva De Sarker
125ed3a4cf MM-23817: Use auto-vendoring (#14231)
With Go 1.14 (https://tip.golang.org/doc/go1.14#go-command),
it now automatically checks for the existence of a vendor directory.

So there is no need to explicitly set the `-mod=vendor` flag.
2020-04-07 09:01:06 +05:30
Doug Lauder
c82c2db8ce Update Makefile (#14195)
`make searchengine-mocks` was failing due to not finding `mockery`, although it was installed.
2020-03-31 12:11:32 -04:00
Jesús Espino
c66e182b08 Adding the new search engine abstraction (#13304)
* WIP

* Adding bleve to go modules

* WIP

* Adding missing files from searchengine implementation

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* User and channel indexing and searches implemented

* Make bleve tests run with in-memory indexes

* Implement post index and deletion tests

* Initial commits for the search layer

* Removing unnecesary indexing

* WIP

* WIP

* More fixes for tests

* Adding the search layer

* Finishing the migration of searchers to the layer

* Removing unnecesary code

* Allowing multiple engines active at the same time

* WIP

* Add simple post search

* Print information when using bleve

* Adding some debugging to understand better how the searches are working

* Making more dynamic config of search engines

* Add post search basics

* Adding the Purge API endpoint

* Fixing bleve config updates

* Adding missed file

* Regenerating search engine mocks

* Adding missed v5 to modules imports

* fixing i18n

* Fixing some test around search engine

* Removing all bleve traces

* Cleaning up the vendors directory and go.mod/go.sum files

* Regenerating timer layer

* Adding properly the license

* Fixing govet shadow error

* Fixing some tests

* Fixing TestSearchPostsFromUser

* Fixing another test

* Fixing more tests

* Fixing more tests

* Removing SearchEngine redundant text from searchengine module code

* Fixing some reindexing problems in members updates

* Fixing tests

* Addressing PR comments

* Reverting go.mod and go.sum

* Addressing PR comments

* Fixing tests compilation

* Fixing govet

* Adding search engine stop method

* Being more explicit on where we use includeDeleted

* Adding GetSqlSupplier test helper method

* Mocking elasticsearch start function

* Fixing tests

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-13 15:33:18 +01:00
Miguel de la Cruz
182c29b456 MM-21898: Part 2. Add opentracing (#13904)
* initial implementation of opentracing

* app layer

* Revert Makefile

* .

* cleanup

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* [ci]

* autogenerate interface

* .

* missed vendor files

* updated interfaces

* updated store layers

* lint fixes

* .

* finishing layer generators and nested spans

* added errors and b3 support

* code review

* .

* .

* fixed build error due to misplased flag.Parse()

* code review addressed
2020-03-05 14:46:08 +01:00
Jesús Espino
7035e09fe9 Adding changes to separate unit tests and integration tests (#13670)
* Introducing unit (not integration) tests for the app layer

* Initial support for unit tests at the API

* Adding unit tests support to the store layer

* Add unit tests support in commands

* Adding last tests needed for run unit tests properly

* Fixing govet

* Removing some duplication

* Fixing tests

* Fixing tests

* Not compiling test helpers with the main module for api

* Revert "Not compiling test helpers with the main module for api"

This reverts commit 36a199bbe0.

* Fixing tests

* Fixing unit tests

* More consistency between api4/apiteslib.go and app/helper_test.go

* Renaming things to make more obvious the new Setup functions purpose

* Reverting change in go.sum

* Start with empty mock for app layer

* Start with empty mock for api layer

* Start with empty mock for web layer

* Renaming SetupWithStoreMockConfig to SetupConfigWithStoreMock

* Fixing tests on web package

* Removing unnecesary function
2020-03-02 08:13:39 -08:00
Agniva De Sarker
376ec9e0e3 Remove unnecessary struct2interface dependency (#13929)
* Remove unnecessary struct2interface dependency

Running go mod tidy on the repo removes it.
This was also preventing 1.14beta from running the repo,
because now it verifies modules.txt with go.mod, which had a mismatch.

* fixing CI

* Fix test-server target

* Fix some discrepancies in vendor

* Removing the Makefile target for now

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-02-27 09:46:13 +05:30
Jesse Hallam
7da85922af fix bin/mmctl detection using printf (#13898)
The behaviour of `echo` [varies](https://stackoverflow.com/questions/8467424/echo-newline-in-bash-prints-literal-n) between operating systems. Use `printf` for maximum compatibility.
2020-02-14 15:45:32 -05:00
Miguel de la Cruz
5f7b5686a8 Adds tFatal custom govet check (#13886)
Automatic Merge
2020-02-13 12:51:36 -05:00
Eli Yukelzon
17523fa5d9 MM-21898 - Part 1: Generate and use an interface instead of *A… (#13840)
* Generate and use an interface instead of *App
2020-02-13 13:26:58 +01:00
Jason Frerich
0a80e63668 Bump zoom plugin version to v1.3.0 (#13836)
Co-authored-by: Ali Farooq <ali.farooq0@pm.me>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-02-12 11:46:39 -06:00
Jason Paul Deland
28ef877876 (IS-302) Streamling process to download pre-built binaries (#13830)
* Updating build and release process to include externally built mmctl

* Missed last commit before reset

* rename script to align with purpose

* Moving get release script to scripts dir

* Streamlined script to find the correct latest version of an externally built binary from a GitHub Release

* Updated variable names to match

* Updating vars to match

* Updating parameters to named variables for clarity

* Update scripts/get_latest_release.sh

Co-Authored-By: Elisabeth Kulzer <elikul@elikul.de>

Co-authored-by: Elisabeth Kulzer <elikul@elikul.de>
2020-02-11 12:29:38 -05:00
Jason Deland
720de2bec3 mmctl should always be in the server bin directory 2020-02-04 16:40:09 -05:00
Jason Paul Deland
051fe3cd71 Updating process for mmctl to use DIST_PATH/bin (#13822) 2020-02-04 16:01:01 -05:00
Jason Paul Deland
acce0da068 Adding target to get the latest mmctl release from GitHub (#13770)
* Updating build and release process to include externally built mmctl

* Missed last commit before reset

* rename script to align with purpose

* Moving get release script to scripts dir
2020-02-03 16:58:15 -05:00
George Goldberg
d7206d2ede Update dependencies. (#13778) 2020-02-03 08:19:38 -08:00
Agniva De Sarker
f0934361a1 export GOBIN (#13752)
* export GOBIN

* Add comment
2020-01-27 13:34:35 +05:30
Ali Farooq
afd54413f7 MM-21769 - Validate plugin bundle and signature files when pac… (#13629)
* MM-21769 - Validate plugin bundle and signature files when packaging MM

* Renamed public key, using gpg exit code to verify success

* Update Makefile

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>

* Pulling platform specific prepackaged plugins

* Verify platform specific plugin binary exist when building each ARCH

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-01-22 13:39:02 -05:00
Agniva De Sarker
adeb7ec8ff Allow GOBIN to be overriden with environment variables (#13671) 2020-01-22 17:46:41 +05:30
Agniva De Sarker
5123fe0292 Remove more instances of GOPATH from Makefile and CI (#13450)
Automatic Merge
2020-01-21 07:49:49 -05:00
Jason Frerich
a001ecabe2 Update bundled plugins for v5.20 (#13621) 2020-01-15 10:30:58 -06:00
Jesús Espino
a3239ec464 adding inconsistentReceiverName check to vet task (#13582) 2020-01-07 14:48:33 +01:00
Ben Schumacher
81efef7b5a Don't lint EE code in TE CI (#13574)
* Don't lint EE code in TE CI

* Fix typo
2020-01-07 12:37:57 +01:00
Jesús Espino
68e0b1fdc2 Enforces structured logging in enterprise code (#13444) 2019-12-20 15:18:59 +01:00
Jesús Espino
b8ef62e502 Adding structuredLogging check and fix inconsistencies (#13370)
* Adding structuredLogging check and fix inconsistencies

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments
2019-12-16 13:57:21 +01:00
Jesús Espino
f55a81163e Adding mattermost-govet to the pipeline (#13257)
* Adding mattermost-govet to the pipeline

* Trying to fix circleCI config

* Trying to fix circleCI config

* Trying to fix circleCI config

* Trying to fix circleCI config

* Update Makefile

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* Update Makefile

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Adding legacy check-licenses task to legacy.mk

* Removing unnecesary GO111MODULE=off lines

* Adding jenkins mattermost-govet installation
2019-12-10 13:10:35 +01:00
Ben Schumacher
5122b9e292 [MM-20723] Add golint for plugin package to golangci (#13090) 2019-12-05 20:31:53 +01:00
Miguel de la Cruz
070ec77ee3 Fix the LDFLAGS references to use the version suffix (#13242) 2019-11-28 18:05:32 +01:00