-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement multi-tenant search support #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ec65ab5
feat: Implement multi-tenant search capabilities, including tenant-aw…
JoseSzycho 7e9ec6a
feat: enable multi-tenant indexing with a new configuration flag and …
JoseSzycho 753fc7a
feat: add sample policies
JoseSzycho fe72506
feat: optimize multi tenancy evaluation to happen only once per event
JoseSzycho 8b922c9
Merge remote-tracking branch 'origin/main' into 70-implement-multi-te…
scotwells 175ba65
chore: rename related configuration flags to enable-multi-tenancy.
JoseSzycho 765e1a7
fix: normalize Project to cammel case
JoseSzycho 7edc772
chore: get tenant annotation from annotations
JoseSzycho ca7bdc4
feat: Update project control plane API to fully qualified format
JoseSzycho b0141d1
chore: remove unused functionality
JoseSzycho 814dbeb
fix: update tenant annotations to be taken from root level.
JoseSzycho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,70 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| > **Context Optimization**: This file is structured for efficient agent usage. The "Agent Routing" section defines what context each agent needs. When spawning subagents, pass only relevant sections—not the entire file. Sections marked `<!-- reference -->` are lookup tables; don't include them in agent prompts unless specifically needed. | ||
|
|
||
|
|
||
| ## Agent Routing | ||
|
|
||
| **MANDATORY: All implementation work MUST be performed by subagents.** Never directly edit code, configuration, or documentation in the parent conversation. Instead, always delegate to the appropriate specialized agent from the table below. The parent conversation should only coordinate agents, pass context between them, and communicate results to the user. | ||
|
|
||
| Do NOT ask the user which agent to use - pick the appropriate one based on what files or features are being modified. | ||
|
|
||
| | Task Type | Agent | When to Use | | ||
| |-----------|-------|-------------| | ||
| | UI/Frontend | `datum-platform:frontend-dev` | React, TypeScript, CSS, anything in `ui/` directory | | ||
| | Go Backend | `datum-platform:api-dev` | Go code in `cmd/`, `internal/`, `pkg/` directories | | ||
| | Infrastructure | `datum-platform:sre` | Kustomize, Dockerfile, CI/CD, `config/` directory, `.infra/` for deployment | | ||
| | Tests | `datum-platform:test-engineer` | Writing or fixing Go tests | | ||
| | Code Review | `datum-platform:code-reviewer` | After implementation, before committing | | ||
| | Documentation | `datum-platform:tech-writer` | README, docs/, guides, API documentation | | ||
| | Architecture | `Plan` | Designing new features or significant refactors | | ||
| | Exploration | `Explore` | Understanding codebase structure or finding code | | ||
|
|
||
| **Key principles:** | ||
| - **Always use subagents** — never write code, edit files, or run build/test commands directly in the parent conversation | ||
| - Use agents proactively without being asked | ||
| - For multi-step tasks, use the appropriate agent for each step (launch independent agents in parallel when possible) | ||
| - After making code changes, always use `code-reviewer` to validate | ||
| - For UI changes, run `npm run build` and `npm run test:e2e` to verify | ||
| - **Always test infrastructure changes in a test environment before opening a PR** - Deploy to the test-infra KIND cluster (`task test-infra:cluster-up`) and verify resources work correctly before pushing changes to staging/production repos | ||
| - **Use Telepresence for debugging staging issues** - When investigating bugs that only reproduce in staging, intercept the service and run it locally with `task test-infra:telepresence:intercept SERVICE=<name>`. See "Remote Debugging with Telepresence" section. | ||
|
|
||
| ### Agent Context Requirements | ||
|
|
||
| Each agent only needs specific context. When spawning agents, pass minimal relevant info in prompts—don't repeat the entire CLAUDE.md: | ||
|
|
||
| | Agent | Required Context | Skip (don't include in prompt) | | ||
| |-------|-----------------|--------------------------------| | ||
| | `frontend-dev` | UI commands, file paths in `ui/` | Go architecture, ClickHouse, NATS, data pipeline | | ||
| | `api-dev` | Go patterns, API resource types, key directories | UI commands, dev environment setup, migrations | | ||
| | `sre` | Config structure, build commands, deployment | Code architecture details, CEL patterns | | ||
| | `test-engineer` | Test commands, package being tested | Full architecture, deployment, UI | | ||
| | `Explore` | Key directories, architecture overview | Build commands, dev setup, deployment | | ||
| | `code-reviewer` | Architecture, multi-tenancy model, conventions | Dev environment, build commands | | ||
| | `tech-writer` | API resources, architecture overview | Implementation details, build commands | | ||
|
|
||
| ### Agent Output Guidelines | ||
|
|
||
| Agents should return **concise summaries** to minimize context bloat in the parent conversation: | ||
|
|
||
| | Agent | Return | Don't Return | | ||
| |-------|--------|--------------| | ||
| | `Explore` | File paths + 1-line descriptions | Full file contents, extensive code quotes | | ||
| | `api-dev` | What was changed + file paths | Full diffs, unchanged code | | ||
| | `frontend-dev` | Components modified + any build errors | Full file contents | | ||
| | `code-reviewer` | Numbered findings list with file:line refs | Full code blocks for context | | ||
| | `test-engineer` | Pass/fail summary + failure messages only | Full test output, passing test details | | ||
| | `sre` | Changed manifests + deployment notes | Full YAML contents | | ||
|
|
||
| ### Multi-Step Task Decomposition | ||
|
|
||
| For complex tasks, decompose to minimize per-agent context: | ||
|
|
||
| 1. **Explore first** (use `model: "haiku"`): Find relevant files → return only paths | ||
| 2. **Plan if needed**: Design approach → return bullet points only | ||
| 3. **Implement** (sonnet): Work on specific files identified in step 1 | ||
| 4. **Review**: Check only the changed files | ||
|
|
||
| **Critical**: Pass only what's needed between steps. Don't re-explore what's already known. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
| apiVersion: search.miloapis.com/v1alpha1 | ||
| kind: ResourceIndexPolicy | ||
| metadata: | ||
| name: dnszone-index-policy | ||
| spec: | ||
| targetResource: | ||
| group: dns.networking.miloapis.com | ||
| version: v1alpha1 | ||
| kind: DNSZone | ||
|
|
||
| conditions: | ||
| - name: has-name | ||
| expression: "metadata.name != ''" | ||
|
|
||
| fields: | ||
| - path: ".metadata.name" | ||
| searchable: true | ||
| - path: ".metadata.namespace" | ||
| searchable: true | ||
| - path: ".spec.domainName" | ||
| searchable: true | ||
| - path: ".spec.dnsZoneClassName" | ||
| searchable: true |
This file contains hidden or 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,29 @@ | ||
| apiVersion: search.miloapis.com/v1alpha1 | ||
| kind: ResourceIndexPolicy | ||
| metadata: | ||
| name: domain-index-policy | ||
| spec: | ||
| targetResource: | ||
| group: networking.datumapis.com | ||
| version: v1alpha | ||
| kind: Domain | ||
|
|
||
| conditions: | ||
| - name: has-name | ||
| expression: "metadata.name != ''" | ||
|
|
||
| fields: | ||
| - path: ".metadata.name" | ||
| searchable: true | ||
| - path: ".metadata.namespace" | ||
| searchable: true | ||
| - path: ".spec.domainName" | ||
| searchable: true | ||
| - path: ".status.apex" | ||
| searchable: true | ||
| - path: ".status.nameservers[0].hostname" | ||
| searchable: true | ||
| - path: ".status.registration.registrar.name" | ||
| searchable: true | ||
| - path: ".status.registration.registry.name" | ||
| searchable: true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.