-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
1,957 additions
and
1,417 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,3 +69,4 @@ source/developer/localization.md | |
# Generated PKI files | ||
*.key | ||
*.crt | ||
.aider* |
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Script to detect duplicate redirects in conf.py | ||
""" | ||
|
||
import os | ||
import sys | ||
from collections import defaultdict | ||
|
||
def load_redirects(): | ||
"""Load redirects dictionary from conf.py""" | ||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'source')) | ||
import conf | ||
return conf.redirects | ||
|
||
def find_duplicate_redirects(redirects): | ||
""" | ||
Analyze redirects dictionary for duplicates | ||
Returns tuple of (duplicate_sources, sources_to_same_target) | ||
""" | ||
# Track sources that map to the same target | ||
target_to_sources = defaultdict(list) | ||
# Track duplicate sources | ||
source_to_targets = defaultdict(list) | ||
|
||
for source, target in redirects.items(): | ||
# Track this source->target mapping | ||
source_to_targets[source].append(target) | ||
# Track this target's source | ||
target_to_sources[target].append(source) | ||
|
||
# Find duplicates | ||
duplicate_sources = { | ||
source: targets | ||
for source, targets in source_to_targets.items() | ||
if len(targets) > 1 | ||
} | ||
|
||
sources_to_same_target = { | ||
target: sources | ||
for target, sources in target_to_sources.items() | ||
if len(sources) > 1 | ||
} | ||
|
||
return duplicate_sources, sources_to_same_target | ||
|
||
def write_warnings(duplicate_sources, sources_to_same_target): | ||
"""Write warning messages to warnings.log""" | ||
os.makedirs('build', exist_ok=True) | ||
|
||
with open('build/warnings.log', 'a') as log: | ||
if duplicate_sources: | ||
warning = "\nDuplicate sources found (same source maps to multiple targets):\n" | ||
log.write(warning) | ||
print(warning) | ||
|
||
for source, targets in duplicate_sources.items(): | ||
msg = f"Source: {source}\n" | ||
msg += f"Maps to multiple targets: {targets}\n" | ||
log.write(msg) | ||
print(msg) | ||
|
||
if sources_to_same_target: | ||
warning = "\nMultiple sources map to same target:\n" | ||
log.write(warning) | ||
print(warning) | ||
|
||
for target, sources in sources_to_same_target.items(): | ||
msg = f"Target: {target}\n" | ||
msg += f"Has multiple sources: {sources}\n" | ||
log.write(msg) | ||
print(msg) | ||
|
||
def main(): | ||
redirects = load_redirects() | ||
duplicate_sources, sources_to_same_target = find_duplicate_redirects(redirects) | ||
write_warnings(duplicate_sources, sources_to_same_target) | ||
|
||
# Return non-zero exit code if duplicates found | ||
return 1 if duplicate_sources else 0 | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import re | ||
import sys | ||
from pathlib import Path | ||
|
||
if len(sys.argv) != 2: | ||
print("Usage: python fix_config_settings.py <rst_file_path>") | ||
sys.exit(1) | ||
|
||
def to_slug(text): | ||
# Convert text to lowercase and replace spaces with hyphens | ||
slug = text.lower().replace(' ', '-') | ||
# Remove any characters that aren't alphanumeric or hyphens | ||
slug = re.sub(r'[^a-z0-9-]', '', slug) | ||
# Replace multiple hyphens with single hyphen | ||
slug = re.sub(r'-+', '-', slug) | ||
return slug | ||
|
||
def process_file(filepath): | ||
with open(filepath, 'r', encoding='utf-8') as f: | ||
content = f.read() | ||
|
||
# Find all config:setting directives and their associated headings | ||
pattern = r'\.\.[\s]*config:setting::[\s]*([^\n]+)[\s\S]*?(?=^[^\s#].*$\n[-~=]+$)(.*?)\n[-~=]+' | ||
matches = re.finditer(pattern, content, re.MULTILINE) | ||
|
||
for match in matches: | ||
directive_value = match.group(1).strip() | ||
heading = match.group(2).strip() | ||
|
||
# Convert heading to slug format | ||
heading_slug = to_slug(heading) | ||
|
||
if directive_value != heading_slug: | ||
# Replace the directive value with the heading slug | ||
old_directive = f'.. config:setting:: {directive_value}' | ||
new_directive = f'.. config:setting:: {heading_slug}' | ||
content = content.replace(old_directive, new_directive) | ||
|
||
# Write the modified content back to the file | ||
with open(filepath, 'w', encoding='utf-8') as f: | ||
f.write(content) | ||
|
||
if __name__ == '__main__': | ||
filepath = sys.argv[1] | ||
process_file(filepath) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Support for Mattermost Server v9.11 :ref:`Extended Support Release <about/release-policy:extended support releases>` is coming to the end of its life cycle on May 15, 2025. Upgrading to :doc:`Mattermost Server v10.5 or later </about/mattermost-server-releases>` is required. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- Support for Mattermost Server v9.11 [Extended Support Release](https://docs.mattermost.com/about/release-policy.html#extended-support-releases) is coming to the end of its life cycle on May 15, 2025. Upgrading to Mattermost Server v10.5 or later is required. | ||
- Upgrading from ESR-to-ESR (``major`` -> ``major_next``) is fully supported and tested. However, upgrading from ESR-to-ESR (``major`` to ``major+2``) is supported, but not tested. If you plan to upgrade across multiple releases, we strongly recommend upgrading from an ESR to another ESR. For example, if you're upgrading from the v8.1 ESR, upgrade to the [v9.5 ESR](https://docs.mattermost.com/about/mattermost-v9-changelog.html#release-v9-5-extended-support-release) or the [v9.11 ESR](https://docs.mattermost.com/about/mattermost-v9-changelog.html#release-v9-11-extended-support-release). | ||
- See the [Important Upgrade Notes](https://docs.mattermost.com/upgrade/important-upgrade-notes.html) documentation for details on upgrading to a newer release. | ||
- See the [changelog in progress](https://bit.ly/2nK3cVf) for details about the upcoming release. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Support for Mattermost Server v9.11 [Extended Support Release](https://docs.mattermost.com/about/release-policy.html#extended-support-releases) is coming to the end of its life cycle on May 15, 2025. Upgrading to [Mattermost Server v10.5](https://docs.mattermost.com/about/mattermost-v10-changelog.html#release-v10-5-extended-support-release) or later is required. |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.