Skip to content

MM-67505 Add AnalyticsQueryTimeout setting and use when refreshing materialized views#8846

Open
hmhealey wants to merge 9 commits intomasterfrom
MM-67505_analytics-timeout
Open

MM-67505 Add AnalyticsQueryTimeout setting and use when refreshing materialized views#8846
hmhealey wants to merge 9 commits intomasterfrom
MM-67505_analytics-timeout

Conversation

@hmhealey
Copy link
Copy Markdown
Member

@hmhealey hmhealey commented Apr 1, 2026

Summary

Docs update for the new setting added in mattermost/mattermost#35906

Ticket Link

https://mattermost.atlassian.net/browse/MM-67505

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1880f167-2057-46c3-a321-1015ce2df8fd

📥 Commits

Reviewing files that changed from the base of the PR and between 1e08e01 and 62aff38.

📒 Files selected for processing (1)
  • source/administration-guide/configure/environment-configuration-settings.rst

📝 Walkthrough

Walkthrough

Updated Database environment configuration docs: widened the Query timeout (Database) table layout (no config/value changes) and added a new analytics-query-timeout entry (System Console: Environment > Database; config.json path .SqlSettings.AnalyticsQueryTimeout; env var MM_SQLSETTINGS_ANALYTICSQUERYTIMEOUT; default 300s).

Changes

Cohort / File(s) Summary
Documentation - Configuration Setting
source/administration-guide/configure/environment-configuration-settings.rst
Adjusted table layout for Query timeout (Database) (presentation only). Added analytics-query-timeout documentation and an Analytics query timeout subsection mapping the setting to config.json path .SqlSettings.AnalyticsQueryTimeout, environment variable MM_SQLSETTINGS_ANALYTICSQUERYTIMEOUT, System Console location, and default value 300 seconds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the ticket MM-67505 and accurately summarizes the main change: adding AnalyticsQueryTimeout setting documentation with its intended usage for materialized view refreshes.
Description check ✅ Passed The description is clearly related to the changeset, identifying it as a documentation update for a new setting added in another pull request, with a ticket reference for context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch MM-67505_analytics-timeout

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@source/administration-guide/configure/environment-configuration-settings.rst`:
- Around line 851-853: The RST section title "Analytics query timeout" has an
underline that is too short; update the underline (the line of ~ characters
immediately following the heading) so its length equals the length of "Analytics
query timeout" (use the same ~ character repeated to match the heading length)
to avoid RST title warnings during docs build.
- Around line 855-857: The table still references the old symbols
SqlSettings.QueryTimeout and MM_SQLSETTINGS_QUERYTIMEOUT; update the config key,
environment variable, and System Config path to the new analytics-specific
settings instead (replace occurrences of "SqlSettings.QueryTimeout" and
"MM_SQLSETTINGS_QUERYTIMEOUT" in the table with the new analytics config key and
env var, and change the System Config path entry from "Environment > Database"
to the analytics path such as "Environment > Analytics" to match the new
setting).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a629a6f3-bc7f-4135-9b0e-33454e1bf8e6

📥 Commits

Reviewing files that changed from the base of the PR and between 7768f17 and 5701778.

📒 Files selected for processing (1)
  • source/administration-guide/configure/environment-configuration-settings.rst

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Newest code from mattermost has been published to preview environment for Git SHA 5701778

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
source/administration-guide/configure/environment-configuration-settings.rst (1)

855-855: ⚠️ Potential issue | 🟠 Major

Fix stale config key/default in the analytics timeout table

Line 855 still points to SqlSettings > QueryTimeout > 30, which contradicts the new analytics-query-timeout setting definition above. This should reference AnalyticsQueryTimeout with default 300 to avoid misconfiguration.

Proposed fix
-| The number of seconds to wait for a response from the database after opening a connection  | - ``config.json`` setting: ``SqlSettings`` > ``QueryTimeout`` > ``30``  |
+| The number of seconds to wait for a response from the database after opening a connection  | - ``config.json`` setting: ``SqlSettings`` > ``AnalyticsQueryTimeout`` > ``300``  |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/administration-guide/configure/environment-configuration-settings.rst`
at line 855, Update the stale config key and default in the analytics timeout
table: replace the reference to "SqlSettings > QueryTimeout > 30" with the new
key name "AnalyticsQueryTimeout" and the correct default value "300" so the
table matches the `analytics-query-timeout` setting definition; ensure any
surrounding text or table column that names the config key or default is updated
to the exact identifier AnalyticsQueryTimeout and default 300 to avoid
misconfiguration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@source/administration-guide/configure/environment-configuration-settings.rst`:
- Line 855: Update the stale config key and default in the analytics timeout
table: replace the reference to "SqlSettings > QueryTimeout > 30" with the new
key name "AnalyticsQueryTimeout" and the correct default value "300" so the
table matches the `analytics-query-timeout` setting definition; ensure any
surrounding text or table column that names the config key or default is updated
to the exact identifier AnalyticsQueryTimeout and default 300 to avoid
misconfiguration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b755e186-9212-449e-a178-b0d9ef0e7cad

📥 Commits

Reviewing files that changed from the base of the PR and between 5701778 and 3cc3c5d.

📒 Files selected for processing (1)
  • source/administration-guide/configure/environment-configuration-settings.rst

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Newest code from mattermost has been published to preview environment for Git SHA 3cc3c5d

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
source/administration-guide/configure/environment-configuration-settings.rst (1)

854-860: ⚠️ Potential issue | 🟠 Major

Analytics query timeout table still references the old config key/default.

Line 855 should point to AnalyticsQueryTimeout with default 300, matching Lines 847-849. Right now it still references QueryTimeout/30.

Proposed fix
-| The number of seconds to wait for a response from the database after opening a connection  | - ``config.json`` setting: ``SqlSettings`` > ``QueryTimeout`` > ``30``  |
+| The number of seconds to wait for a response from the database after opening a connection  | - ``config.json`` setting: ``SqlSettings`` > ``AnalyticsQueryTimeout`` > ``300``  |
 | and sending certain analytics queries. This setting only applies to long queries which are | - System Config path: **Environment > Database**                        |
 | run in the background to populate some information in the Team and Site Statistics pages.  | - Environment variable: ``MM_SQLSETTINGS_ANALYTICSQUERYTIMEOUT``        |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/administration-guide/configure/environment-configuration-settings.rst`
