Saving settings for Mattermost Notifications integration displays error
Summary
When configuring the Mattermost Notifications integration for a project, when you click the "Test settings and save changes" button, any changes you've made are saved, but a toast banner reading "Test failed. false Save anyway" is displayed at the top of the screen.
There don't appear to be any errors displayed in the logs, and the network request made when clicking the button returns a 200 status.
Steps to reproduce
- Create a new project in GitLab
- Create an incoming webhook in Mattermost to use for notifications
- In Mattermost, click on the main menu and select Integrations
- Click on Incoming Webhooks
- Click Add Incoming Webhook in the top right
- Select any channel in Mattermost
- Click Save
- Copy the URL of the newly created webhook for use later
- Go to Project Settings > Integrations
- Edit the "Mattermost notifications" integration
- Check the "Active" checkbox and enter the "Webhook" URL created earlier
- Click "Test settings and save changes"
Example Project
This is happening on a local installation of GitLab and Mattermost using GitLab Omnibus. I haven't tested it on GitLab.com
What is the current bug behavior?
The toast banner (shown below) is displayed and changes are saved.
What is the expected correct behavior?
Changes are saved and no toast banner is displayed.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
************************************************** ⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis. **************************************************System information System: Ubuntu 18.04 Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 3.2.12 Git Version: 2.22.0 Sidekiq Version:5.2.7 Go Version: unknown
GitLab information Version: 12.6.0-pre Revision: 6a7cc8c1472 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.9 URL: http://harrison-gitlab.dev.spinmint.com HTTP Clone URL: http://harrison-gitlab.dev.spinmint.com/some-group/some-project.git SSH Clone URL: git@harrison-gitlab.dev.spinmint.com:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 10.3.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
************************************************** ⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis. ************************************************** Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 10.3.0 ? ... OK (10.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 4/2 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.22.0 ? ... yes (2.22.0) Git user has default SSH configuration? ... yes Active users: ... 1 Is authorized keys file accessible? ... yes
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
I haven't looked into it too much, but it seems like the code that controls the toast just has a minor issue since "false" sounds like there was no error.