Repository navigation
Conversation
…teURL checkConfigured logged an error for every API request while the OAuth app wasn't set up. The webapp calls these endpoints on every page load, so the log volume scaled with users and page loads even though being unconfigured is the expected state right after enabling the plugin. Log at debug instead; the 501 response is unchanged. getSiteURL only rejected a nil SiteURL. Also reject an empty one so the plugin doesn't activate and build relative OAuth callback and webhook URLs.
It only pinned the log level of one line. TestGetSiteURL covers the behaviour change.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
Problem
checkConfiguredmiddleware logsThis plugin is not configured.at error level on every API request. The webapp calls these endpoints (for example/api/v1/connected) on every page load for every user, so the error count grows with users times page loads. Being unconfigured is the normal state right after the plugin is enabled, for example right after the onboarding wizard turns it on.getSiteURLonly rejects anilSiteURL. Today an empty SiteURL is caught only by accident: plugin RPC usesgob, which skips zero values, so""arrives asnil. If""ever arrived as is,OnActivatewould start the plugin and build relative OAuth callback and webhook URLs.Change
checkConfigurednow logs at debug level. The 501 response is unchanged. System admins still see the specific validation error when they run any/githubcommand.getSiteURLnow rejects""as well asnil, with the same error message as before.Testing
TestGetSiteURL: errors forniland""; returns the URL for a valid value, with any trailing slash removed.go test ./server/...,go vet,golangci-lint run(no new issues) andmattermost-govetpass locally.Ticket Link
https://mattermost.atlassian.net/browse/MM-71865
🤖 Generated with Claude Code
Change Impact: 🟡 Medium
Changes Breakdown:
+2 -2 Production Changes (11%)
+32 -0 Test Changes (89%)
Regression Risk: The shared helper
getSiteURLnow rejects empty values, not onlynil. This can block plugin activation for deployments with an emptySiteURL, and the diff does not show a test for the activation path. The newTestGetSiteURLcovers the nil, empty, and trailing-slash cases.Generated by CodeRabbitAI