around lines 854 - 860, The table entry incorrectly references SqlSettings >
QueryTimeout with default 30; update it to reference SqlSettings >
AnalyticsQueryTimeout with the default value 300 and ensure the Environment
variable remains MM_SQLSETTINGS_ANALYTICSQUERYTIMEOUT and System Config path
stays Environment > Database so the row matches the other mentions of
AnalyticsQueryTimeout (use the same key name "AnalyticsQueryTimeout" and default
"300" as on lines 847-849).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@source/administration-guide/configure/environment-configuration-settings.rst`:
- Around line 836-842: The table incorrectly maps Query timeout to
AnalyticsQueryTimeout; update the doc to reference the correct config key:
change the config.json setting mapping from ``SqlSettings`` >
``AnalyticsQueryTimeout`` to ``SqlSettings`` > ``QueryTimeout`` (keep the
Environment variable ``MM_SQLSETTINGS_QUERYTIMEOUT`` and System Config path
**Environment > Database** as-is) so the table matches the actual setting used
by SqlSettings.QueryTimeout.

---

Duplicate comments:
In
`@source/administration-guide/configure/environment-configuration-settings.rst`:
- Around line 854-860: The table entry incorrectly references SqlSettings >
QueryTimeout with default 30; update it to reference SqlSettings >
AnalyticsQueryTimeout with the default value 300 and ensure the Environment
variable remains MM_SQLSETTINGS_ANALYTICSQUERYTIMEOUT and System Config path
stays Environment > Database so the row matches the other mentions of
AnalyticsQueryTimeout (use the same key name "AnalyticsQueryTimeout" and default
"300" as on lines 847-849).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ebe19d9a-797f-4187-8fd9-b7c8b614e138

📥 Commits

Reviewing files that changed from the base of the PR and between 3cc3c5d and dcf42d4.

📒 Files selected for processing (1)
  • source/administration-guide/configure/environment-configuration-settings.rst

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Newest code from mattermost has been published to preview environment for Git SHA dcf42d4

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Newest code from mattermost has been published to preview environment for Git SHA 1e08e01

@hmhealey
Copy link
Copy Markdown
Member Author

hmhealey commented Apr 6, 2026

@coderabbitai Re-review this

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

@hmhealey Sure, I'll re-review the PR now!

✅ Actions performed

Full review triggered.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Newest code from mattermost has been published to preview environment for Git SHA dedb986

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@source/administration-guide/configure/environment-configuration-settings.rst`:
- Line 855: The documentation has an inconsistent default for
AnalyticsQueryTimeout in SqlSettings (config.json): line 855 shows "30" while
surrounding lines show "300"; update the text referencing AnalyticsQueryTimeout
under SqlSettings/AnalyticsQueryTimeout to use the correct default value "300"
so all occurrences match, and verify any adjacent table cells or examples also
reflect the 300-second default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23e77829-6511-4a49-aee2-3fc7a4a02736

📥 Commits

Reviewing files that changed from the base of the PR and between c83ea76 and dedb986.

📒 Files selected for processing (1)
  • source/administration-guide/configure/environment-configuration-settings.rst

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Newest code from mattermost has been published to preview environment for Git SHA bbf2f97

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Newest code from mattermost has been published to preview environment for Git SHA 62aff38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant