Skip to content

Improve notification silence docs#394

Merged
moshloop merged 6 commits intomainfrom
docs/silences-crd
Feb 18, 2026
Merged

Improve notification silence docs#394
moshloop merged 6 commits intomainfrom
docs/silences-crd

Conversation

@adityathebe
Copy link
Member

@adityathebe adityathebe commented May 22, 2025

resolves: #389

Summary by CodeRabbit

Release Notes

  • Documentation
    • Expanded silence documentation with creation methods, resource selection approaches (selectors and filters), and recursive mode behavior for child resources.
    • Added new notification template variables: silenceURL for silence links, notification channel type, and grouped resource names.
    • Enhanced field descriptions and targeting mechanism clarity.

@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for flanksource-docs ready!

Name Link
🔨 Latest commit 4c2741b
🔍 Latest deploy log https://app.netlify.com/projects/flanksource-docs/deploys/68904585e96e3b000853c097
😎 Deploy Preview https://deploy-preview-394--flanksource-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for canarychecker canceled.

Name Link
🔨 Latest commit 4cadec2
🔍 Latest deploy log https://app.netlify.com/projects/canarychecker/deploys/69946240fad16500088a2996

@adityathebe adityathebe requested a review from moshloop May 22, 2025 05:19
@moshloop moshloop requested a review from Copilot May 23, 2025 06:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates several submodule references and enhances the documentation for notification silences by adding a detailed reference MDX and reorganizing the conceptual guide.

  • Bump submodule commits in multiple modules/* and the root mission-control-chart
  • Introduce _silence.mdx to document silence fields and resource selector schema
  • Revise silences.mdx guide with an import, example fixture, and clearer sections on creation, filters, and recursion

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
modules/mission-control-registry updated subproject commit
modules/mission-control-chart updated subproject commit
modules/mission-control updated subproject commit
modules/duty updated subproject commit
modules/canary-checker updated subproject commit
mission-control-chart updated subproject commit
mission-control/docs/reference/notifications/_silence.mdx new reference doc for silence API fields
mission-control/docs/guide/notifications/concepts/silences.mdx restructured guide with import, example block, and sections

@moshloop
Copy link
Member

Can we add an example of a filter in a full spec. The selectors table also seems incomplete.

@adityathebe
Copy link
Member Author

Can we add an example of a filter in a full spec. The selectors table also seems incomplete.

flanksource/mission-control#2115

@adityathebe adityathebe requested a review from moshloop June 4, 2025 07:26
@vercel
Copy link

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Feb 17, 2026 0:43am

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Walkthrough

Documentation for notification silences is expanded and clarified. A guide now covers concepts including resource selection, filtering, and recursive mode with creation methods. Reference documentation defines silence field schemas and adds new notification template variables (silenceURL, channel, groupedResources) across CheckHealth and ConfigEvents contexts.

Changes

Cohort / File(s) Summary
Silence Documentation
mission-control/docs/guide/notifications/concepts/silences.mdx, mission-control/docs/reference/notifications/_silence.mdx
Guide expanded with resource selection methods, filters, and recursive mode sections. Reference file adds templated Fields block defining silence fields (description, from, until, recursive, filter, selectors) with requirement that at least one targeting method (filter or selectors) must be specified.
Notification Template Variables
mission-control/docs/reference/notifications/_env_vars.mdx
Added new template variables (silenceURL, channel, groupedResources) for CheckHealth and ConfigEvents contexts. Updated existing field descriptions (permalink, agent). Added recent_events field for ConfigEvents.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: improving documentation for notification silences.
Linked Issues check ✅ Passed The PR adds CRD documentation with field definitions and creates guides for notification silences, addressing issue #389's requirement for CRD docs with examples.
Out of Scope Changes check ✅ Passed All changes focus on documentation updates for notification silences, directly aligned with issue #389 objectives; no unrelated modifications detected.
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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/silences-crd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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: 4

🤖 Fix all issues with AI agents
In `@mission-control/docs/guide/notifications/concepts/silences.mdx`:
- Around line 70-76: The image `silence-notification-form.png` under the
"Recursive Mode" heading is not illustrating recursive parent→child behavior;
move this image out of the "Recursive Mode" section and either place it under
the "Creating Silences" section or replace it with a new diagram that visually
depicts the parent→child relationship (namespace → deployments/statefulsets →
pods). Update the MDX around the "Recursive Mode" heading to reference the new
illustrative diagram (or add a caption) and ensure the image filename or alt
text clearly indicates whether it is the general creation form
(`silence-notification-form.png`) or the recursive relationship diagram.
- Around line 20-22: The YAML code fence in the MDX uses a non-existent file
reference and an empty title: update the code block in
mission-control/docs/guide/notifications/concepts/silences.mdx by either (a)
replacing
file=<rootDir>/modules/mission-control/fixtures/silences/silence-test-env.yaml
with a correct existing fixture path, (b) removing the file= directive and
pasting the YAML inline, or (c) deleting the whole code fence if not needed;
also remove the empty title="" or replace it with a meaningful label like
title="Example silence configuration", and delete the trailing space after the
closing backticks to ensure the block renders correctly.

In `@mission-control/docs/reference/notifications/_silence.mdx`:
- Around line 39-52: Update the Resource Selector block: rename the field key
"kind" to "types" in the Fields rows (the selector accepts resource type
patterns like "Kubernetes::Pod", "Kubernetes::*", "AWS::EC2::Instance"), and
either expand the rows to include the standard ResourceSelector fields (add
entries for namespace, labelSelector, tagSelector, id, health, statuses, etc.,
with brief descriptions and scheme types) or replace the rows with a single
sentence linking to the canonical ResourceSelector docs
(/docs/reference/resource-selector) if silences support the full API; ensure the
"name" entry remains and adjust descriptions to reflect matching patterns and
optionality.
- Around line 26-30: In _silence.mdx update the templateEnv entries so their
"url" values include the /docs prefix (i.e., change
"/reference/notifications/template_vars/checks",
"/reference/notifications/template_vars/config", and
"/reference/notifications/template_vars/components" to
"/docs/reference/notifications/template_vars/checks",
"/docs/reference/notifications/template_vars/config", and
"/docs/reference/notifications/template_vars/components"); locate the
templateEnv array in _silence.mdx and edit the three URL strings so they match
the /docs/... path used elsewhere.
🧹 Nitpick comments (2)
mission-control/docs/guide/notifications/concepts/silences.mdx (2)

30-37: Consider adding a full CR example with a filter.

Per reviewer feedback, a full NotificationSilence spec example that includes a filter field would help users understand how to combine selectors and filters in practice. The YAML fixture imported on line 21 may partially cover this — verify it includes a filter example, and if not, consider adding a second fixture import that demonstrates one.


56-61: Long CEL expression in table cell may hurt readability.

The catalog.traverse(...) filter on line 61 is very long for a markdown table cell. Consider moving complex examples into a separate code block below the table, or breaking the expression across multiple lines with explanation.

Copy link

@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.

🧹 Nitpick comments (4)
mission-control/docs/reference/notifications/_env_vars.mdx (1)

48-90: Consider extracting shared fields to reduce duplication.

silenceURL, channel, and groupedResources are defined identically in both CheckHealthEnv and ConfigEventsTemplateVars. You could extract these into a shared array and spread them into both rows arrays to keep them in sync.

This is a minor nit for a docs file — fine to defer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mission-control/docs/reference/notifications/_env_vars.mdx` around lines 48 -
90, ConfigEventsTemplateVars duplicates fields (silenceURL, channel,
groupedResources) that are also present in CheckHealthEnv; extract those three
field objects into a shared constant (e.g., SHARED_NOTIFICATION_FIELDS) and then
spread that array into the rows arrays in both ConfigEventsTemplateVars and
CheckHealthEnv so both functions reference the single source of truth for those
fields.
mission-control/docs/guide/notifications/concepts/silences.mdx (3)

59-66: Long filter expression in line 66 will render poorly in the table.

The catalog.traverse(...) filter expression is ~200 characters wide and will cause horizontal overflow in the rendered table. Consider moving it below the table as a standalone fenced code block with an explanation, or splitting it across multiple lines using a code block within the cell.

📝 One approach: extract complex example below the table

Replace line 66 in the table with a simpler entry, then add the complex example as a standalone block after the table:

-| `config.type == "Kubernetes::Pod" && catalog.traverse(config.id, "Kubernetes::Namespace", "incoming").size > 0 && catalog.traverse(config.id, "Kubernetes::Namespace", "incoming")[0].tags.?env.orValue("") == "prod"` | Matches pods in production namespaces |
+| See advanced example below | Matches pods in production namespaces |

Then after the table:

**Advanced filter example — Matching pods in production namespaces:**

```cel
config.type == "Kubernetes::Pod"
  && catalog.traverse(config.id, "Kubernetes::Namespace", "incoming").size > 0
  && catalog.traverse(config.id, "Kubernetes::Namespace", "incoming")[0].tags.?env.orValue("") == "prod"
`` `
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mission-control/docs/guide/notifications/concepts/silences.mdx` around lines
59 - 66, The long catalog.traverse(...) filter expression causes horizontal
overflow in the table; replace that table cell's complex entry with a short
summary (e.g., "Matches pods in production namespaces") and move the full
expression out of the table into a fenced code block below with a brief heading,
then format the expression across multiple lines using logical operators
(referencing the exact expression using catalog.traverse(config.id,
"Kubernetes::Namespace", "incoming"), .size, [0].tags.?env.orValue("") and
config.type == "Kubernetes::Pod") so readers get the full advanced example
without breaking the table layout.

47-49: Consider clarifying the filter/selector relationship as "OR" logic.

The current wording accurately describes the evaluation order, but readers may not immediately grasp that this is effectively an OR — a silence triggers if either the filter or a selector matches. Adding a brief "i.e., the silence applies if either the filter or a selector matches" would make the intent immediately obvious.

📝 Suggested wording
-When both `filter` and `selectors` are specified, the filter is evaluated first. If the filter matches, the silence is applied. Selectors are only evaluated if the filter does not match.
+When both `filter` and `selectors` are specified, either one can trigger the silence (OR logic). The filter is evaluated first — if it matches, the silence is applied immediately. Selectors are only evaluated if the filter does not match.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mission-control/docs/guide/notifications/concepts/silences.mdx` around lines
47 - 49, The info admonition that currently explains evaluation order for
`filter` and `selectors` should explicitly state the logical relationship as OR:
update the text inside the info block so it ends with a short clarifying
sentence such as "i.e., the silence applies if either the `filter` matches or
any `selector` matches" to make the intent immediate while keeping the existing
evaluation-order detail; touch the line containing the `When both `filter` and
`selectors` are specified...` paragraph and append the OR clarification
referencing `filter` and `selectors`.

51-53: Selectors section could be more detailed per reviewer feedback.

moshloop noted the selectors table appears incomplete. Currently this section only links to the Resource Selectors reference page without showing the available selector fields (e.g., types, names, namespaces, labels, tags). Consider adding a brief table or inline summary of the key selector fields to make this section self-contained, similar to how the Filters section provides inline examples.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mission-control/docs/guide/notifications/concepts/silences.mdx` around lines
51 - 53, Update the "Selectors" section to include a concise inline summary of
the available selector fields (instead of only linking to Resource Selectors):
list the key fields `types`, `names`, `namespaces`, `labels`, and `tags`,
describe expected value formats (e.g., `types: ["Pod","Deployment"]`, `names:
["web-1"]`, `namespaces: ["prod"]`, `labels: {"app":"frontend"}` or label
selectors, `tags: ["critical"]`), and add one short example showing multiple
selectors combined; keep the reference link to /docs/reference/resource-selector
for full details.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@mission-control/docs/guide/notifications/concepts/silences.mdx`:
- Around line 20-22: The fenced code block uses an empty title and a
likely-nonexistent fixture path and has a trailing space; update the
triple-backtick block attributes by either replacing title="" with a meaningful
title (e.g., title="silence test env") or removing the title attribute, correct
or remove the file attribute if
<rootDir>/modules/mission-control/fixtures/silences/silence-test-env.yaml does
not exist (or point it to the actual fixture path), and remove the trailing
space at the end of the block so the code fence is clean; look for the code
block that contains the attributes "title" and
"file=<rootDir>/modules/mission-control/fixtures/silences/silence-test-env.yaml"
to apply these changes.

---

Nitpick comments:
In `@mission-control/docs/guide/notifications/concepts/silences.mdx`:
- Around line 59-66: The long catalog.traverse(...) filter expression causes
horizontal overflow in the table; replace that table cell's complex entry with a
short summary (e.g., "Matches pods in production namespaces") and move the full
expression out of the table into a fenced code block below with a brief heading,
then format the expression across multiple lines using logical operators
(referencing the exact expression using catalog.traverse(config.id,
"Kubernetes::Namespace", "incoming"), .size, [0].tags.?env.orValue("") and
config.type == "Kubernetes::Pod") so readers get the full advanced example
without breaking the table layout.
- Around line 47-49: The info admonition that currently explains evaluation
order for `filter` and `selectors` should explicitly state the logical
relationship as OR: update the text inside the info block so it ends with a
short clarifying sentence such as "i.e., the silence applies if either the
`filter` matches or any `selector` matches" to make the intent immediate while
keeping the existing evaluation-order detail; touch the line containing the
`When both `filter` and `selectors` are specified...` paragraph and append the
OR clarification referencing `filter` and `selectors`.
- Around line 51-53: Update the "Selectors" section to include a concise inline
summary of the available selector fields (instead of only linking to Resource
Selectors): list the key fields `types`, `names`, `namespaces`, `labels`, and
`tags`, describe expected value formats (e.g., `types: ["Pod","Deployment"]`,
`names: ["web-1"]`, `namespaces: ["prod"]`, `labels: {"app":"frontend"}` or
label selectors, `tags: ["critical"]`), and add one short example showing
multiple selectors combined; keep the reference link to
/docs/reference/resource-selector for full details.

In `@mission-control/docs/reference/notifications/_env_vars.mdx`:
- Around line 48-90: ConfigEventsTemplateVars duplicates fields (silenceURL,
channel, groupedResources) that are also present in CheckHealthEnv; extract
those three field objects into a shared constant (e.g.,
SHARED_NOTIFICATION_FIELDS) and then spread that array into the rows arrays in
both ConfigEventsTemplateVars and CheckHealthEnv so both functions reference the
single source of truth for those fields.

Add silenceURL, channel, recent_events, and groupedResources to
check and config event template variable docs. Fix templateEnv URLs
in silence reference to use /docs/ prefix.
Copy link

@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.

🧹 Nitpick comments (1)
mission-control/docs/guide/notifications/concepts/silences.mdx (1)

61-66: Long filter expression in Line 66 hurts table readability.

The catalog.traverse filter example on Line 66 is very long and will likely overflow horizontally in the rendered table. Consider moving complex examples into a dedicated code block below the table with an explanation, keeping only concise examples in the table.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mission-control/docs/guide/notifications/concepts/silences.mdx` around lines
61 - 66, The table row containing the long filter using catalog.traverse (the
expression starting with config.type == "Kubernetes::Pod" &&
catalog.traverse(...)) should be shortened to keep the table readable: replace
the long expression in the table with a concise example or a short placeholder
like "See example below" and move the full complex filter into a separate code
block immediately below the table with a brief explanation of what it matches;
update any nearby text to reference the code block and ensure the complex filter
uses the same symbols (catalog.traverse, config.id, Kubernetes::Namespace,
tags.?env.orValue("")) so readers can correlate the example with the table
entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@mission-control/docs/guide/notifications/concepts/silences.mdx`:
- Around line 20-22: The code block reference to a fixture is broken: update the
YAML code block metadata so the file path points to an existing fixture and
provide a non-empty title; specifically edit the fenced code block that
currently lists
file=<rootDir>/modules/mission-control/fixtures/silences/silence-test-env.yaml
and title="" to either correct the file path to the actual fixture (or remove
the file attribute if none) and set a meaningful title (e.g., title="silence
test env") so the markdown includes a valid fixture reference.

---

Nitpick comments:
In `@mission-control/docs/guide/notifications/concepts/silences.mdx`:
- Around line 61-66: The table row containing the long filter using
catalog.traverse (the expression starting with config.type == "Kubernetes::Pod"
&& catalog.traverse(...)) should be shortened to keep the table readable:
replace the long expression in the table with a concise example or a short
placeholder like "See example below" and move the full complex filter into a
separate code block immediately below the table with a brief explanation of what
it matches; update any nearby text to reference the code block and ensure the
complex filter uses the same symbols (catalog.traverse, config.id,
Kubernetes::Namespace, tags.?env.orValue("")) so readers can correlate the
example with the table entry.

@moshloop moshloop merged commit 6bfb827 into main Feb 18, 2026
15 checks passed
@moshloop moshloop deleted the docs/silences-crd branch February 18, 2026 07:17
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.

Add CRD Docs with examples for notification silences

3 participants