1. 15 Oct, 2019 1 commit
    • Jesse Hallam's avatar
      MM-16888: fix missing indexes (#12746) · 5d45aa81
      Jesse Hallam authored
      * MM-16888: fix missing indexes
      
      As part of https://mattermost.atlassian.net/browse/MM-16888, we discovered and fixed a number of column and index mismatches between the canonical (i.e. created from scratch) and migrated schemas (i.e migrated from 5.0 through 5.16).
      
      Unfortunately, the migration to fix same was added to `UpgradeDatabaseToVersion514` but never cherry picked to the pending v5.14 release at the time. Customers who upgraded to v5.14 or v5.15 and then get this code as part of v5.16 will never run that migration. Copy it to the UpgradeDatabaseToVersion516 accordingly.
      
      * avoid fixing ChannelMembers.SchemeGuest on MySQL
      
      * synchronize .circleci/config.yml with scripts/mysql-migration-test.sh
      
      * fix circleci invocation
      
      * additional logging on diff
      
      * update build/Jenkinsfile.pr too!
      5d45aa81
  2. 04 Oct, 2019 1 commit
  3. 24 Sep, 2019 3 commits
  4. 19 Sep, 2019 1 commit
  5. 14 Aug, 2019 1 commit
  6. 06 Aug, 2019 1 commit
    • Carlos Tadeu Panato Junior's avatar
      add docker-compose for ci (#11795) · c927fb9d
      Carlos Tadeu Panato Junior authored
      * 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
      c927fb9d
  7. 02 Aug, 2019 1 commit
    • Jesse Hallam's avatar
      Tweak docker compose setup (#11785) · e33bdc94
      Jesse Hallam authored
      * fix stray dockerhost mention
      
      * fix stray whitespace
      
      * fix missing mattermost-redix cleanup in clean-old-docker
      
      * absolute path to docker-compose, plus simpler ldap initialization
      
      * allow ldapadd to fail on CI
      e33bdc94
  8. 31 Jul, 2019 1 commit
  9. 17 Jul, 2019 1 commit
  10. 23 Jun, 2019 1 commit
  11. 21 Jun, 2019 1 commit
  12. 06 Jun, 2019 1 commit
    • Eli Yukelzon's avatar
      [MM-14400] Programmatically generate default.json (#10551) · 6a42ad2a
      Eli Yukelzon authored
      * create/update config.json using go generate
      
      * added default config generator
      added config-reset to Jenkins and make package, updated defaults to consider 'isNew' flag
      
      * corrections after code review
      
      * fixed Config.isValid to handle empty encryption keys
      
      * fixed Config.isValid to handle empty encryption keys
      
      * fixed Config.isValid to handle empty encryption keys
      
      * isUpdate now only checks for nil
      
      * Addressed review comments, added unit testing for default config generator
      
      * err shadowing
      
      * license
      
      * provide output file for config generator via ENV variable, since go generate doesn't support arguments and we need two output paths (config-reset and package)
      
      * cleanup
      
      * proper defaults for PushNotificationServer and SendPushNotifications
      
      * corrected generating defaults for TrustedProxyIPHeader to be consistent with default.json in master
      
      * Check for empty SiteURL as well as nil
      
      * corrected SiteURL settings and checking
      
      * crazy typos fixed
      
      * corrected tests to newly expected values
      
      * relaxed the checks
      
      * fixed formatting
      6a42ad2a
  13. 09 Apr, 2019 1 commit
  14. 02 Apr, 2019 1 commit
    • Martin Kraft's avatar
      MM-14412: Enables force removals of team/channel members base on group constraints. (#10490) · 25fd9620
      Martin Kraft authored
      * MM-14412: Enables force removals of team/channel members base on group constraints.
      
      * Renames some existing methods and variables.
      
      * Change return types to ChannelMembers and TeamMembers for some existing methods.
      
      * Adds option to change LDAP_DATA to either 'qa' or 'test' with env variable.
      
      * Adds methods to retrieve ChannelMembers and TeamMembers that, based on group constraints, should be deleted.
      
      * Adds helper functions to create GroupTeams and GroupChannels.
      
      * MM-14412: Switches to helper methods for GroupSyncable creation in test files.
      
      * MM-14412: Style fix.
      
      * MM-14412: Switches remaining GroupSyncable instances to be created with helper functions.
      
      * MM-14412: Typo fix.
      
      * MM-11412: Build fixes.
      
      * MM-14412: Checks if user is team member before re-adding.
      
      * MM-14412: Update for change of GroupConstrained fields type.
      25fd9620
  15. 01 Mar, 2019 1 commit
  16. 13 Feb, 2019 1 commit
    • Carlos Tadeu Panato Junior's avatar
      add codecov back (#10215) · 42356bc7
      Carlos Tadeu Panato Junior authored
      * add codecov back
      
      * add token
      
      * remove option
      
      * update codecov
      
      * upddate codecov
      
      * add back threshold
      
      * add some configs
      
      * update per feedback
      
      * add error fallback
      
      * fix error
      
      * testing
      42356bc7
  17. 05 Feb, 2019 2 commits
  18. 28 Jan, 2019 1 commit
  19. 10 Jan, 2019 1 commit
    • Martin Kraft's avatar
      Ldap groups phase1 (#9752) · 6d30b21d
      Martin Kraft authored
      
      
      * Initial models, API, app, and persistence of groups and group syncing.
      
      * Consistent letter casing in ldif.
      
      * Moves group-specific migrations into func.
      
      * Adds API endpoint to retrieve LDAP groups (and associated MM groups) one tree level at a time.
      
      * Adds mattermost group id to SCIMGroup (if available).
      
      * Splits user and group creation so that memberOf works. Returns users from ldap interface.
      
      * Updates method name.
      
      * Returns users IDs instead of User.
      
      * Removes non-essential group data.
      
      * MM-11807: Add GroupFilter to LDAP config. (#9513)
      
      * MM-11807: Add GroupFilter to LDAP config.
      
      * Add diagnostic.
      
      * Adds new config option for using 'memberOf' overlay.
      
      * Adds API endpoint to link a group.
      
      * Removes debug statements.
      
      * Adds unlink group API endpoint.
      
      * Fix to LDAP API. Adds API method to client4 and app.
      
      * Adds some missing app methods. Renames API unexported func.
      
      * Fixes link/unlink API path to accept valid DNs.
      
      * Allow any character for DN portion of path.
      
      * Switches from DN to objectGUID or entryUUID as the remote identifier linking LDAP groups to MM groups.
      
      * Formatting.
      
      * Formatting.
      
      * Setting group name field to an ID for phase 1.
      
      * Adds an LDAP config field to Setting up configuration for local LDAP.
      
      * Changes to LDAP and GroupStore interfaces.
      
      * Draft of nesting groups in API response.
      
      * Removes unnecessary tree models.
      
      * Updates group membershipt create store method to also restore.
      
      * Adds new config to test config.
      
      * Accept AD format length.
      
      * Switches to SetUniqueTogether method.
      
      * Updates revert.
      
      * Tweaks to syncing queries .
      
      * Updates query for pending team and channel memberships.
      
      * Removes old GroupSyncableScanner usage. Some formatting and renaming.
      
      * Fixes bug setting syncable type in selecting paged.
      
      * Adds tests for syncables populator.
      
      * Only add users to teams and channels that are not deleted.
      
      * Renames method.
      
      * Updates test LDAP setup.
      
      * Removes memberof config stuff.
      
      * Renames.
      
      * Updates test data.
      
      * Fix for gofmt.
      
      * Adds missing license.
      
      * Adds missing teardowns.
      
      * Test fix.
      
      * Adds a cycle to the groups test data.
      
      * Changes API to return flat list.
      
      * Removes some unused interface and app methods.
      
      * Returns empty braces if results are empty.
      
      * Adds more LDAP test data.
      
      * Fix for test data error.
      
      * Adds error.
      
      * Moves test groups.
      
      * Adds OU for load test data.
      
      * Moves load test ou creation to load data.
      
      * Adds a new bool flag to SCIMGroups.
      
      * Removes SCIMGroup completely.
      
      * Removes FULL JOIN because it is not supported in MySQL.
      
      * Adds tests for sync queries; renames constant.
      
      * Bad merge fix.
      
      * Vet fix.
      
      * Returning OK on delete ldap group link
      
      * Removes foreign key constraints.
      
      * Adding total to the ldap getAllGroups api endpoint
      
      * Adds get group members page.
      
      * Removes pagination from groups syncables list API.
      
      * Adding syncable check now that foreign key constraint is removes.
      
      * Joins teams and channels to group syncables.
      
      * Adds group member count.
      
      * Adding GetAllChannels and SearchAllChannels for system admins only
      
      * Fix.
      
      * Test fix from pagination removal.
      
      * Orders groupmembers by createat.
      
      * Fixing search of all channels
      
      * Test fix after removing pagination.
      
      * JSON syntax error fix.
      
      * Changing tests (for now) pending investigation.
      
      * Adding GetAllChannels and SearchAllChannels tests for the store
      
      * Adding GetAllChannels and SearchAllChannels API tests
      
      * Omit empty JSON values of group syncables.
      
      * Fixing GetAllChannels and SearchAllChannels tests
      
      * Fixing GetAllChannels and SearchAllChannels store tests
      
      * Fixing GetAllChannels api tests
      
      * Adds 'LDAP groups' feature flag. (#9861)
      
      * Migrate new client functions to idiomatic error handling
      
      * Test fixes.
      
      * Simplification of groups api (#9860)
      
      * Simplification of groups api
      
      * Fixing RequireSyncableType
      
      * Test fix.
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Update api4/group.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Fix copy/paste error.
      
      * Fix copy/paste error.
      
      * Adds missing return, changes to correct HTTP status code.
      
      * Adds missing return, changes status codes.
      
      * Check for license.
      
      * Renames variable for new signature.
      
      * Adds client method to get a group.
      
      * Adds client method and tests for PatchGroup.
      
      * Adds more API tests.
      
      * Adds groups API tests.
      
      * Adds client method and tests for getting group syncables.
      
      * Adds tests for patching group teams and channels.
      
      * Update to translations.
      
      * Removes test.
      
      * Fix incorrect conditional.
      
      * Removes unnecessary nil check.
      
      * Removes unnecessary return.
      
      * Updates comment, removes unused variable.
      
      * Uses consistent JSON unmarshal pattern.
      
      * Uses consistent JSON unmarshal pattern.
      
      * Moves const block.
      
      * Switches 'already linked' from error to success response.
      
      * Removes commented-out code.
      
      * Switched to status ok.
      
      * Add parens for readability.
      
      * Fix copy/paste error.
      
      * Unexport some structs.
      
      * Removes repeated validity check.
      
      * Return without attempting commit if there's a rollback.
      
      * Fix incorrect HTTP status code.
      
      * Update store/sqlstore/group_supplier.go
      Co-Authored-By: default avatarmkraft <martinkraft@gmail.com>
      
      * Adds utility methods for going from groupsyncable to groupteam and groupchannel.
      
      * Fixing george suggestions (#9911)
      
      * Test fix.
      
      * Adds QA data to VC with visualization.
      
      * Fixes typo in graph image.
      
      * Update display name when re-linking in case it has changed in LDAP.
      
      * Adds ability to configure group display name and unique identifier. (#9923)
      
      * Adds ability to configure group display name and unique identifier.
      
      * Adds some configs to confi-ldap make command.
      
      * Fix for move of session.
      
      * Exposes method for use by SAML package.
      
      * Switches GroupSyncableType from int to string.
      
      * Update Jenkins build files.
      
      * Removes unused variable assignment.
      
      * Removes old unnecessary early return.
      
      * Removes unnecessary variable.
      
      * Moves param parsing before license and permissions checks.
      
      * Removes old code.
      
      * Compares agains underlying error rather than error id.
      
      * Switches tests to assertions.
      
      * Adds more assertions.
      
      * Adds missing return.
      
      * Adds space after comma for added legibility.
      
      * Moves a view model to the api package.
      
      * Unexports method.
      
      * Uses id validator function.
      
      * Fix docker-compose flag.
      
      * Typo fix.
      
      * Moves index creation to supplier.
      
      * Removes bad merge.
      
      * Renames parameter.
      
      * Re-adds space.
      
      * Removes unnecessary transaction.
      
      * Escapes the Groups table name with backticks because it is a reserved keyword.
      
      * Fix roles cache bug
      
      * Removing unnecesiary deserializing function
      
      * Switches table name rather than custom SQL everywhere for Postgres without backticks.
      
      * Removes redundant check for sql.ErrNoRows.
      
      * Removes redundant check for sql.ErrNoRows.
      
      * Removes data integrity check and redundant nil conditional.
      
      * Removes redundant check for sql.ErrNoRows.
      
      * Removes unnecessary query.
      
      * Removes ID length validation from persistence tier.
      
      * Makes some supplier methods idempotent.
      
      * Removes some empty switch defaults.
      
      * Renames Group Type field to Source.
      
      * Fix for mistaken field name change.
      
      * Uses IsValidId function.
      
      * Removes comment.
      
      * Changes json key name.
      
      * Removes test because no longer validating user.
      
      * Moves model state validation to app layer.
      
      * Don't create Groups.CanLeave column until phase 2.
      
      * Removes state validation until properties are used in phase 2.
      
      * Removes duplicated check.
      
      * Removes state validation until properties are used in phase 2.
      
      * Removes some tests until phase 2.
      
      * Comment-out a bunch of test related to CanLeave.
      
      * Extra unmarshal validation check. Removes more code for CanLeave.
      
      * Removes tests for CanLeave.
      
      * Explict error msg.
      
      * Rewrite queries.
      
      * Changes index name. Adds index.
      
      * Removes assertion.
      
      * Adds experimental feature flag.
      6d30b21d
  20. 13 Dec, 2018 1 commit
    • Jesse Hallam's avatar
      Speed up build (#9993) · 86fa3866
      Jesse Hallam authored
      * configure MySQL to use tmpfs
      
      * simplify use of COMPOSE_PROJECT_NAME, and set envs vs. overriding config.json, fix error output, --no-ansi
      
      * cmd/mattermost/commands/*_test.go: ignore MM_SQLSETTINGS_DATASOURCE from the env
      
      * clean up exit 1 semantics
      86fa3866
  21. 11 Dec, 2018 2 commits
  22. 10 Dec, 2018 1 commit
    • Jesse Hallam's avatar
      unittest using externally managed database (#9400) · 8374b622
      Jesse Hallam authored
      * MM-12083: unittest using externally managed database
      
      * cherry-pick Makefile changes from @cpanato
      
      * Jenkins changes (#9915)
      
      * add docker compose
      
      * udpate
      
      * when using minio dont need to set the region
      
      * update
      
      * add wait for it script
      
      * using old minio
      
      * add new jenkins file
      
      * update makefile
      
      * add dockerfile
      
      * rename the docker-compose proj to avoid colision (#9917)
      
      * rename the docker-compose proj to avoid colision
      
      * enable debug
      
      * enable debug to double checkt the branchs and fix docker-compose name (#9919)
      
      * add ee hash to check (#9920)
      
      * fix name (#9921)
      
      * update jenkins file to push from branch and prs
      
      * if a new push comes in stop the running build
      
      * split mysql and postgres variables
      
      * add script to run jenkins-like env in local dev env
      
      * update docker-compose project name to use uuid to make it more randon
      
      * fix DCNAME definition
      
      * update elasticsearch docker image
      
      * revert test
      
      * tidy up stages, and wait for mysql differently
      
      * update docker image and add check for postgres
      
      * checking if is ready
      
      * update docker compose to have a wait for deps
      
      * add readme and rename dockerfile
      
      * fix -unittest setup
      
      * using mm docker image
      
      * restore parallel unit tests at the package level
      
      Spin up a dedicated database for each package under test to avoid races in accessing the same tables.
      Simplify the interface for configuring the test database to just a DSN instead of multiple exports for each field.
      
      * try to work around root mysql access in CI
      
      * update local-test-env.sh too
      
      * MYSQL_ROOT_HOST: %
      
      * fix missing quotes
      
      * setting some memory limits for mysql
      
      * revert memory docker compose does not support
      
      * fix env name for postgres
      
      * expose errors in app/export_test.go
      
      * fix test label, better error checking on teardown
      
      * increase query timeout for tests
      
      * fix export_test
      
      * update local dev script
      
      * add configurable mysql root passwd
      8374b622