To start off with, we are using the new-from-rev=HEAD~ option which just checks the current
commit. This allows us to quickly integrate golangci-lint and not spend time in fixing all the
outstanding issues.
Things pending:
- Slowly fix the existing issues. To test them, just uncomment the "new-from-rev: HEAD~" line
from .golangci.yml and have at it.
- There are a number of unused functions and methods which are only invoked from enterprise code.
We are ignoring them for now because removing them will stop enterprise build from working.
The correct solution here is to use a build tag to separate TE and EE code. As a long term goal,
we would want to use that build tag throughout the EE codebase and remove the TE_PACKAGES and
EE_PACKAGES variables in the Makefile and just use the build tag. That makes things a lot cleaner
and avoids the need to spawn a "go list" every time to get the correct list of packages.
* Fix CI config
- -mod=vendor flag was not being passed during the build stage, forcing
it to download everything again.
- Optimize the git clone of webapp with --depth=1 and use GIT_SSH_COMMAND to clone.
- Add $(GOFLAGS) to some other places which got missed out.
* Remove GOFLAGS from go list command
It does not work for Go 1.12. Need to fix later.
We use tmpfs for CI builds to speed things up, but this is unsuitable for local development. Also, don't use `--no-ansi` in the `Makefile` to allow colours to show up.
* add docker-compose for ci
* docker-compose logs does not have the option to set the dc file
* leverage docker-compose extends
This moves the developer `docker-compose.yml` to the root, extending the `build/docker-compose.yml` and overriding the `container_name` to preserve compatibility with the older, non-docker-compose setup.
Note that this required downgrading to docker-compose 2.4's file format (still supported by the newer tooling) due to the long and frustrating converstaion at https://github.com/moby/moby/issues/31101.
* remove -f docker-compose-ci.yml references
* replace dockerhost with localhost
* remove uneeded setup-max build step (no more dockerhost)
* changes as recommended by @cpanato
* make clean-docker with docker-compose
* added ports to docker-compose.yml (needed for osx). ignore error for ldapadd (when already exists)
* add clean-old-docker to legacy.mk
* docker-compose stop instead of down for `make stop-docker`
* Time Layer for measure the Store methods calls time
* Fixing build
* Fixing a formating problem
* Fixing tests
* generating store mocks
* Fixing build
* Updating generated timer layer
* Updating timer layer to the last store interface
* Updating timer layer
* Generating time layer
Revert https://mattermost.atlassian.net/browse/MM-14559. The tests were refactored, but all the hooks were be run as:
_, ret := hooks.MessageWillBePosted(nil, nil)
and the plugins were panicking, but then nothing was actually failing because this hook doesn't support returning a "proper" error. Good news is that the old tests are still passing, so nothing has regressed in the toolkit, but thinking we should revisit this holistically instead of trying to fix in place.
* Added - golang version validation.
* Updated error message to include the minor version that is supported.
* Fixed issue with variable.
* Renamed variable.
* Added - golang version validation.
Added validation for major and minor versions of go.
* Fixed the way the validation is performed.
* Changed function declaration (define validate_go_version) to a target (validate_go_version).
* remove unneeded call to validate_go_version
* MM-16543 Add mocking for einterfaces packages
* MM-16543 Fix Elasticsearch only returning one page of results
* Remove license checks for einterface mocks
* Test
* Revert "Test"
This reverts commit 2bbf335ee93ae7cd1dfeea4c805efcafeec8dae5.
* Fixed typo in Makefile, line 564: 'persistent' misspelled
* Fixed return of status_store.Get to return model.Status and model.AppError, removed connections to result var in same method, generated new mocks and fixed tests.
* Fixed status_store.go under /sqlstore and /storetest in addition to removing personal comments
* SQL Indentation fix for consistency
* Revert merge change to store.go for SaveOrUpdate to avoid error introduced by merge
* Changed StoreChannel back to *model.Apperror for SaveOrUpdate in store.go, fixed resulting error in storetest/status_store.go so it did not have conflicting types. Fixed spelling errors in same file
* Test for status, err changed according to recommendation upon second look
* Changed status variable on line 77 to blank identifier to stop it from shadowing line 24 declaration
* It appears last statement in test was using 'status' variable where status is model.STATUS_ONLINE instead of model.STATUS_OFFLINE like status3, making comparison always be 'online != offline', which is always true, proceeding into if statement, guaranteeing test failure
* Build fails consistently when line 75 has 'status' in if statement due to shadowing issue due to existing declaration Jenkins complains about in line 24. If this fails then new variable will be necessary
* Renamed parameter to avoid overshadowing issue
* Undid code addition mistake in storetest/status_store.go and updated line 29 accordingly to account for multiple values.
* Remove status3 as used in line 71 in status_store.go.
* Undid change in storetest/status_store.go on line 67 which checked for wrong thing