[pull] master from mattermost:master#665
Merged
Merged
Conversation
…support packet diagnostics (#35837) * MM-67979 MM-67980: Add SMTP and push proxy connectivity to support packet Adds a `notifications` section to `diagnostics.yaml` in the support packet with SMTP email and push proxy connectivity probe results. - `notifications.email.status`: ok/fail/disabled based on whether SendEmailNotifications is enabled and an SMTP connection can be established using mail.TestConnection() - `notifications.push.status`: ok/fail/disabled based on whether SendPushNotifications is enabled and an HTTP GET to the configured PushNotificationServer URL succeeds - Error messages are included in the `error` field on failure - No email or push notification is sent during the probe Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix: handle errcheck lint violations in support_packet_test.go Suppress unhandled error return values from rw.WriteString calls in the mock SMTP server used in tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: use 127.0.0.1 directly in SMTP reachability test Replace localhost:0 with 127.0.0.1:0 for the mock SMTP listener so that it always binds to the loopback interface. In CI Docker containers localhost may resolve to the container IP rather than 127.0.0.1, causing the SMTP dial to fail with connection refused. Also switch from string manipulation to net.TCPAddr type assertion for reliable host/port extraction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: override MM_EMAILSETTINGS_SMTPSERVER env var in SMTP reachability test The CI environment sets MM_EMAILSETTINGS_SMTPSERVER=inbucket via test.env. Mattermost's config Store.Set() calls GetEnvironment() (os.Environ()) on every UpdateConfig, so env vars silently override any programmatic config change. Use t.Setenv before UpdateConfig so the env var points to 127.0.0.1 for the duration of the subtest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add model.StatusDisabled constant and use it in support_packet.go Replace "disabled" string literals with model.StatusDisabled for consistency with model.StatusOk and model.StatusFail. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor: use utils.GetHostnameFromSiteURL, extract testPushProxyConnection helper, set LDAP StatusDisabled - Replace manual url.Parse with utils.GetHostnameFromSiteURL (consistent with app/config.go) - Extract push proxy HTTP check into testPushProxyConnection with TODO to move to its own package - Set d.LDAP.Status = model.StatusDisabled when LDAP is not configured - Replace "disabled" string literals in tests with model.StatusDisabled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add status field to ElasticSearch diagnostics with ok/fail/disabled When indexing is enabled, reports ok or fail based on TestConfig result. When indexing is disabled or the engine is unavailable, reports disabled. Backend/ServerVersion/ServerPlugins are still collected when the engine exists regardless of indexing status. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: update Happy path test for LDAP and ES StatusDisabled assertions Both are disabled in the test environment so they now report StatusDisabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: use GET /version endpoint for push proxy connectivity check Use url.JoinPath to construct the /version path safely, replacing raw root URL access. Also validate the HTTP status code so non-2xx/3xx responses are treated as failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Mattermost Build <build@mattermost.com>
The new TestRegisterPluginForSharedChannels tests added in #36126 broke master CI because RegisterPluginForSharedChannels assigned opts.Displayname directly to RemoteCluster.Name, which IsValid validates against the slug regex ^[a-zA-Z0-9.\-_]+$. Display names with spaces (e.g. "legacy plugin") fail validation. The tests didn't run in the PR's final CI shard and the issue surfaced post-merge. Add CleanRemoteName to the public model, mirroring CleanTeamName and CleanUsername: lowercase, replace spaces and other disallowed characters with hyphens, trim, truncate to RemoteNameMaxLength, fall back to NewId when the result is empty. Use it in RegisterPluginForSharedChannels so Name is always slug-valid while DisplayName keeps the human-readable label. This also lets real plugins register with display names containing spaces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )