Skip to content

Conversation

@adityathebe
Copy link
Member

@adityathebe adityathebe commented Nov 6, 2025

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive Scopes guide explaining resource targeting, selector logic, supported resource types, evaluation flow, and multi-tenant integration.
    • Added example pages: combining selectors, global resource selectors, multi-tenancy patterns, multiple resource types, agent-based targeting, tag-based targeting, canary scoping, playbook targeting, and wildcard matching.

@vercel
Copy link

vercel bot commented Nov 6, 2025

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Feb 12, 2026 9:16am

Request Review

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for canarychecker canceled.

Name Link
🔨 Latest commit 6618781
🔍 Latest deploy log https://app.netlify.com/projects/canarychecker/deploys/698d9a35e1cff200083c04ae

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for flanksource-docs failed. Why did it fail? →

Name Link
🔨 Latest commit beddf82
🔍 Latest deploy log https://app.netlify.com/projects/flanksource-docs/deploys/690c630d8723820008b5cd33

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Walkthrough

Adds comprehensive documentation for Mission Control's permission Scopes: a core concept guide and an Examples section with multiple pages illustrating selector logic, global and per-resource targeting, wildcard usage, agent/tag/canary/playbook targeting, multiple-resource targets, and multi-tenancy isolation patterns.

Changes

Cohort / File(s) Summary
Scope Concept Definition
mission-control/docs/guide/permissions/concepts/scope.md
New core guide defining Scope, ScopeResourceSelector fields (agent, namespace, name, tagSelector), supported resource types, ABAC integration, evaluation flow, and multi-tenancy notes.
Examples Index
mission-control/docs/guide/permissions/examples/index.md
Adds examples landing page with Docusaurus front matter and DocCardList render.
Selector Combination & Logic
mission-control/docs/guide/permissions/examples/combining-selectors.md, mission-control/docs/guide/permissions/examples/targeting-by-tags.md
Documents AND/OR semantics for selector fields, multiple targets, and tagSelector behavior with YAML examples and use cases.
Global & Multi-Resource Targeting
mission-control/docs/guide/permissions/examples/global-resource-selectors.md, mission-control/docs/guide/permissions/examples/multiple-resource-types.md
Introduces global resource selector usage and examples; explains single-scope multi-resource targets (OR across targets) and trade-offs.
Agent & Wildcard Targeting
mission-control/docs/guide/permissions/examples/targeting-by-agent.md, mission-control/docs/guide/permissions/examples/targeting-with-wildcards.md
Examples for scoping by reporting agent (OR across agents) and using literal * wildcard for name matching (limitations noted).
Resource-Specific Examples
mission-control/docs/guide/permissions/examples/targeting-canaries.md, mission-control/docs/guide/permissions/examples/targeting-specific-playbooks.md
Adds examples targeting canaries by name and targeting specific playbooks within a namespace, with YAML snippets and use cases.
Multi-Tenancy Patterns
mission-control/docs/guide/permissions/examples/multi-tenancy-patterns.md
New guide presenting environment, team-based, customer, and multi-dimensional isolation patterns with YAML examples and key principles.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: Permission docs' is vague and uses a generic term. While 'Permission docs' indicates the changeset relates to documentation, the word 'fix' does not convey meaningful information about what was actually added or changed (nine new documentation files were introduced). Consider using a more descriptive title that reflects the primary change, such as 'docs: Add comprehensive permission scoping and multi-tenancy examples' or 'docs: Introduce Scope concepts and permission usage patterns'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 fix-permission-docs

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
mission-control/docs/guide/permissions/examples/targeting-by-agent.md (1)

11-11: Consider varying sentence structure for better readability.

The static analysis tool notes that lines 10-11 have successive sentences beginning with "This." While grammatically correct, varying the sentence structure improves readability per the Google Style Guide.

✍️ Suggested rewrite
-This Scope includes all configs reported by either `agent-prod-1` or `agent-prod-2`. The multiple targets use OR logic, so any config from either agent will match this Scope.
+This Scope includes all configs reported by either `agent-prod-1` or `agent-prod-2`. Multiple targets use OR logic, so any config from either agent matches the Scope.

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: 15

