feature/add-tg-severity-setting - #585
Conversation
WalkthroughThis pull request updates the monitoring package's configuration by changing the version from Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/extra/monitoring/README.md (1)
15-15: Format the URL as a proper markdown link.Convert the bare URL to a proper markdown link for better readability and to follow markdown best practices.
-| `alerta.alerts.telegram.chatID` | specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `""` | +| `alerta.alerts.telegram.chatID` | specify multiple ID's separated by comma. Get yours in [chatid_echo_bot](https://t.me/chatid_echo_bot) | `""` |🧰 Tools
🪛 Markdownlint (0.37.0)
15-15: null
Bare URL used(MD034, no-bare-urls)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
packages/extra/monitoring/Chart.yaml(1 hunks)packages/extra/monitoring/README.md(1 hunks)packages/extra/monitoring/templates/alerta/alerta.yaml(1 hunks)packages/extra/monitoring/values.schema.json(1 hunks)packages/extra/monitoring/values.yaml(1 hunks)packages/extra/versions_map(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/extra/monitoring/Chart.yaml
🧰 Additional context used
🪛 Markdownlint (0.37.0)
packages/extra/monitoring/README.md
15-15: null
Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (6)
packages/extra/versions_map (1)
25-26: LGTM! Version mapping updates look correct.The version mapping follows the established pattern, with 1.6.1 properly mapped to a specific commit and 1.6.2 pointing to HEAD.
packages/extra/monitoring/README.md (1)
16-16: LGTM! New parameter documentation is clear and follows the established format.The documentation for
alerta.alerts.telegram.disabledSeverityclearly explains its purpose and expected format.packages/extra/monitoring/values.schema.json (1)
54-58: LGTM! Schema definition for new property is well-structured.The schema definition for
disabledSeverityfollows JSON Schema standards and properly aligns with the documentation.packages/extra/monitoring/values.yaml (1)
81-86: LGTM! Parameter documentation and example are clear.The new parameter is well-documented with clear examples of its usage.
packages/extra/monitoring/templates/alerta/alerta.yaml (2)
119-120: Verify conditional block's behavior with empty values.Since this is within a conditional block that checks for
chatIDandtoken, verify that emptydisabledSeverityvalues don't cause issues.Run this script to check the template rendering with various value combinations:
✅ Verification successful
Empty values for
disabledSeverityare safely handled within the Telegram conditional blockThe variable is only included when both
chatIDandtokenare present, and empty values are handled gracefully by Helm's templating engine. No issues found with the current implementation.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Test template rendering with different value combinations # Note: This assumes helm is available in the environment # Create test values files cat > test1.yaml << EOF alerta: alerts: telegram: chatID: "123" token: "abc" disabledSeverity: "" EOF cat > test2.yaml << EOF alerta: alerts: telegram: chatID: "123" token: "abc" disabledSeverity: "warning,info" EOF # Test template rendering for f in test1.yaml test2.yaml; do echo "Testing with $f:" helm template -f "$f" . | grep TELEGRAM_DISABLE_NOTIFICATION_SEVERITY doneLength of output: 543
Script:
#!/bin/bash # Get the context around the TELEGRAM_DISABLE_NOTIFICATION_SEVERITY variable rg -B 5 -A 5 "TELEGRAM_DISABLE_NOTIFICATION_SEVERITY" packages/extra/monitoring/templates/alerta/alerta.yaml # Also check for any telegram-related conditional blocks rg "telegram" packages/extra/monitoring/templates/alerta/alerta.yamlLength of output: 1193
119-120: LGTM! Consider documenting the format.The implementation correctly adds the new environment variable within the Telegram configuration block. The variable name follows the established naming convention, and the value is properly templated from Helm values.
Please ensure the format of
disabledSeverityis documented in the README.md. Run this command to verify:
| ## @param alerta.alerts.telegram.disabledSeverity list of severity without alerts, separated comma like: "informational,warning" | ||
| ## example: | ||
| ## telegram: | ||
| ## token: "7262461387:AAGtwq16iwuVtWtzoN6TUEMpF00fpC9Xz34" |
There was a problem hiding this comment.
Replace the example Telegram bot token with a placeholder.
The example appears to contain a real bot token. Replace it with a placeholder to avoid potential security risks.
- ## token: "7262461387:AAGtwq16iwuVtWtzoN6TUEMpF00fpC9Xz34"
+ ## token: "123456789:ABCdefGHIjklMNOpqrsTUVwxyz1234567890"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## token: "7262461387:AAGtwq16iwuVtWtzoN6TUEMpF00fpC9Xz34" | |
| ## token: "123456789:ABCdefGHIjklMNOpqrsTUVwxyz1234567890" |
af8be3e to
81d8e3d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/extra/monitoring/README.md (2)
15-15: Format the bare URL as a proper Markdown link.To comply with Markdown best practices and fix the markdownlint warning, format the URL as a proper Markdown link.
-| `alerta.alerts.telegram.chatID` | specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `""` | +| `alerta.alerts.telegram.chatID` | specify multiple ID's separated by comma. Get yours in [chatid_echo_bot](https://t.me/chatid_echo_bot) | `""` |🧰 Tools
🪛 Markdownlint (0.37.0)
15-15: null
Bare URL used(MD034, no-bare-urls)
16-16: Enhance documentation with valid severity values.The documentation should list the valid severity values that can be disabled to help users configure the setting correctly.
-| `alerta.alerts.telegram.disabledSeverity` | list of severity without alerts, separated comma like: "informational,warning" | `""` | +| `alerta.alerts.telegram.disabledSeverity` | list of severity levels to disable alerts for (valid values: critical, major, minor, warning, informational, debug), comma-separated | `""` |
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
packages/extra/monitoring/Chart.yaml(1 hunks)packages/extra/monitoring/README.md(1 hunks)packages/extra/monitoring/templates/alerta/alerta.yaml(1 hunks)packages/extra/monitoring/values.schema.json(1 hunks)packages/extra/monitoring/values.yaml(1 hunks)packages/extra/versions_map(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- packages/extra/monitoring/values.schema.json
- packages/extra/versions_map
- packages/extra/monitoring/templates/alerta/alerta.yaml
- packages/extra/monitoring/Chart.yaml
🧰 Additional context used
🪛 Markdownlint (0.37.0)
packages/extra/monitoring/README.md
15-15: null
Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (1)
packages/extra/monitoring/values.yaml (1)
84-84: Replace the example Telegram bot token with a placeholder.The example appears to contain a real bot token. Replace it with a placeholder to avoid potential security risks.
| ## @param alerta.alerts.telegram.disabledSeverity list of severity without alerts, separated comma like: "informational,warning" | ||
| ## example: | ||
| ## telegram: | ||
| ## token: "7262461387:AAGtwq16iwuVtWtzoN6TUEMpF00fpC9Xz34" | ||
| ## chatID: "-4520856007" | ||
| ## disabledSeverity: "informational,warning" |
There was a problem hiding this comment.
💡 Codebase verification
Add enum validation for severity levels in schema.
The disabledSeverity parameter should be updated in values.schema.json to validate against known severity levels:
- Add pattern validation to ensure comma-separated format
- Add enum validation for individual severity values: informational, warning, critical, major, ok, alert
🔗 Analysis chain
Add validation for severity values.
The disabledSeverity parameter should be validated to ensure only valid severity levels are accepted. Consider adding validation in the schema or application code.
Let's check if there's any validation in place:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for severity validation in the codebase
rg -i "severity.*valid" --type yaml --type json
rg -i "severity.*check" --type yaml --type json
# Search for schema definition
rg -i "disabledSeverity" --type json
Length of output: 464
Script:
#!/bin/bash
# Check the schema definition for disabledSeverity
rg -A 10 -B 2 "disabledSeverity" packages/extra/monitoring/values.schema.json
# Search for severity level definitions
rg -i "severity.*=|severity.*:|severity.*\[" --type ts --type js --type yaml
# Look for severity in configuration files
fd -e yaml -e yml -X rg -i "severity.*:" -A 3
Length of output: 73721
Summary by CodeRabbit
New Features
Documentation
alerta.alerts.telegram.disabledSeverity.Chores