🤖 Fix all issues with AI agents
In `@mission-control/docs/guide/permissions/concepts/scope.md`:
- Line 48: Replace the passive sentence "Scopes are designed to work seamlessly
with Attribute-Based Access Control (ABAC)" with an active-voice construction;
update the line that references Scopes and ABAC (the sentence containing "Scopes
are designed to work seamlessly") to an active form such as "We designed Scopes
to work seamlessly with Attribute‑Based Access Control (ABAC)" or "Scopes work
seamlessly with Attribute‑Based Access Control (ABAC)" so the document uses
active voice consistently.
- Line 73: Line reads "If the resource matches any target in any of the user's
Scopes, access is granted" and uses passive voice; change it to active voice by
replacing "access is granted" with an active subject, e.g., "the system grants
access" (resulting sentence: "If the resource matches any target in any of the
user's Scopes, the system grants access (subject to action restrictions)").
Update that sentence in scope.md accordingly.
- Line 14: Rewrite the passive sentence describing how multiple targets combine
into an active-voice sentence: replace "Multiple targets within a Scope are
combined with OR logic" with an active construction such as "When a Scope
contains multiple targets, the system combines them with OR logic, so a resource
matches the Scope if it matches any target"; update the line describing
Scope/targets to use this active phrasing and keep the rest of the sentence
about a resource matching any target intact.
- Around line 50-64: Replace the inline YAML example in scope.md (the Permission
example for dev-team-access) with a code block using the file= directive
pointing to a fixture and create that fixture; specifically remove the inline
Permission YAML and add a ```yaml title="dev-team-access.yaml" file=...```
block, then add a fixture named dev-team-access.yaml in the mission-control
submodule fixtures/permissions containing the original YAML (kind: Permission,
metadata.name: dev-team-access, subjects: Group dev-team, scopes:
[prod-agent-configs], actions: [read, update]) so the docs import the example
instead of embedding it inline.

In `@mission-control/docs/guide/permissions/examples/combining-selectors.md`:
- Around line 7-20: Replace the inline YAML with a code block that uses the
file= import directive pointing to a fixture named prod-west-configs.yaml and
create that fixture in the mission-control module fixtures (scopes) containing
the same Scope resource (kind: Scope, metadata.name: prod-west-configs,
namespace: default, spec.description: "Production configs in us-west region from
specific agent", spec.targets: - config: agent: agent-west-1, namespace:
production, tagSelector: "region=us-west"); update the doc code block to use
```yaml title="prod-west-configs.yaml" file=<point to that mission-control
fixture>``` so the example is imported rather than inlined.

In
`@mission-control/docs/guide/permissions/examples/global-resource-selectors.md`:
- Around line 7-18: Replace the inline YAML in global-resource-selectors.md with
a file-import code block that references the fixture file named
namespace-restricted.yaml (e.g. ```yaml title="namespace-restricted.yaml"
file=...```) and create that fixture in the mission-control module's
fixtures/scopes directory; the new fixture must contain the original Scope
manifest (kind: Scope, metadata.name: namespace-restricted, metadata.namespace:
default, spec.description: "All resources in specific namespace", spec.targets
-> global.namespace: restricted-zone) so the documentation imports the example
instead of inlining it.
- Around line 40-59: Replace the two inline YAML examples with imported
fixtures: create fixture files named global-example.yaml and
individual-targets-example.yaml inside the mission-control fixtures scopes, then
replace the inline code blocks in global-resource-selectors.md with fenced code
blocks using the file= directive to reference those two fixture filenames (keep
the title attributes as shown). Locate the existing inline blocks in
global-resource-selectors.md (the "global" example and the "Using individual
targets" example) and swap them for the file-import style code fences that point
to the new mission-control fixture files.

In `@mission-control/docs/guide/permissions/examples/multi-tenancy-patterns.md`:
- Line 68: The sentence "Each customer's resources are tagged appropriately, and
Scopes ensure customer data isolation." uses passive voice; replace it with an
active-voice construction such as "We tag each customer's resources and use
Scopes to ensure customer data isolation." Locate the sentence (the line
containing "Each customer's resources are tagged appropriately") and update it
to the active phrasing so the subject performs the actions ("We tag..." / "The
system tags...") and retain the mention of Scopes for isolation.
- Around line 34-47: Replace the inline YAML example for the Scope named
"platform-team-resources" with a code block that uses the file= directive (and
title "platform-team-resources.yaml") and create a fixture file in the
mission-control module's fixtures/scopes named platform-team-resources.yaml
containing the original YAML (apiVersion: mission-control.flanksource.com/v1,
kind: Scope, metadata.name: platform-team-resources, metadata.namespace:
default, spec.description, spec.targets with config/component namespace:
platform-team). Update the code block in multi-tenancy-patterns.md to reference
that fixture file instead of embedding the YAML.
- Around line 11-26: Replace the inline YAML block in multi-tenancy-patterns.md
with a code block using the file= directive that references a fixture (title
"production-resources.yaml"); then add a fixture file named
production-resources.yaml under the mission-control module's fixtures/scopes
directory containing the original Scope manifest (kind: Scope, metadata.name:
production-resources, metadata.namespace: default, spec.description: All
production resources, spec.targets with config/component/playbook tagSelector
"env=production") so the document imports the example instead of embedding it
inline.
- Around line 74-86: Replace the inline YAML in multi-tenancy-patterns.md (the
Scope example named team-a-prod-west) with a YAML code block using the file=
directive (title "team-a-prod-west.yaml" and file pointing to the fixture), and
create the corresponding fixture file team-a-prod-west.yaml under the
mission-control fixtures scopes directory containing the original Scope YAML
(apiVersion: mission-control.flanksource.com/v1, kind: Scope, metadata
name/team-a-prod-west namespace/default, spec description and targets with
config namespace/tagSelector) so the docs import the example instead of
embedding it inline.
- Around line 55-66: Replace the inline YAML block in
mission-control/docs/guide/permissions/examples/multi-tenancy-patterns.md with a
code block that uses the file= directive pointing to a fixture named
customer-acme-resources.yaml, and add that fixture to the mission-control
fixtures (scopes) submodule; the fixture should contain the original Scope
resource with metadata.name customer-acme-resources, metadata.namespace default
and the spec (description: "All resources for ACME Corp" and targets -> config
-> tagSelector: "customer=acme"). Ensure the code block uses
title="customer-acme-resources.yaml" and the file= directive referencing the new
fixture.

In `@mission-control/docs/guide/permissions/examples/multiple-resource-types.md`:
- Around line 7-22: Replace the inline YAML example for the Scope resource named
"monitoring-stack" with a code block using the file= directive (e.g., ```yaml
title="monitoring-stack.yaml" file=...```), and create the referenced fixture
file containing the original YAML content (Scope, metadata.name
monitoring-stack, namespace default, spec.description and targets for
config/component/canary with tagSelector "app=prometheus") in the
mission-control module's fixtures for scopes so the documentation imports the
example instead of embedding it inline.

In `@mission-control/docs/guide/permissions/examples/targeting-by-tags.md`:
- Line 5: Rewrite the passive sentence "Tag-based scoping is the most flexible
approach as it allows resources to be added or removed from the scope by simply
updating their tags." to active voice; for example, change it to "Tag-based
scoping is the most flexible approach because you can add or remove resources
from the scope by simply updating their tags." Update that sentence in the
document so the paragraph uses active voice throughout.

In `@mission-control/docs/guide/permissions/examples/targeting-with-wildcards.md`:
- Line 14: Rewrite the passive sentence to active voice: change "Prefix and
suffix wildcards (e.g., `nginx-*` or `*-prod`) are **NOT** supported." to an
active construction referencing the product (e.g., "Mission Control does **NOT**
support prefix and suffix wildcards (e.g., `nginx-*` or `*-prod`)."), leaving
the earlier clause about the `name` field and the special wildcard directive `*`
unchanged.
🧹 Nitpick comments (1)
mission-control/docs/guide/permissions/examples/multi-tenancy-patterns.md (1)

5-5: Consider rewording for stronger active voice.

While not strictly passive, "Scopes are fundamental" could be rewritten more actively to align with Google Style Guide recommendations.

✍️ Suggested rewrite
-Scopes are fundamental to implementing multi-tenancy in Mission Control. Here are common patterns for partitioning resources across different tenants, teams, or organizational units.
+Scopes provide the foundation for implementing multi-tenancy in Mission Control. The following sections describe common patterns for partitioning resources across different tenants, teams, or organizational units.

Comment on lines 50 to 64
```yaml
apiVersion: mission-control.flanksource.com/v1
kind: Permission
metadata:
name: dev-team-access
spec:
subjects:
- kind: Group
name: dev-team
scopes:
- prod-agent-configs # Reference to Scope
actions:
- read
- update
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Replace inline YAML with file= directive import.

The YAML example is written directly in the documentation, which violates the coding guidelines. As per coding guidelines: "Never write YAML examples directly; import examples from submodules (mission-control, duty, config-db, canary-checker) using code blocks with file= directive."

📝 Required change
-```yaml
-apiVersion: mission-control.flanksource.com/v1
-kind: Permission
-metadata:
-  name: dev-team-access
-spec:
-  subjects:
-    - kind: Group
-      name: dev-team
-  scopes:
-    - prod-agent-configs  # Reference to Scope
-  actions:
-    - read
-    - update
-```
+```yaml title="dev-team-access.yaml" file=<rootDir>/modules/mission-control/fixtures/permissions/dev-team-access.yaml
+
+```

Create the corresponding fixture file in the mission-control submodule.

🤖 Prompt for AI Agents
In `@mission-control/docs/guide/permissions/concepts/scope.md` around lines 50 -
64, Replace the inline YAML example in scope.md (the Permission example for
dev-team-access) with a code block using the file= directive pointing to a
fixture and create that fixture; specifically remove the inline Permission YAML
and add a ```yaml title="dev-team-access.yaml" file=...``` block, then add a
fixture named dev-team-access.yaml in the mission-control submodule
fixtures/permissions containing the original YAML (kind: Permission,
metadata.name: dev-team-access, subjects: Group dev-team, scopes:
[prod-agent-configs], actions: [read, update]) so the docs import the example
instead of embedding it inline.

Comment on lines 7 to 20
```yaml
apiVersion: mission-control.flanksource.com/v1
kind: Scope
metadata:
name: prod-west-configs
namespace: default
spec:
description: Production configs in us-west region from specific agent
targets:
- config:
agent: agent-west-1
namespace: production
tagSelector: "region=us-west"
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Replace inline YAML with file= directive import.

The YAML example is written directly in the documentation, which violates the coding guidelines. All YAML examples must be imported from submodules using the file= directive. As per coding guidelines: "Never write YAML examples directly; import examples from submodules (mission-control, duty, config-db, canary-checker) using code blocks with file= directive."

📝 Required change
-```yaml
-apiVersion: mission-control.flanksource.com/v1
-kind: Scope
-metadata:
-  name: prod-west-configs
-  namespace: default
-spec:
-  description: Production configs in us-west region from specific agent
-  targets:
-    - config:
-        agent: agent-west-1
-        namespace: production
-        tagSelector: "region=us-west"
-```
+```yaml title="prod-west-configs.yaml" file=<rootDir>/modules/mission-control/fixtures/scopes/prod-west-configs.yaml
+
+```

You'll need to create the corresponding fixture file in the mission-control submodule.

🤖 Prompt for AI Agents
In `@mission-control/docs/guide/permissions/examples/combining-selectors.md`
around lines 7 - 20, Replace the inline YAML with a code block that uses the
file= import directive pointing to a fixture named prod-west-configs.yaml and
create that fixture in the mission-control module fixtures (scopes) containing
the same Scope resource (kind: Scope, metadata.name: prod-west-configs,
namespace: default, spec.description: "Production configs in us-west region from
specific agent", spec.targets: - config: agent: agent-west-1, namespace:
production, tagSelector: "region=us-west"); update the doc code block to use
```yaml title="prod-west-configs.yaml" file=<point to that mission-control
fixture>``` so the example is imported rather than inlined.

Comment on lines 74 to 86
```yaml
apiVersion: mission-control.flanksource.com/v1
kind: Scope
metadata:
name: team-a-prod-west
namespace: default
spec:
description: Team A production resources in west region
targets:
- config:
namespace: team-a
tagSelector: "env=production,region=west"
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Replace inline YAML with file= directive import.

The YAML example is written directly in the documentation, which violates the coding guidelines. As per coding guidelines: "Never write YAML examples directly; import examples from submodules (mission-control, duty, config-db, canary-checker) using code blocks with file= directive."

📝 Required change
-```yaml
-apiVersion: mission-control.flanksource.com/v1
-kind: Scope
-metadata:
-  name: team-a-prod-west
-  namespace: default
-spec:
-  description: Team A production resources in west region
-  targets:
-    - config:
-        namespace: team-a
-        tagSelector: "env=production,region=west"
-```
+```yaml title="team-a-prod-west.yaml" file=<rootDir>/modules/mission-control/fixtures/scopes/team-a-prod-west.yaml
+
+```

Create the corresponding fixture file in the mission-control submodule.

🤖 Prompt for AI Agents
In `@mission-control/docs/guide/permissions/examples/multi-tenancy-patterns.md`
around lines 74 - 86, Replace the inline YAML in multi-tenancy-patterns.md (the
Scope example named team-a-prod-west) with a YAML code block using the file=
directive (title "team-a-prod-west.yaml" and file pointing to the fixture), and
create the corresponding fixture file team-a-prod-west.yaml under the
mission-control fixtures scopes directory containing the original Scope YAML
(apiVersion: mission-control.flanksource.com/v1, kind: Scope, metadata
name/team-a-prod-west namespace/default, spec description and targets with
config namespace/tagSelector) so the docs import the example instead of
embedding it inline.

Comment on lines 7 to 22
```yaml
apiVersion: mission-control.flanksource.com/v1
kind: Scope
metadata:
name: monitoring-stack
namespace: default
spec:
description: Complete monitoring stack resources
targets:
- config:
tagSelector: "app=prometheus"
- component:
tagSelector: "app=prometheus"
- canary:
tagSelector: "app=prometheus"
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Replace inline YAML with file= directive import.

The YAML example is written directly in the documentation, which violates the coding guidelines. As per coding guidelines: "Never write YAML examples directly; import examples from submodules (mission-control, duty, config-db, canary-checker) using code blocks with file= directive."

📝 Required change
-```yaml
-apiVersion: mission-control.flanksource.com/v1
-kind: Scope
-metadata:
-  name: monitoring-stack
-  namespace: default
-spec:
-  description: Complete monitoring stack resources
-  targets:
-    - config:
-        tagSelector: "app=prometheus"
-    - component:
-        tagSelector: "app=prometheus"
-    - canary:
-        tagSelector: "app=prometheus"
-```
+```yaml title="monitoring-stack.yaml" file=<rootDir>/modules/mission-control/fixtures/scopes/monitoring-stack.yaml
+
+```

Create the corresponding fixture file in the mission-control submodule.

🤖 Prompt for AI Agents
In `@mission-control/docs/guide/permissions/examples/multiple-resource-types.md`
around lines 7 - 22, Replace the inline YAML example for the Scope resource
named "monitoring-stack" with a code block using the file= directive (e.g.,
```yaml title="monitoring-stack.yaml" file=...```), and create the referenced
fixture file containing the original YAML content (Scope, metadata.name
monitoring-stack, namespace default, spec.description and targets for
config/component/canary with tagSelector "app=prometheus") in the
mission-control module's fixtures for scopes so the documentation imports the
example instead of embedding it inline.

@moshloop moshloop merged commit df1816e into main Feb 13, 2026
15 checks passed
@moshloop moshloop deleted the fix-permission-docs branch February 13, 2026 06:36
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.

2 participants