tenant cleanup #2681

Merged
mfreeman451 merged 57 commits from refs/pull/2681/head into staging 2026-01-17 07:00:16 +00:00
mfreeman451 commented 2026-01-15 20:46:48 +00:00 (Migrated from github.com)
Owner

Imported from GitHub pull request.

Original GitHub pull request: #2320
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320
Original created: 2026-01-15T20:46:48Z
Original updated: 2026-01-17T07:00:18Z
Original head: carverauto/serviceradar:update/tenant-cleanup-separation-work
Original base: staging
Original merged: 2026-01-17T07:00:16Z by @mfreeman451

User description

IMPORTANT: Please sign the Developer Certificate of Origin

Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:

Signed-off-by: J. Doe <j.doe@domain.com>

Describe your changes

Code checklist before requesting a review

  • I have signed the DCO?
  • The build completes without errors?
  • All tests are passing when running make test?

PR Type

Enhancement


Description

  • Add TENANT_AWARE_MODE feature flag to support tenant-unaware architecture

  • Create TenantMode module with helpers for conditional tenant context handling

  • Add SystemActor.system/1 for tenant-unaware mode operations

  • Update controllers and auth to use mode-conditional tenant options

  • Implement cross-tenant search with mode-aware branching logic


Diagram Walkthrough

flowchart LR
  A["TENANT_AWARE_MODE<br/>env var"] -->|"true/false"| B["TenantMode<br/>module"]
  B -->|"tenant_aware?()"| C["Feature flag<br/>check"]
  B -->|"tenant_opts()"| D["Conditional<br/>tenant param"]
  B -->|"system_actor()"| E["Mode-aware<br/>actor creation"]
  B -->|"ash_opts()"| F["Complete Ash<br/>options"]
  C -->|"true"| G["Tenant-aware<br/>mode"]
  C -->|"false"| H["Tenant-unaware<br/>mode"]
  G -->|"Pass tenant:"| I["Schema-scoped<br/>operations"]
  H -->|"Implicit from<br/>search_path"| J["DB-scoped<br/>operations"]

File Walkthrough

Relevant files
Configuration changes
1 files
runtime.exs
Add TENANT_AWARE_MODE environment variable configuration 
+23/-0   
Enhancement
11 files
system_actor.ex
Add system/1 function for tenant-unaware mode actors         
+40/-0   
tenant_mode.ex
Create TenantMode module with conditional tenant helpers 
+171/-0 
repo.ex
Update all_tenants to check tenant mode configuration       
+32/-1   
scope.ex
Use TenantMode for conditional actor and tenant context   
+7/-5     
collector_controller.ex
Update to use TenantMode helpers for tenant context           
+67/-23 
edge_controller.ex
Update to use TenantMode helpers and mode-aware search     
+74/-33 
enroll_controller.ex
Update to use TenantMode helpers and conditional actors   
+41/-10 
auth_controller.ex
Use TenantMode for JWT token generation options                   
+4/-1     
api_auth.ex
Update API token validation with mode-aware cross-tenant search
+43/-30 
tenant_context.ex
Use TenantMode for conditional tenant loading actor           
+3/-1     
user_auth.ex
Use TenantMode for JWT verification and tenant options     
+4/-6     
Documentation
2 files
migration-guide.md
Add comprehensive migration guide for TenantMode adoption
+156/-0 
tasks.md
Update task checklist with completed implementation items
+142/-85

Imported from GitHub pull request. Original GitHub pull request: #2320 Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320 Original created: 2026-01-15T20:46:48Z Original updated: 2026-01-17T07:00:18Z Original head: carverauto/serviceradar:update/tenant-cleanup-separation-work Original base: staging Original merged: 2026-01-17T07:00:16Z by @mfreeman451 --- ### **User description** ## IMPORTANT: Please sign the Developer Certificate of Origin Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include a [DCO sign-off statement]( https://developercertificate.org/) indicating the DCO acceptance in one commit message. Here is an example DCO Signed-off-by line in a commit message: ``` Signed-off-by: J. Doe <j.doe@domain.com> ``` ## Describe your changes ## Issue ticket number and link ## Code checklist before requesting a review - [ ] I have signed the DCO? - [ ] The build completes without errors? - [ ] All tests are passing when running make test? ___ ### **PR Type** Enhancement ___ ### **Description** - Add `TENANT_AWARE_MODE` feature flag to support tenant-unaware architecture - Create `TenantMode` module with helpers for conditional tenant context handling - Add `SystemActor.system/1` for tenant-unaware mode operations - Update controllers and auth to use mode-conditional tenant options - Implement cross-tenant search with mode-aware branching logic ___ ### Diagram Walkthrough ```mermaid flowchart LR A["TENANT_AWARE_MODE<br/>env var"] -->|"true/false"| B["TenantMode<br/>module"] B -->|"tenant_aware?()"| C["Feature flag<br/>check"] B -->|"tenant_opts()"| D["Conditional<br/>tenant param"] B -->|"system_actor()"| E["Mode-aware<br/>actor creation"] B -->|"ash_opts()"| F["Complete Ash<br/>options"] C -->|"true"| G["Tenant-aware<br/>mode"] C -->|"false"| H["Tenant-unaware<br/>mode"] G -->|"Pass tenant:"| I["Schema-scoped<br/>operations"] H -->|"Implicit from<br/>search_path"| J["DB-scoped<br/>operations"] ``` <details><summary><h3>File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Configuration changes</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>runtime.exs</strong><dd><code>Add TENANT_AWARE_MODE environment variable configuration</code>&nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-5d045e2af9f15590a9745058e25a00380ad7a2cc363d0a9934715bd11ea8eef3">+23/-0</a>&nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>11 files</summary><table> <tr> <td><strong>system_actor.ex</strong><dd><code>Add system/1 function for tenant-unaware mode actors</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-f3ebf5072e8a72e025076ca013e6726fb23a0169e9e8c9b0089489a4cf17a73d">+40/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>tenant_mode.ex</strong><dd><code>Create TenantMode module with conditional tenant helpers</code>&nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-c6352f46453d7d9294ad2e8234dd0e31acde27e2ffb92ac04edfa895f3618c2c">+171/-0</a>&nbsp; </td> </tr> <tr> <td><strong>repo.ex</strong><dd><code>Update all_tenants to check tenant mode configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-07a1d27a8e8c0f459cb06766961c8cf9d914a9ed04a539b98c6110f439590df1">+32/-1</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>scope.ex</strong><dd><code>Use TenantMode for conditional actor and tenant context</code>&nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-8142f5d0719ccc41761eee96fa01036051e73b305766b3bb09e0c36945ef84dd">+7/-5</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>collector_controller.ex</strong><dd><code>Update to use TenantMode helpers for tenant context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-c3752db9bdbf3d914b0032e698ba69bdd077a86694275b43b629d9905c8e2156">+67/-23</a>&nbsp; </td> </tr> <tr> <td><strong>edge_controller.ex</strong><dd><code>Update to use TenantMode helpers and mode-aware search</code>&nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-05935a3b7cbb6dccb1dd5635980102662534d3cd929d751af33160f5c6714935">+74/-33</a>&nbsp; </td> </tr> <tr> <td><strong>enroll_controller.ex</strong><dd><code>Update to use TenantMode helpers and conditional actors</code>&nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-d6a38ddd0262e27653bc95f472a2ab5b5189b69ca62d4c085aa63013b21b7573">+41/-10</a>&nbsp; </td> </tr> <tr> <td><strong>auth_controller.ex</strong><dd><code>Use TenantMode for JWT token generation options</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-59f885443dd58584de763e6267323611f28d1a10535a7334022c6fcecd1599b8">+4/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>api_auth.ex</strong><dd><code>Update API token validation with mode-aware cross-tenant search</code></dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-c47fca520429562a380c88ddaea56483dd328e09f17733251ce1afe520b7e976">+43/-30</a>&nbsp; </td> </tr> <tr> <td><strong>tenant_context.ex</strong><dd><code>Use TenantMode for conditional tenant loading actor</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-43b9067433609fbe694a7687be916c7d58b49008fbd5036329eb8c2fbbfd018d">+3/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>user_auth.ex</strong><dd><code>Use TenantMode for JWT verification and tenant options</code>&nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-eed904963eb2089bfce4e634d5229889213b12d02489e07af53f1b1982a42d78">+4/-6</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>migration-guide.md</strong><dd><code>Add comprehensive migration guide for TenantMode adoption</code></dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-9f5a2e2cfb383a39847a34810026d03125cba1ac094bfda1885b283578ee8c0c">+156/-0</a>&nbsp; </td> </tr> <tr> <td><strong>tasks.md</strong><dd><code>Update task checklist with completed implementation items</code></dd></td> <td><a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-6eeec38b40128b8459a553f6a84532940a02cdcc430b14cfc8695e21a3fd90c9">+142/-85</a></td> </tr> </table></details></td></tr></tbody></table> </details> ___
qodo-code-review[bot] commented 2026-01-15 20:47:44 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR comment.

Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3756796121
Original created: 2026-01-15T20:47:44Z

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Authorization bypass

Description: TenantMode.system_actor/2 can return SystemActor.system/1 (no tenant_id, role: :system)
whenever tenant_id is nil or tenant-aware mode is off, which may unintentionally bypass
authorization policies that rely on an actor tenant_id match or assume :system implies
trusted platform-only behavior; review all call sites passing nil (e.g., auth/scope/tenant
loading) to ensure :system without tenant scoping cannot be used to access or mutate
cross-tenant data.
tenant_mode.ex [104-134]

Referred Code
@doc """
Creates a system actor appropriate for the current tenant mode.

In tenant-aware mode, creates an actor with `tenant_id` using `SystemActor.for_tenant/2`.
In tenant-unaware mode, creates an actor without `tenant_id` using `SystemActor.system/1`.

## Parameters

  - `component` - Atom identifying the system component (e.g., `:state_monitor`)
  - `tenant_id` - The tenant UUID (only used in tenant-aware mode)

## Examples

    # In tenant-aware mode (TENANT_AWARE_MODE=true)
    actor = TenantMode.system_actor(:worker, "tenant-uuid")
    # => %{id: "system:worker", role: :system, tenant_id: "tenant-uuid", ...}

    # In tenant-unaware mode (TENANT_AWARE_MODE=false)
    actor = TenantMode.system_actor(:worker, "tenant-uuid")
    # => %{id: "system:worker", role: :system, ...}  # no tenant_id
"""


 ... (clipped 10 lines)
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Swallowed auth errors: The new find_api_token/2 logic collapses all read errors into {:error, :not_found} without
logging/context, which may hinder debugging and detection of real backend failures.

Referred Code
if TenantMode.tenant_aware?() do
  # Tenant-aware mode: search across all tenant schemas (Control Plane)
  actor = SystemActor.platform(:api_auth)

  TenantSchemas.list_schemas()
  |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
    case Ash.read(query, actor: actor, tenant: schema) do
      {:ok, [api_token | _]} ->
        {:halt, {:ok, api_token}}

      {:ok, []} ->
        {:cont, {:error, :not_found}}

      {:error, _} ->
        {:cont, {:error, :not_found}}
    end
  end)
else
  # Tenant-unaware mode: search current schema only (tenant instance)
  actor = SystemActor.system(:api_auth)



 ... (clipped 5 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status:
Error passthrough risk: Several new code paths continue to return {:error, error} directly from Ash calls, which
may surface internal details to clients depending on the controller/endpoint error
rendering behavior.

Referred Code
schema = TenantSchemas.schema_for_tenant(tenant)
opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema)

case CollectorPackage
     |> Ash.Query.for_read(:read)
     |> Ash.Query.filter(id == ^id)
     |> Ash.read_one(opts) do
  {:ok, nil} -> {:error, :not_found}
  {:ok, package} -> json(conn, package_to_json(package))
  {:error, error} -> {:error, error}
end

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Unvalidated schema input: In tenant-unaware mode, DB_SCHEMA is accepted from the environment and stored as
:tenant_schema without validation/allowlisting, so correctness and injection resistance
depend on external controls not visible in the diff.

Referred Code
# When TENANT_AWARE_MODE=false, the tenant schema comes from DB connection
# DB_SCHEMA is injected by tenant-workload-operator from CNPG credentials
if not tenant_aware_mode do
  tenant_schema = System.get_env("DB_SCHEMA")

  if tenant_schema do
    config :serviceradar_core, :tenant_schema, tenant_schema
  end
end

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
- Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3756796121 Original created: 2026-01-15T20:47:44Z --- ## PR Compliance Guide 🔍 <!-- https://github.com/carverauto/serviceradar/commit/98ea9b9f0c830d1e8618f63b3cc46e9c4f7e8c69 --> Below is a summary of compliance checks for this PR:<br> <table><tbody><tr><td colspan='2'><strong>Security Compliance</strong></td></tr> <tr><td rowspan=1>⚪</td> <td><details><summary><strong>Authorization bypass </strong></summary><br> <b>Description:</b> <code>TenantMode.system_actor/2</code> can return <code>SystemActor.system/1</code> (no <code>tenant_id</code>, <code>role: :system</code>) <br>whenever <code>tenant_id</code> is nil or tenant-aware mode is off, which may unintentionally bypass <br>authorization policies that rely on an actor <code>tenant_id</code> match or assume <code>:system</code> implies <br>trusted platform-only behavior; review all call sites passing <code>nil</code> (e.g., auth/scope/tenant <br>loading) to ensure <code>:system</code> without tenant scoping cannot be used to access or mutate <br>cross-tenant data.<br> <strong><a href='https://github.com/carverauto/serviceradar/pull/2320/files#diff-c6352f46453d7d9294ad2e8234dd0e31acde27e2ffb92ac04edfa895f3618c2cR104-R134'>tenant_mode.ex [104-134]</a></strong><br> <details open><summary>Referred Code</summary> ```elixir @doc """ Creates a system actor appropriate for the current tenant mode. In tenant-aware mode, creates an actor with `tenant_id` using `SystemActor.for_tenant/2`. In tenant-unaware mode, creates an actor without `tenant_id` using `SystemActor.system/1`. ## Parameters - `component` - Atom identifying the system component (e.g., `:state_monitor`) - `tenant_id` - The tenant UUID (only used in tenant-aware mode) ## Examples # In tenant-aware mode (TENANT_AWARE_MODE=true) actor = TenantMode.system_actor(:worker, "tenant-uuid") # => %{id: "system:worker", role: :system, tenant_id: "tenant-uuid", ...} # In tenant-unaware mode (TENANT_AWARE_MODE=false) actor = TenantMode.system_actor(:worker, "tenant-uuid") # => %{id: "system:worker", role: :system, ...} # no tenant_id """ ... (clipped 10 lines) ``` </details></details></td></tr> <tr><td colspan='2'><strong>Ticket Compliance</strong></td></tr> <tr><td>⚪</td><td><details><summary>🎫 <strong>No ticket provided </strong></summary> - [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true --> </details></td></tr> <tr><td colspan='2'><strong>Codebase Duplication Compliance</strong></td></tr> <tr><td>⚪</td><td><details><summary><strong>Codebase context is not defined </strong></summary> Follow the <a href='https://qodo-merge-docs.qodo.ai/core-abilities/rag_context_enrichment/'>guide</a> to enable codebase context checks. </details></td></tr> <tr><td colspan='2'><strong>Custom Compliance</strong></td></tr> <tr><td rowspan=3>🟢</td><td> <details><summary><strong>Generic: Comprehensive Audit Trails</strong></summary><br> **Objective:** To create a detailed and reliable record of critical system actions for security analysis <br>and compliance.<br> **Status:** Passed<br> > Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a> </details></td></tr> <tr><td> <details><summary><strong>Generic: Meaningful Naming and Self-Documenting Code</strong></summary><br> **Objective:** Ensure all identifiers clearly express their purpose and intent, making code <br>self-documenting<br> **Status:** Passed<br> > Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a> </details></td></tr> <tr><td> <details><summary><strong>Generic: Secure Logging Practices</strong></summary><br> **Objective:** To ensure logs are useful for debugging and auditing without exposing sensitive <br>information like PII, PHI, or cardholder data.<br> **Status:** Passed<br> > Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a> </details></td></tr> <tr><td rowspan=3>⚪</td> <td><details> <summary><strong>Generic: Robust Error Handling and Edge Case Management</strong></summary><br> **Objective:** Ensure comprehensive error handling that provides meaningful context and graceful <br>degradation<br> **Status:** <br><a href='https://github.com/carverauto/serviceradar/pull/2320/files#diff-c47fca520429562a380c88ddaea56483dd328e09f17733251ce1afe520b7e976R291-R316'><strong>Swallowed auth errors</strong></a>: The new <code>find_api_token/2</code> logic collapses all read errors into <code>{:error, :not_found}</code> without <br>logging/context, which may hinder debugging and detection of real backend failures.<br> <details open><summary>Referred Code</summary> ```elixir if TenantMode.tenant_aware?() do # Tenant-aware mode: search across all tenant schemas (Control Plane) actor = SystemActor.platform(:api_auth) TenantSchemas.list_schemas() |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> case Ash.read(query, actor: actor, tenant: schema) do {:ok, [api_token | _]} -> {:halt, {:ok, api_token}} {:ok, []} -> {:cont, {:error, :not_found}} {:error, _} -> {:cont, {:error, :not_found}} end end) else # Tenant-unaware mode: search current schema only (tenant instance) actor = SystemActor.system(:api_auth) ... (clipped 5 lines) ``` </details> > Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a> </details></td></tr> <tr><td><details> <summary><strong>Generic: Secure Error Handling</strong></summary><br> **Objective:** To prevent the leakage of sensitive system information through error messages while <br>providing sufficient detail for internal debugging.<br> **Status:** <br><a href='https://github.com/carverauto/serviceradar/pull/2320/files#diff-c3752db9bdbf3d914b0032e698ba69bdd077a86694275b43b629d9905c8e2156R121-R131'><strong>Error passthrough risk</strong></a>: Several new code paths continue to return <code>{:error, error}</code> directly from Ash calls, which <br>may surface internal details to clients depending on the controller/endpoint error <br>rendering behavior.<br> <details open><summary>Referred Code</summary> ```elixir schema = TenantSchemas.schema_for_tenant(tenant) opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema) case CollectorPackage |> Ash.Query.for_read(:read) |> Ash.Query.filter(id == ^id) |> Ash.read_one(opts) do {:ok, nil} -> {:error, :not_found} {:ok, package} -> json(conn, package_to_json(package)) {:error, error} -> {:error, error} end ``` </details> > Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a> </details></td></tr> <tr><td><details> <summary><strong>Generic: Security-First Input Validation and Data Handling</strong></summary><br> **Objective:** Ensure all data inputs are validated, sanitized, and handled securely to prevent <br>vulnerabilities<br> **Status:** <br><a href='https://github.com/carverauto/serviceradar/pull/2320/files#diff-5d045e2af9f15590a9745058e25a00380ad7a2cc363d0a9934715bd11ea8eef3R160-R168'><strong>Unvalidated schema input</strong></a>: In tenant-unaware mode, <code>DB_SCHEMA</code> is accepted from the environment and stored as <br><code>:tenant_schema</code> without validation/allowlisting, so correctness and injection resistance <br>depend on external controls not visible in the diff.<br> <details open><summary>Referred Code</summary> ```elixir # When TENANT_AWARE_MODE=false, the tenant schema comes from DB connection # DB_SCHEMA is injected by tenant-workload-operator from CNPG credentials if not tenant_aware_mode do tenant_schema = System.get_env("DB_SCHEMA") if tenant_schema do config :serviceradar_core, :tenant_schema, tenant_schema end end ``` </details> > Learn more about managing compliance <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#configuration-options'>generic rules</a> or creating your own <a href='https://qodo-merge-docs.qodo.ai/tools/compliance/#custom-compliance'>custom rules</a> </details></td></tr> <tr><td align="center" colspan="2"> - [ ] Update <!-- /compliance --update_compliance=true --> </td></tr></tbody></table> <details><summary>Compliance status legend</summary> 🟢 - Fully Compliant<br> 🟡 - Partial Compliant<br> 🔴 - Not Compliant<br> ⚪ - Requires Further Human Verification<br> 🏷️ - Compliance label<br> </details>
qodo-code-review[bot] commented 2026-01-15 20:49:10 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR comment.

Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3756800775
Original created: 2026-01-15T20:49:10Z

PR Code Suggestions

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Use platform actor for correct permissions
Suggestion Impact:The commit removed the TenantMode alias and replaced TenantMode.system_actor(:scope, nil) with SystemActor.platform(:scope) for scope-building and tenant fetching, aligning actor permissions with cross-tenant/global resource access.

code diff:

   alias ServiceRadar.Actors.SystemActor
-  alias ServiceRadar.Cluster.TenantMode
   alias ServiceRadar.Identity.Tenant
   alias ServiceRadar.Identity.User
 
@@ -39,9 +38,8 @@
     require Ash.Query
     active_tenant_id = Keyword.get(opts, :active_tenant_id)
 
-    # Use mode-conditional actor for scope building
     # Tenant and TenantMembership are public schema resources
-    actor = TenantMode.system_actor(:scope, nil)
+    actor = SystemActor.platform(:scope)
 
     # Load tenant separately - Tenant is a global resource, no tenant context needed
     user_with_tenant = Ash.load!(user, [:tenant], actor: actor)
@@ -135,8 +133,8 @@
   end
 
   defp fetch_tenant_by_id(tenant_id) when is_binary(tenant_id) do
-    # Tenant is in public schema, use mode-conditional actor
-    actor = TenantMode.system_actor(:scope, nil)
+    # Tenant is in public schema
+    actor = SystemActor.platform(:scope)
 

To prevent authorization failures when accessing global resources, use
SystemActor.platform(:scope) instead of TenantMode.system_actor(:scope, nil) to
ensure the actor has the required :super_admin role.

web-ng/lib/serviceradar_web_ng/accounts/scope.ex [44-47]

-# Use mode-conditional actor for scope building
-# Tenant and TenantMembership are public schema resources
-actor = TenantMode.system_actor(:scope, nil)
+# Use platform actor for scope building - this is a cross-tenant operation
+# that needs to load user relationships and memberships from public schema resources.
+actor = SystemActor.platform(:scope)
 
 # Load tenant separately - Tenant is a global resource, no tenant context needed
 user_with_tenant = Ash.load!(user, [:tenant], actor: actor)

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a potential authorization bug where a :system role actor is used for an operation that requires :super_admin privileges to access global resources like Tenant.

High
Add actor to OnboardingPackages.list
Suggestion Impact:The commit changed the `OnboardingPackages.list/2` invocation in the suggested location to pass explicit tenant context (`tenant: schema`) instead of using `TenantMode.tenant_opts(schema)`. While it did not add the proposed `actor` option, it did address the underlying tenant-context issue by altering the options passed to `list/2`.

code diff:

     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      tenant_opts = TenantMode.tenant_opts(schema)
-      packages = OnboardingPackages.list(filters, tenant_opts)
+      # Control plane code - pass tenant context
+      packages = OnboardingPackages.list(filters, tenant: schema)
       json(conn, Enum.map(packages, &package_to_json/1))

Add the actor option to the OnboardingPackages.list/2 call to prevent query
failures in tenant-specific contexts.

web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex [56-61]

 with {:ok, tenant} <- require_tenant(conn) do
   schema = TenantSchemas.schema_for_tenant(tenant)
-  tenant_opts = TenantMode.tenant_opts(schema)
-  packages = OnboardingPackages.list(filters, tenant_opts)
+  actor = TenantMode.system_actor(:edge_controller, tenant.id)
+  opts = [actor: actor] ++ TenantMode.tenant_opts(schema)
+  packages = OnboardingPackages.list(filters, opts)
   json(conn, Enum.map(packages, &package_to_json/1))
 end

[Suggestion processed]

Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a missing actor in an Ash query, which would cause requests to fail. This is a critical bug fix.

High
Include implicit schema in all_tenants
Suggestion Impact:The commit modified the same all_tenants function and its surrounding documentation, but it did the opposite of the suggestion: it removed tenant-aware logic and hard-coded all_tenants to always return [] with comments asserting enumeration is unnecessary. No implicit schema lookup was added, so the suggested migration fix was not implemented.

code diff:

   @doc """
-  Returns all tenant schemas for migrations and cross-tenant operations.
+  Returns tenant schemas for migrations.
 
-  In tenant-aware mode, returns all tenant schemas from the database.
-  In tenant-unaware mode, returns an empty list (there's only "self").
+  In tenant instance deployments, the schema is set by the DB connection's
+  search_path so there is nothing to enumerate.
   """
   def all_tenants do
-    if TenantMode.tenant_aware?() do
-      ServiceRadar.Cluster.TenantSchemas.list_schemas()
-    else
-      # In tenant-unaware mode, the schema is set by DB connection
-      # There's no need to enumerate tenants for migrations
-      []
-    end
+    # Schema is set by DB connection's search_path (CNPG credentials)
+    # No need to enumerate tenants
+    []
   end

Modify all_tenants to return the configured schema in tenant-unaware mode,
ensuring that database migrations can run against the current tenant's schema.

elixir/serviceradar_core/lib/serviceradar/repo.ex [50-58]

 def all_tenants do
   if TenantMode.tenant_aware?() do
     ServiceRadar.Cluster.TenantSchemas.list_schemas()
   else
-    # In tenant-unaware mode, the schema is set by DB connection
-    # There's no need to enumerate tenants for migrations
-    []
+    # Run migrations in the implicit schema from DB credentials
+    case Application.get_env(:serviceradar_core, :tenant_schema) || System.get_env("DB_SCHEMA") do
+      nil -> []
+      schema -> [schema]
+    end
   end
 end

[Suggestion processed]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly points out that migrations would not run in tenant-unaware mode because all_tenants returns an empty list, which is a significant bug.

Medium
High-level
The PR introduces an incomplete abstraction
Suggestion Impact:The commit removed `TenantMode` usage and eliminated multiple `if TenantMode.tenant_aware?()` branches (including `find_package_across_tenants/1` in both controllers), replacing them with a single control-plane code path that always uses the platform actor and explicitly passes `tenant: schema` while iterating schemas. This reduces the duplicated conditional logic the suggestion called out, though it does not implement the proposed `TenantMode.read_across_tenants/2` helper abstraction.

code diff:

@@ -11,7 +11,6 @@
   require Ash.Query
 
   alias ServiceRadar.Actors.SystemActor
-  alias ServiceRadar.Cluster.TenantMode
   alias ServiceRadar.Cluster.TenantSchemas
   alias ServiceRadar.Edge.CollectorPackage
   alias ServiceRadar.Edge.NatsCredential
@@ -53,8 +52,9 @@
 
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema)
-      packages = Ash.read!(query, opts)
+      # Control plane code - use platform actor with tenant context
+      actor = SystemActor.platform(:collector_controller)
+      packages = Ash.read!(query, actor: actor, tenant: schema)
       json(conn, Enum.map(packages, &package_to_json/1))
     end
   end
@@ -87,7 +87,9 @@
         }
 
         schema = TenantSchemas.schema_for_tenant(tenant)
-        opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema)
+        # Control plane code - use platform actor with tenant context
+        actor = SystemActor.platform(:collector_controller)
+        opts = [actor: actor, tenant: schema]
 
         case CollectorPackage
              |> Ash.Changeset.for_create(:create, attrs)
@@ -119,12 +121,13 @@
   def show(conn, %{"id" => id}) do
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema)
+      # Control plane code - use platform actor with tenant context
+      actor = SystemActor.platform(:collector_controller)
 
       case CollectorPackage
            |> Ash.Query.for_read(:read)
            |> Ash.Query.filter(id == ^id)
-           |> Ash.read_one(opts) do
+           |> Ash.read_one(actor: actor, tenant: schema) do
         {:ok, nil} -> {:error, :not_found}
         {:ok, package} -> json(conn, package_to_json(package))
         {:error, error} -> {:error, error}
@@ -197,7 +200,9 @@
 
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema)
+      # Control plane code - use platform actor with tenant context
+      actor = SystemActor.platform(:collector_controller)
+      opts = [actor: actor, tenant: schema]
 
       case CollectorPackage
            |> Ash.Query.for_read(:read)
@@ -256,8 +261,9 @@
 
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema)
-      credentials = Ash.read!(query, opts)
+      # Control plane code - use platform actor with tenant context
+      actor = SystemActor.platform(:collector_controller)
+      credentials = Ash.read!(query, actor: actor, tenant: schema)
       json(conn, Enum.map(credentials, &credential_to_json/1))
     end
   end
@@ -332,15 +338,9 @@
   end
 
   defp get_package(package_id, tenant_schema) do
-    # Use platform actor in tenant-aware mode, system actor in tenant-unaware mode
-    actor =
-      if TenantMode.tenant_aware?() do
-        SystemActor.platform(:collector_controller)
-      else
-        SystemActor.system(:collector_controller)
-      end
-
-    opts = [actor: actor] ++ TenantMode.tenant_opts(tenant_schema)
+    # Control plane code - use platform actor with tenant context
+    actor = SystemActor.platform(:collector_controller)
+    opts = [actor: actor, tenant: tenant_schema]
 
     case CollectorPackage
          |> Ash.Query.for_read(:read)
@@ -432,15 +432,9 @@
   defp decrypt_tls_key(_), do: {:error, :tls_key_invalid}
 
   defp mark_downloaded(package, source_ip, tenant_schema) do
-    # Use platform actor in tenant-aware mode, system actor in tenant-unaware mode
-    actor =
-      if TenantMode.tenant_aware?() do
-        SystemActor.platform(:collector_controller)
-      else
-        SystemActor.system(:collector_controller)
-      end
-
-    opts = [actor: actor] ++ TenantMode.tenant_opts(tenant_schema)
+    # Control plane code - use platform actor with tenant context
+    actor = SystemActor.platform(:collector_controller)
+    opts = [actor: actor, tenant: tenant_schema]
 
     package
     |> Ash.Changeset.for_update(:download)
@@ -627,46 +621,25 @@
   end
 
   defp find_package_across_tenants(package_id) do
-    if TenantMode.tenant_aware?() do
-      # Tenant-aware mode: search across all tenant schemas (Control Plane only)
-      actor = SystemActor.platform(:collector_controller)
-
-      TenantSchemas.list_schemas()
-      |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
-        case CollectorPackage
-             |> Ash.Query.for_read(:read)
-             |> Ash.Query.filter(id == ^package_id)
-             |> Ash.read_one(actor: actor, tenant: schema) do
-          {:ok, nil} ->
-            {:cont, {:error, :not_found}}
-
-          {:ok, package} ->
-            {:halt, {:ok, package, schema}}
-
-          {:error, error} ->
-            {:halt, {:error, error}}
-        end
-      end)
-    else
-      # Tenant-unaware mode: search only current schema (tenant instance)
-      # Schema is implicit from DB connection's search_path
-      actor = SystemActor.system(:collector_controller)
-
+    # Control plane code - search across all tenant schemas
+    actor = SystemActor.platform(:collector_controller)
+
+    TenantSchemas.list_schemas()
+    |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
       case CollectorPackage
            |> Ash.Query.for_read(:read)
            |> Ash.Query.filter(id == ^package_id)
-           |> Ash.read_one(actor: actor) do
+           |> Ash.read_one(actor: actor, tenant: schema) do
         {:ok, nil} ->
-          {:error, :not_found}
+          {:cont, {:error, :not_found}}
 
         {:ok, package} ->
-          # Return nil schema since it's implicit in tenant-unaware mode
-          {:ok, package, nil}
+          {:halt, {:ok, package, schema}}
 
         {:error, error} ->
-          {:error, error}
-      end
-    end
+          {:halt, {:error, error}}
+      end
+    end)
   end
 
   defp format_datetime(nil), do: nil

# File: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
@@ -11,7 +11,6 @@
   require Ash.Query
 
   alias ServiceRadar.Actors.SystemActor
-  alias ServiceRadar.Cluster.TenantMode
   alias ServiceRadar.Cluster.TenantSchemas
   alias ServiceRadar.Edge.OnboardingPackage
   alias ServiceRadarWebNG.Edge.OnboardingPackages
@@ -55,8 +54,8 @@
 
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      tenant_opts = TenantMode.tenant_opts(schema)
-      packages = OnboardingPackages.list(filters, tenant_opts)
+      # Control plane code - pass tenant context
+      packages = OnboardingPackages.list(filters, tenant: schema)
       json(conn, Enum.map(packages, &package_to_json/1))
     end
   end
@@ -91,13 +90,14 @@
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
 
-      opts =
-        [
-          join_token_ttl_seconds: params["join_token_ttl_seconds"] || 86_400,
-          download_token_ttl_seconds: params["download_token_ttl_seconds"] || 86_400,
-          actor: actor,
-          source_ip: source_ip
-        ] ++ TenantMode.tenant_opts(schema)
+      # Control plane code - pass tenant context
+      opts = [
+        join_token_ttl_seconds: params["join_token_ttl_seconds"] || 86_400,
+        download_token_ttl_seconds: params["download_token_ttl_seconds"] || 86_400,
+        actor: actor,
+        source_ip: source_ip,
+        tenant: schema
+      ]
 
       case OnboardingPackages.create(attrs, opts) do
         {:ok, result} ->
@@ -124,9 +124,9 @@
   def show(conn, %{"id" => id}) do
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      tenant_opts = TenantMode.tenant_opts(schema)
-
-      case OnboardingPackages.get(id, tenant_opts) do
+
+      # Control plane code - pass tenant context
+      case OnboardingPackages.get(id, tenant: schema) do
         {:ok, package} ->
           json(conn, package_to_json(package))
 
@@ -147,7 +147,8 @@
 
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      opts = [actor: actor, source_ip: source_ip] ++ TenantMode.tenant_opts(schema)
+      # Control plane code - pass tenant context
+      opts = [actor: actor, source_ip: source_ip, tenant: schema]
 
       case OnboardingPackages.delete(id, opts) do
         {:ok, _package} ->
@@ -176,11 +177,11 @@
     # First verify package exists
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
-      tenant_opts = TenantMode.tenant_opts(schema)
-
-      case OnboardingPackages.get(package_id, tenant_opts) do
+
+      # Control plane code - pass tenant context
+      case OnboardingPackages.get(package_id, tenant: schema) do
         {:ok, _package} ->
-          events = OnboardingEvents.list_for_package(package_id, [limit: limit] ++ tenant_opts)
+          events = OnboardingEvents.list_for_package(package_id, limit: limit, tenant: schema)
           json(conn, Enum.map(events, &event_to_json/1))
 
         {:error, :not_found} ->
@@ -227,7 +228,8 @@
   end
 
   defp deliver_package(id, download_token, tenant_schema, source_ip, actor) do
-    opts = [actor: actor, source_ip: source_ip] ++ TenantMode.tenant_opts(tenant_schema)
+    # Control plane code - pass tenant context
+    opts = [actor: actor, source_ip: source_ip, tenant: tenant_schema]
 
     case OnboardingPackages.deliver(id, download_token, opts) do
       {:ok, result} ->
@@ -349,9 +351,8 @@
     with {:ok, tenant} <- require_tenant(conn) do
       schema = TenantSchemas.schema_for_tenant(tenant)
 
-      opts =
-        [actor: actor, source_ip: source_ip, reason: reason] ++
-          TenantMode.tenant_opts(schema)
+      # Control plane code - pass tenant context
+      opts = [actor: actor, source_ip: source_ip, reason: reason, tenant: schema]
 
       case OnboardingPackages.revoke(id, opts) do
         {:ok, package} ->
@@ -492,13 +493,8 @@
   defp load_tenant(nil), do: {:error, :unauthorized}
 
   defp load_tenant(tenant_id) do
-    # Use platform actor in tenant-aware mode, system actor in tenant-unaware mode
-    actor =
-      if TenantMode.tenant_aware?() do
-        SystemActor.platform(:edge_controller)
-      else
-        SystemActor.system(:edge_controller)
-      end
+    # Control plane code - use platform actor
+    actor = SystemActor.platform(:edge_controller)
 
     case Ash.get(Tenant, tenant_id, actor: actor) do
       {:ok, %Tenant{} = tenant} -> {:ok, tenant}
@@ -522,46 +518,25 @@
   end
 
   defp find_package_across_tenants(package_id) do
-    if TenantMode.tenant_aware?() do
-      # Tenant-aware mode: search across all tenant schemas (Control Plane only)
-      actor = SystemActor.platform(:edge_controller)
-
-      TenantSchemas.list_schemas()
-      |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
-        case OnboardingPackage
-             |> Ash.Query.for_read(:read)
-             |> Ash.Query.filter(id == ^package_id)
-             |> Ash.read_one(tenant: schema, actor: actor) do
-          {:ok, nil} ->
-            {:cont, {:error, :not_found}}
-
-          {:ok, package} ->
-            {:halt, {:ok, package, schema}}
-
-          {:error, error} ->
-            {:halt, {:error, error}}
-        end
-      end)
-    else
-      # Tenant-unaware mode: search only current schema (tenant instance)
-      # Schema is implicit from DB connection's search_path
-      actor = SystemActor.system(:edge_controller)
-
+    # Control plane code - search across all tenant schemas
+    actor = SystemActor.platform(:edge_controller)
+
+    TenantSchemas.list_schemas()
+    |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
       case OnboardingPackage
            |> Ash.Query.for_read(:read)
            |> Ash.Query.filter(id == ^package_id)
-           |> Ash.read_one(actor: actor) do
+           |> Ash.read_one(tenant: schema, actor: actor) do
         {:ok, nil} ->
-          {:error, :not_found}
+          {:cont, {:error, :not_found}}
 
         {:ok, package} ->
-          # Return nil schema since it's implicit in tenant-unaware mode
-          {:ok, package, nil}
+          {:halt, {:ok, package, schema}}
 
         {:error, error} ->
-          {:error, error}
+          {:halt, {:error, error}}
       end
-    end
+    end)
   end

The TenantMode abstraction is incomplete because many files still use manual if
TenantMode.tenant_aware?() checks with duplicated logic for tenant-aware and
tenant-unaware modes, increasing complexity.

Examples:

web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex [630-669]
    if TenantMode.tenant_aware?() do
      # Tenant-aware mode: search across all tenant schemas (Control Plane only)
      actor = SystemActor.platform(:collector_controller)

      TenantSchemas.list_schemas()
      |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
        case CollectorPackage
             |> Ash.Query.for_read(:read)
             |> Ash.Query.filter(id == ^package_id)
             |> Ash.read_one(actor: actor, tenant: schema) do

 ... (clipped 30 lines)
web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex [525-564]
    if TenantMode.tenant_aware?() do
      # Tenant-aware mode: search across all tenant schemas (Control Plane only)
      actor = SystemActor.platform(:edge_controller)

      TenantSchemas.list_schemas()
      |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
        case OnboardingPackage
             |> Ash.Query.for_read(:read)
             |> Ash.Query.filter(id == ^package_id)
             |> Ash.read_one(tenant: schema, actor: actor) do

 ... (clipped 30 lines)

Solution Walkthrough:

Before:

defp find_package_across_tenants(package_id) do
  if TenantMode.tenant_aware?() do
    # Tenant-aware mode: search across all tenant schemas
    actor = SystemActor.platform(:collector_controller)

    TenantSchemas.list_schemas()
    |> Enum.reduce_while({:error, :not_found}, fn schema, _ ->
      case Ash.read_one(CollectorPackage, package_id, actor: actor, tenant: schema) do
        # ... handle result ...
      end
    end)
  else
    # Tenant-unaware mode: search only current schema
    actor = SystemActor.system(:collector_controller)
    case Ash.read_one(CollectorPackage, package_id, actor: actor) do
      # ... handle result ...
    end
  end
end

After:

# In a helper module like `ServiceRadar.Cluster.TenantMode`
def read_across_tenants(query, opts) do
  if tenant_aware?() do
    # ... logic to iterate schemas and run query ...
  else
    # ... logic to run query on current schema ...
  end
end

# In the controller
defp find_package_across_tenants(package_id) do
  query = CollectorPackage
          |> Ash.Query.for_read(:read)
          |> Ash.Query.filter(id == ^package_id)

  TenantMode.read_across_tenants(query, actor_component: :collector_controller)
end

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that while the TenantMode module provides useful helpers, several key functions like find_package_across_tenants still contain large, duplicated if/else blocks based on TenantMode.tenant_aware?(), which could be further abstracted to improve maintainability.

Medium
General
Error on missing DB_SCHEMA
Suggestion Impact:Instead of adding a raise when DB_SCHEMA is missing, the commit removed the entire tenant-aware/tenant-unaware configuration block (including the DB_SCHEMA lookup/config). This touches the same code region but does not implement the suggested error; it effectively eliminates the scenario the suggestion targeted rather than hardening it.

code diff:

-  # Tenant mode configuration
-  # TENANT_AWARE_MODE controls whether the application uses explicit tenant context:
-  # - true (default): Pass tenant: parameter to Ash operations, enumerate tenant schemas
-  # - false: Tenant is implicit from DB connection's search_path (CNPG scoped credentials)
-  tenant_aware_mode =
-    case System.get_env("TENANT_AWARE_MODE") do
-      "false" -> false
-      "0" -> false
-      _ -> true
-    end
-
-  config :serviceradar_core, :tenant_aware_mode, tenant_aware_mode
-
-  # When TENANT_AWARE_MODE=false, the tenant schema comes from DB connection
-  # DB_SCHEMA is injected by tenant-workload-operator from CNPG credentials
-  if not tenant_aware_mode do
-    tenant_schema = System.get_env("DB_SCHEMA")
-
-    if tenant_schema do
-      config :serviceradar_core, :tenant_schema, tenant_schema
-    end
-  end

In tenant-unaware mode, raise an error if the DB_SCHEMA environment variable is
not set to prevent silent failures and ensure proper configuration.

elixir/serviceradar_core/config/runtime.exs [162-168]

 if not tenant_aware_mode do
   tenant_schema = System.get_env("DB_SCHEMA")
 
   if tenant_schema do
     config :serviceradar_core, :tenant_schema, tenant_schema
+  else
+    raise "TENANT_AWARE_MODE=false but DB_SCHEMA is not set"
   end
 end

[Suggestion processed]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that a missing DB_SCHEMA in tenant-unaware mode can lead to silent failures, and proposing to raise an error improves robustness against misconfiguration.

Medium
  • Update
Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3756800775 Original created: 2026-01-15T20:49:10Z --- ## PR Code Suggestions ✨ <!-- 98ea9b9 --> Explore these optional code suggestions: <table><thead><tr><td><strong>Category</strong></td><td align=left><strong>Suggestion&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </strong></td><td align=center><strong>Impact</strong></td></tr><tbody><tr><td rowspan=3>Possible issue</td> <td> <details><summary>✅ <s>Use platform actor for correct permissions</s></summary> ___ <details><summary><b>Suggestion Impact:</b></summary>The commit removed the TenantMode alias and replaced TenantMode.system_actor(:scope, nil) with SystemActor.platform(:scope) for scope-building and tenant fetching, aligning actor permissions with cross-tenant/global resource access. code diff: ```diff alias ServiceRadar.Actors.SystemActor - alias ServiceRadar.Cluster.TenantMode alias ServiceRadar.Identity.Tenant alias ServiceRadar.Identity.User @@ -39,9 +38,8 @@ require Ash.Query active_tenant_id = Keyword.get(opts, :active_tenant_id) - # Use mode-conditional actor for scope building # Tenant and TenantMembership are public schema resources - actor = TenantMode.system_actor(:scope, nil) + actor = SystemActor.platform(:scope) # Load tenant separately - Tenant is a global resource, no tenant context needed user_with_tenant = Ash.load!(user, [:tenant], actor: actor) @@ -135,8 +133,8 @@ end defp fetch_tenant_by_id(tenant_id) when is_binary(tenant_id) do - # Tenant is in public schema, use mode-conditional actor - actor = TenantMode.system_actor(:scope, nil) + # Tenant is in public schema + actor = SystemActor.platform(:scope) ``` </details> ___ **To prevent authorization failures when accessing global resources, use <br><code>SystemActor.platform(:scope)</code> instead of <code>TenantMode.system_actor(:scope, nil)</code> to <br>ensure the actor has the required <code>:super_admin</code> role.** [web-ng/lib/serviceradar_web_ng/accounts/scope.ex [44-47]](https://github.com/carverauto/serviceradar/pull/2320/files#diff-8142f5d0719ccc41761eee96fa01036051e73b305766b3bb09e0c36945ef84ddR44-R47) ```diff -# Use mode-conditional actor for scope building -# Tenant and TenantMembership are public schema resources -actor = TenantMode.system_actor(:scope, nil) +# Use platform actor for scope building - this is a cross-tenant operation +# that needs to load user relationships and memberships from public schema resources. +actor = SystemActor.platform(:scope) # Load tenant separately - Tenant is a global resource, no tenant context needed user_with_tenant = Ash.load!(user, [:tenant], actor: actor) ``` `[To ensure code accuracy, apply this suggestion manually]` <details><summary>Suggestion importance[1-10]: 9</summary> __ Why: The suggestion correctly identifies a potential authorization bug where a `:system` role actor is used for an operation that requires `:super_admin` privileges to access global resources like `Tenant`. </details></details></td><td align=center>High </td></tr><tr><td> <details><summary>✅ <s>Add actor to OnboardingPackages.list<!-- not_implemented --></s></summary> ___ <details><summary><b>Suggestion Impact:</b></summary>The commit changed the `OnboardingPackages.list/2` invocation in the suggested location to pass explicit tenant context (`tenant: schema`) instead of using `TenantMode.tenant_opts(schema)`. While it did not add the proposed `actor` option, it did address the underlying tenant-context issue by altering the options passed to `list/2`. code diff: ```diff with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - tenant_opts = TenantMode.tenant_opts(schema) - packages = OnboardingPackages.list(filters, tenant_opts) + # Control plane code - pass tenant context + packages = OnboardingPackages.list(filters, tenant: schema) json(conn, Enum.map(packages, &package_to_json/1)) ``` </details> ___ **Add the <code>actor</code> option to the <code>OnboardingPackages.list/2</code> call to prevent query <br>failures in tenant-specific contexts.** [web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex [56-61]](https://github.com/carverauto/serviceradar/pull/2320/files#diff-05935a3b7cbb6dccb1dd5635980102662534d3cd929d751af33160f5c6714935R56-R61) ```diff with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - tenant_opts = TenantMode.tenant_opts(schema) - packages = OnboardingPackages.list(filters, tenant_opts) + actor = TenantMode.system_actor(:edge_controller, tenant.id) + opts = [actor: actor] ++ TenantMode.tenant_opts(schema) + packages = OnboardingPackages.list(filters, opts) json(conn, Enum.map(packages, &package_to_json/1)) end ``` `[Suggestion processed]` <details><summary>Suggestion importance[1-10]: 9</summary> __ Why: The suggestion correctly identifies a missing `actor` in an Ash query, which would cause requests to fail. This is a critical bug fix. </details></details></td><td align=center>High </td></tr><tr><td> <details><summary>✅ <s>Include implicit schema in all_tenants<!-- not_implemented --></s></summary> ___ <details><summary><b>Suggestion Impact:</b></summary>The commit modified the same all_tenants function and its surrounding documentation, but it did the opposite of the suggestion: it removed tenant-aware logic and hard-coded all_tenants to always return [] with comments asserting enumeration is unnecessary. No implicit schema lookup was added, so the suggested migration fix was not implemented. code diff: ```diff @doc """ - Returns all tenant schemas for migrations and cross-tenant operations. + Returns tenant schemas for migrations. - In tenant-aware mode, returns all tenant schemas from the database. - In tenant-unaware mode, returns an empty list (there's only "self"). + In tenant instance deployments, the schema is set by the DB connection's + search_path so there is nothing to enumerate. """ def all_tenants do - if TenantMode.tenant_aware?() do - ServiceRadar.Cluster.TenantSchemas.list_schemas() - else - # In tenant-unaware mode, the schema is set by DB connection - # There's no need to enumerate tenants for migrations - [] - end + # Schema is set by DB connection's search_path (CNPG credentials) + # No need to enumerate tenants + [] end ``` </details> ___ **Modify <code>all_tenants</code> to return the configured schema in tenant-unaware mode, <br>ensuring that database migrations can run against the current tenant's schema.** [elixir/serviceradar_core/lib/serviceradar/repo.ex [50-58]](https://github.com/carverauto/serviceradar/pull/2320/files#diff-07a1d27a8e8c0f459cb06766961c8cf9d914a9ed04a539b98c6110f439590df1R50-R58) ```diff def all_tenants do if TenantMode.tenant_aware?() do ServiceRadar.Cluster.TenantSchemas.list_schemas() else - # In tenant-unaware mode, the schema is set by DB connection - # There's no need to enumerate tenants for migrations - [] + # Run migrations in the implicit schema from DB credentials + case Application.get_env(:serviceradar_core, :tenant_schema) || System.get_env("DB_SCHEMA") do + nil -> [] + schema -> [schema] + end end end ``` `[Suggestion processed]` <details><summary>Suggestion importance[1-10]: 8</summary> __ Why: The suggestion correctly points out that migrations would not run in tenant-unaware mode because `all_tenants` returns an empty list, which is a significant bug. </details></details></td><td align=center>Medium </td></tr><tr><td rowspan=1>High-level</td> <td> <details><summary>✅ <s>The PR introduces an incomplete abstraction</s></summary> ___ <details><summary><b>Suggestion Impact:</b></summary>The commit removed `TenantMode` usage and eliminated multiple `if TenantMode.tenant_aware?()` branches (including `find_package_across_tenants/1` in both controllers), replacing them with a single control-plane code path that always uses the platform actor and explicitly passes `tenant: schema` while iterating schemas. This reduces the duplicated conditional logic the suggestion called out, though it does not implement the proposed `TenantMode.read_across_tenants/2` helper abstraction. code diff: ```diff @@ -11,7 +11,6 @@ require Ash.Query alias ServiceRadar.Actors.SystemActor - alias ServiceRadar.Cluster.TenantMode alias ServiceRadar.Cluster.TenantSchemas alias ServiceRadar.Edge.CollectorPackage alias ServiceRadar.Edge.NatsCredential @@ -53,8 +52,9 @@ with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema) - packages = Ash.read!(query, opts) + # Control plane code - use platform actor with tenant context + actor = SystemActor.platform(:collector_controller) + packages = Ash.read!(query, actor: actor, tenant: schema) json(conn, Enum.map(packages, &package_to_json/1)) end end @@ -87,7 +87,9 @@ } schema = TenantSchemas.schema_for_tenant(tenant) - opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema) + # Control plane code - use platform actor with tenant context + actor = SystemActor.platform(:collector_controller) + opts = [actor: actor, tenant: schema] case CollectorPackage |> Ash.Changeset.for_create(:create, attrs) @@ -119,12 +121,13 @@ def show(conn, %{"id" => id}) do with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema) + # Control plane code - use platform actor with tenant context + actor = SystemActor.platform(:collector_controller) case CollectorPackage |> Ash.Query.for_read(:read) |> Ash.Query.filter(id == ^id) - |> Ash.read_one(opts) do + |> Ash.read_one(actor: actor, tenant: schema) do {:ok, nil} -> {:error, :not_found} {:ok, package} -> json(conn, package_to_json(package)) {:error, error} -> {:error, error} @@ -197,7 +200,9 @@ with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema) + # Control plane code - use platform actor with tenant context + actor = SystemActor.platform(:collector_controller) + opts = [actor: actor, tenant: schema] case CollectorPackage |> Ash.Query.for_read(:read) @@ -256,8 +261,9 @@ with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - opts = TenantMode.ash_opts(:collector_controller, tenant.id, schema) - credentials = Ash.read!(query, opts) + # Control plane code - use platform actor with tenant context + actor = SystemActor.platform(:collector_controller) + credentials = Ash.read!(query, actor: actor, tenant: schema) json(conn, Enum.map(credentials, &credential_to_json/1)) end end @@ -332,15 +338,9 @@ end defp get_package(package_id, tenant_schema) do - # Use platform actor in tenant-aware mode, system actor in tenant-unaware mode - actor = - if TenantMode.tenant_aware?() do - SystemActor.platform(:collector_controller) - else - SystemActor.system(:collector_controller) - end - - opts = [actor: actor] ++ TenantMode.tenant_opts(tenant_schema) + # Control plane code - use platform actor with tenant context + actor = SystemActor.platform(:collector_controller) + opts = [actor: actor, tenant: tenant_schema] case CollectorPackage |> Ash.Query.for_read(:read) @@ -432,15 +432,9 @@ defp decrypt_tls_key(_), do: {:error, :tls_key_invalid} defp mark_downloaded(package, source_ip, tenant_schema) do - # Use platform actor in tenant-aware mode, system actor in tenant-unaware mode - actor = - if TenantMode.tenant_aware?() do - SystemActor.platform(:collector_controller) - else - SystemActor.system(:collector_controller) - end - - opts = [actor: actor] ++ TenantMode.tenant_opts(tenant_schema) + # Control plane code - use platform actor with tenant context + actor = SystemActor.platform(:collector_controller) + opts = [actor: actor, tenant: tenant_schema] package |> Ash.Changeset.for_update(:download) @@ -627,46 +621,25 @@ end defp find_package_across_tenants(package_id) do - if TenantMode.tenant_aware?() do - # Tenant-aware mode: search across all tenant schemas (Control Plane only) - actor = SystemActor.platform(:collector_controller) - - TenantSchemas.list_schemas() - |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> - case CollectorPackage - |> Ash.Query.for_read(:read) - |> Ash.Query.filter(id == ^package_id) - |> Ash.read_one(actor: actor, tenant: schema) do - {:ok, nil} -> - {:cont, {:error, :not_found}} - - {:ok, package} -> - {:halt, {:ok, package, schema}} - - {:error, error} -> - {:halt, {:error, error}} - end - end) - else - # Tenant-unaware mode: search only current schema (tenant instance) - # Schema is implicit from DB connection's search_path - actor = SystemActor.system(:collector_controller) - + # Control plane code - search across all tenant schemas + actor = SystemActor.platform(:collector_controller) + + TenantSchemas.list_schemas() + |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> case CollectorPackage |> Ash.Query.for_read(:read) |> Ash.Query.filter(id == ^package_id) - |> Ash.read_one(actor: actor) do + |> Ash.read_one(actor: actor, tenant: schema) do {:ok, nil} -> - {:error, :not_found} + {:cont, {:error, :not_found}} {:ok, package} -> - # Return nil schema since it's implicit in tenant-unaware mode - {:ok, package, nil} + {:halt, {:ok, package, schema}} {:error, error} -> - {:error, error} - end - end + {:halt, {:error, error}} + end + end) end defp format_datetime(nil), do: nil # File: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex @@ -11,7 +11,6 @@ require Ash.Query alias ServiceRadar.Actors.SystemActor - alias ServiceRadar.Cluster.TenantMode alias ServiceRadar.Cluster.TenantSchemas alias ServiceRadar.Edge.OnboardingPackage alias ServiceRadarWebNG.Edge.OnboardingPackages @@ -55,8 +54,8 @@ with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - tenant_opts = TenantMode.tenant_opts(schema) - packages = OnboardingPackages.list(filters, tenant_opts) + # Control plane code - pass tenant context + packages = OnboardingPackages.list(filters, tenant: schema) json(conn, Enum.map(packages, &package_to_json/1)) end end @@ -91,13 +90,14 @@ with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - opts = - [ - join_token_ttl_seconds: params["join_token_ttl_seconds"] || 86_400, - download_token_ttl_seconds: params["download_token_ttl_seconds"] || 86_400, - actor: actor, - source_ip: source_ip - ] ++ TenantMode.tenant_opts(schema) + # Control plane code - pass tenant context + opts = [ + join_token_ttl_seconds: params["join_token_ttl_seconds"] || 86_400, + download_token_ttl_seconds: params["download_token_ttl_seconds"] || 86_400, + actor: actor, + source_ip: source_ip, + tenant: schema + ] case OnboardingPackages.create(attrs, opts) do {:ok, result} -> @@ -124,9 +124,9 @@ def show(conn, %{"id" => id}) do with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - tenant_opts = TenantMode.tenant_opts(schema) - - case OnboardingPackages.get(id, tenant_opts) do + + # Control plane code - pass tenant context + case OnboardingPackages.get(id, tenant: schema) do {:ok, package} -> json(conn, package_to_json(package)) @@ -147,7 +147,8 @@ with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - opts = [actor: actor, source_ip: source_ip] ++ TenantMode.tenant_opts(schema) + # Control plane code - pass tenant context + opts = [actor: actor, source_ip: source_ip, tenant: schema] case OnboardingPackages.delete(id, opts) do {:ok, _package} -> @@ -176,11 +177,11 @@ # First verify package exists with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - tenant_opts = TenantMode.tenant_opts(schema) - - case OnboardingPackages.get(package_id, tenant_opts) do + + # Control plane code - pass tenant context + case OnboardingPackages.get(package_id, tenant: schema) do {:ok, _package} -> - events = OnboardingEvents.list_for_package(package_id, [limit: limit] ++ tenant_opts) + events = OnboardingEvents.list_for_package(package_id, limit: limit, tenant: schema) json(conn, Enum.map(events, &event_to_json/1)) {:error, :not_found} -> @@ -227,7 +228,8 @@ end defp deliver_package(id, download_token, tenant_schema, source_ip, actor) do - opts = [actor: actor, source_ip: source_ip] ++ TenantMode.tenant_opts(tenant_schema) + # Control plane code - pass tenant context + opts = [actor: actor, source_ip: source_ip, tenant: tenant_schema] case OnboardingPackages.deliver(id, download_token, opts) do {:ok, result} -> @@ -349,9 +351,8 @@ with {:ok, tenant} <- require_tenant(conn) do schema = TenantSchemas.schema_for_tenant(tenant) - opts = - [actor: actor, source_ip: source_ip, reason: reason] ++ - TenantMode.tenant_opts(schema) + # Control plane code - pass tenant context + opts = [actor: actor, source_ip: source_ip, reason: reason, tenant: schema] case OnboardingPackages.revoke(id, opts) do {:ok, package} -> @@ -492,13 +493,8 @@ defp load_tenant(nil), do: {:error, :unauthorized} defp load_tenant(tenant_id) do - # Use platform actor in tenant-aware mode, system actor in tenant-unaware mode - actor = - if TenantMode.tenant_aware?() do - SystemActor.platform(:edge_controller) - else - SystemActor.system(:edge_controller) - end + # Control plane code - use platform actor + actor = SystemActor.platform(:edge_controller) case Ash.get(Tenant, tenant_id, actor: actor) do {:ok, %Tenant{} = tenant} -> {:ok, tenant} @@ -522,46 +518,25 @@ end defp find_package_across_tenants(package_id) do - if TenantMode.tenant_aware?() do - # Tenant-aware mode: search across all tenant schemas (Control Plane only) - actor = SystemActor.platform(:edge_controller) - - TenantSchemas.list_schemas() - |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> - case OnboardingPackage - |> Ash.Query.for_read(:read) - |> Ash.Query.filter(id == ^package_id) - |> Ash.read_one(tenant: schema, actor: actor) do - {:ok, nil} -> - {:cont, {:error, :not_found}} - - {:ok, package} -> - {:halt, {:ok, package, schema}} - - {:error, error} -> - {:halt, {:error, error}} - end - end) - else - # Tenant-unaware mode: search only current schema (tenant instance) - # Schema is implicit from DB connection's search_path - actor = SystemActor.system(:edge_controller) - + # Control plane code - search across all tenant schemas + actor = SystemActor.platform(:edge_controller) + + TenantSchemas.list_schemas() + |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> case OnboardingPackage |> Ash.Query.for_read(:read) |> Ash.Query.filter(id == ^package_id) - |> Ash.read_one(actor: actor) do + |> Ash.read_one(tenant: schema, actor: actor) do {:ok, nil} -> - {:error, :not_found} + {:cont, {:error, :not_found}} {:ok, package} -> - # Return nil schema since it's implicit in tenant-unaware mode - {:ok, package, nil} + {:halt, {:ok, package, schema}} {:error, error} -> - {:error, error} + {:halt, {:error, error}} end - end + end) end ``` </details> ___ **The <code>TenantMode</code> abstraction is incomplete because many files still use manual <code>if </code><br><code>TenantMode.tenant_aware?()</code> checks with duplicated logic for tenant-aware and <br>tenant-unaware modes, increasing complexity.** ### Examples: <details> <summary> <a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-c3752db9bdbf3d914b0032e698ba69bdd077a86694275b43b629d9905c8e2156R630-R669">web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex [630-669]</a> </summary> ```elixir if TenantMode.tenant_aware?() do # Tenant-aware mode: search across all tenant schemas (Control Plane only) actor = SystemActor.platform(:collector_controller) TenantSchemas.list_schemas() |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> case CollectorPackage |> Ash.Query.for_read(:read) |> Ash.Query.filter(id == ^package_id) |> Ash.read_one(actor: actor, tenant: schema) do ... (clipped 30 lines) ``` </details> <details> <summary> <a href="https://github.com/carverauto/serviceradar/pull/2320/files#diff-05935a3b7cbb6dccb1dd5635980102662534d3cd929d751af33160f5c6714935R525-R564">web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex [525-564]</a> </summary> ```elixir if TenantMode.tenant_aware?() do # Tenant-aware mode: search across all tenant schemas (Control Plane only) actor = SystemActor.platform(:edge_controller) TenantSchemas.list_schemas() |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> case OnboardingPackage |> Ash.Query.for_read(:read) |> Ash.Query.filter(id == ^package_id) |> Ash.read_one(tenant: schema, actor: actor) do ... (clipped 30 lines) ``` </details> ### Solution Walkthrough: #### Before: ```elixir defp find_package_across_tenants(package_id) do if TenantMode.tenant_aware?() do # Tenant-aware mode: search across all tenant schemas actor = SystemActor.platform(:collector_controller) TenantSchemas.list_schemas() |> Enum.reduce_while({:error, :not_found}, fn schema, _ -> case Ash.read_one(CollectorPackage, package_id, actor: actor, tenant: schema) do # ... handle result ... end end) else # Tenant-unaware mode: search only current schema actor = SystemActor.system(:collector_controller) case Ash.read_one(CollectorPackage, package_id, actor: actor) do # ... handle result ... end end end ``` #### After: ```elixir # In a helper module like `ServiceRadar.Cluster.TenantMode` def read_across_tenants(query, opts) do if tenant_aware?() do # ... logic to iterate schemas and run query ... else # ... logic to run query on current schema ... end end # In the controller defp find_package_across_tenants(package_id) do query = CollectorPackage |> Ash.Query.for_read(:read) |> Ash.Query.filter(id == ^package_id) TenantMode.read_across_tenants(query, actor_component: :collector_controller) end ``` <details><summary>Suggestion importance[1-10]: 8</summary> __ Why: The suggestion correctly identifies that while the `TenantMode` module provides useful helpers, several key functions like `find_package_across_tenants` still contain large, duplicated `if/else` blocks based on `TenantMode.tenant_aware?()`, which could be further abstracted to improve maintainability. </details></details></td><td align=center>Medium </td></tr><tr><td rowspan=1>General</td> <td> <details><summary>✅ <s>Error on missing DB_SCHEMA<!-- not_implemented --></s></summary> ___ <details><summary><b>Suggestion Impact:</b></summary>Instead of adding a raise when DB_SCHEMA is missing, the commit removed the entire tenant-aware/tenant-unaware configuration block (including the DB_SCHEMA lookup/config). This touches the same code region but does not implement the suggested error; it effectively eliminates the scenario the suggestion targeted rather than hardening it. code diff: ```diff - # Tenant mode configuration - # TENANT_AWARE_MODE controls whether the application uses explicit tenant context: - # - true (default): Pass tenant: parameter to Ash operations, enumerate tenant schemas - # - false: Tenant is implicit from DB connection's search_path (CNPG scoped credentials) - tenant_aware_mode = - case System.get_env("TENANT_AWARE_MODE") do - "false" -> false - "0" -> false - _ -> true - end - - config :serviceradar_core, :tenant_aware_mode, tenant_aware_mode - - # When TENANT_AWARE_MODE=false, the tenant schema comes from DB connection - # DB_SCHEMA is injected by tenant-workload-operator from CNPG credentials - if not tenant_aware_mode do - tenant_schema = System.get_env("DB_SCHEMA") - - if tenant_schema do - config :serviceradar_core, :tenant_schema, tenant_schema - end - end ``` </details> ___ **In tenant-unaware mode, raise an error if the <code>DB_SCHEMA</code> environment variable is <br>not set to prevent silent failures and ensure proper configuration.** [elixir/serviceradar_core/config/runtime.exs [162-168]](https://github.com/carverauto/serviceradar/pull/2320/files#diff-5d045e2af9f15590a9745058e25a00380ad7a2cc363d0a9934715bd11ea8eef3R162-R168) ```diff if not tenant_aware_mode do tenant_schema = System.get_env("DB_SCHEMA") if tenant_schema do config :serviceradar_core, :tenant_schema, tenant_schema + else + raise "TENANT_AWARE_MODE=false but DB_SCHEMA is not set" end end ``` `[Suggestion processed]` <details><summary>Suggestion importance[1-10]: 7</summary> __ Why: The suggestion correctly identifies that a missing `DB_SCHEMA` in tenant-unaware mode can lead to silent failures, and proposing to raise an error improves robustness against misconfiguration. </details></details></td><td align=center>Medium </td></tr> <tr><td align="center" colspan="2"> - [ ] Update <!-- /improve_multi --more_suggestions=true --> </td><td></td></tr></tbody></table>
mfreeman451 commented 2026-01-15 21:00:30 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695943300
Original created: 2026-01-15T21:00:30Z
Original path: elixir/serviceradar_core/config/runtime.exs
Original line: 151

not sure why this is still in here

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695943300 Original created: 2026-01-15T21:00:30Z Original path: elixir/serviceradar_core/config/runtime.exs Original line: 151 --- not sure why this is still in here
mfreeman451 commented 2026-01-15 21:01:01 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695944566
Original created: 2026-01-15T21:01:01Z
Original path: elixir/serviceradar_core/lib/serviceradar/actors/system_actor.ex
Original line: 41

not sure why we need this anymore at all

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695944566 Original created: 2026-01-15T21:01:01Z Original path: elixir/serviceradar_core/lib/serviceradar/actors/system_actor.ex Original line: 41 --- not sure why we need this anymore at all
mfreeman451 commented 2026-01-15 21:01:29 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695945686
Original created: 2026-01-15T21:01:29Z
Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/config_server.ex
Original line: 29

why do we need this?

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695945686 Original created: 2026-01-15T21:01:29Z Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/config_server.ex Original line: 29 --- why do we need this?
mfreeman451 commented 2026-01-15 21:01:46 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695946250
Original created: 2026-01-15T21:01:46Z
Original path: elixir/serviceradar_core/lib/serviceradar/cluster/tenant_mode.ex
Original line: 1

this file shouldnt even exist

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695946250 Original created: 2026-01-15T21:01:46Z Original path: elixir/serviceradar_core/lib/serviceradar/cluster/tenant_mode.ex Original line: 1 --- this file shouldnt even exist
mfreeman451 commented 2026-01-15 21:02:44 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695948788
Original created: 2026-01-15T21:02:44Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 34

not sure why this exists in here anymore

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695948788 Original created: 2026-01-15T21:02:44Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 34 --- not sure why this exists in here anymore
mfreeman451 commented 2026-01-15 21:03:03 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695949555
Original created: 2026-01-15T21:03:03Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex
Original line: 30

more tenant crap

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2695949555 Original created: 2026-01-15T21:03:03Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex Original line: 30 --- more tenant crap
mfreeman451 commented 2026-01-15 22:37:20 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696209995
Original created: 2026-01-15T22:37:20Z
Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex
Original line: 56

do we still need SystemActor in here as well?

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696209995 Original created: 2026-01-15T22:37:20Z Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/snmp_compiler.ex Original line: 56 --- do we still need SystemActor in here as well?
mfreeman451 commented 2026-01-15 22:37:44 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696210785
Original created: 2026-01-15T22:37:44Z
Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/sweep_compiler.ex
Original line: 39

do we still need systemactor stuff in here?

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696210785 Original created: 2026-01-15T22:37:44Z Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/sweep_compiler.ex Original line: 39 --- do we still need systemactor stuff in here?
mfreeman451 commented 2026-01-15 22:38:39 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696212570
Original created: 2026-01-15T22:38:39Z
Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/sysmon_compiler.ex
Original line: 47

systomactor usage still necessary?

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696212570 Original created: 2026-01-15T22:38:39Z Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/compilers/sysmon_compiler.ex Original line: 47 --- systomactor usage still necessary?
mfreeman451 commented 2026-01-15 22:39:22 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696214146
Original created: 2026-01-15T22:39:22Z
Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/config_server.ex
Original line: 172

why are we still passing tenant ID here? database isnt supposed to be tenant aware at all anymore

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696214146 Original created: 2026-01-15T22:39:22Z Original path: elixir/serviceradar_core/lib/serviceradar/agent_config/config_server.ex Original line: 172 --- why are we still passing tenant ID here? database isnt supposed to be tenant aware at all anymore
mfreeman451 commented 2026-01-15 22:42:28 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696221123
Original created: 2026-01-15T22:42:28Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 71

why do we do get_tenant here? SR isn't going to be tenant aware anymore, multi-tenancy is basically our control plane provisioning separate resources, with a shared database as a service (cnpg) and NATS

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696221123 Original created: 2026-01-15T22:42:28Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 71 --- why do we do get_tenant here? SR isn't going to be tenant aware anymore, multi-tenancy is basically our control plane provisioning separate resources, with a shared database as a service (cnpg) and NATS
mfreeman451 commented 2026-01-15 22:42:48 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696221823
Original created: 2026-01-15T22:42:48Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 91

not sure why we care aboute tenants here

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696221823 Original created: 2026-01-15T22:42:48Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 91 --- not sure why we care aboute tenants here
mfreeman451 commented 2026-01-15 22:44:14 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696224729
Original created: 2026-01-15T22:44:14Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 105

more tenant aware stuff, we might need some of this provisioning code so users can provision collectors, but it doesnt really need to be tenant aware anymore, provisioners will just generate NATS credentials that talk to their NATS account, or mTLS credentials and they'll talk to their own agent-gateway and so on -- every tenant gets their own resources, there is no more shared agent-gateway.

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696224729 Original created: 2026-01-15T22:44:14Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 105 --- more tenant aware stuff, we might need some of this provisioning code so users can provision collectors, but it doesnt really need to be tenant aware anymore, provisioners will just generate NATS credentials that talk to their NATS account, or mTLS credentials and they'll talk to their own agent-gateway and so on -- every tenant gets their own resources, there is no more shared agent-gateway.
mfreeman451 commented 2026-01-15 22:45:27 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696227112
Original created: 2026-01-15T22:45:27Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 182

do we still need get_tenant anymore? every tenant will get their own credentials into CNPG and their own schema, their search path should just be the default schema, and we dump everything in there?

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696227112 Original created: 2026-01-15T22:45:27Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 182 --- do we still need get_tenant anymore? every tenant will get their own credentials into CNPG and their own schema, their search path should just be the default schema, and we dump everything in there?
mfreeman451 commented 2026-01-15 22:45:37 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696227407
Original created: 2026-01-15T22:45:37Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 183

do we still need to use this systemactor stuff anymore??

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696227407 Original created: 2026-01-15T22:45:37Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 183 --- do we still need to use this systemactor stuff anymore??
mfreeman451 commented 2026-01-15 22:47:01 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696230080
Original created: 2026-01-15T22:47:01Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 219

not clear if we should be using systemactor stuff anymore, nats tenant credentials should live in each tenant's database, platform/system nats level credentials live in the public schema or some schema where only the control plane has access to

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696230080 Original created: 2026-01-15T22:47:01Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 219 --- not clear if we should be using systemactor stuff anymore, nats tenant credentials should live in each tenant's database, platform/system nats level credentials live in the public schema or some schema where only the control plane has access to
mfreeman451 commented 2026-01-15 22:48:19 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696233253
Original created: 2026-01-15T22:48:19Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex
Original line: 252

dont think this should be necessary anymore

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696233253 Original created: 2026-01-15T22:48:19Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_collector_worker.ex Original line: 252 --- dont think this should be necessary anymore
mfreeman451 commented 2026-01-15 22:48:38 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696233943
Original created: 2026-01-15T22:48:38Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex
Original line: 39

why do we need to load tenant anymore?

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696233943 Original created: 2026-01-15T22:48:38Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex Original line: 39 --- why do we need to load tenant anymore?
mfreeman451 commented 2026-01-15 22:48:59 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696234603
Original created: 2026-01-15T22:48:59Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex
Original line: 65

why do we need this systemactor stuff

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696234603 Original created: 2026-01-15T22:48:59Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex Original line: 65 --- why do we need this systemactor stuff
mfreeman451 commented 2026-01-15 22:49:08 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696234900
Original created: 2026-01-15T22:49:08Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex
Original line: 94

why are we still doing load_tenant?

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696234900 Original created: 2026-01-15T22:49:08Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex Original line: 94 --- why are we still doing load_tenant?
mfreeman451 commented 2026-01-15 22:50:13 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696237236
Original created: 2026-01-15T22:50:13Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex
Original line: 105

dont know why this stuff needs to be tenant aware anymore.. we might need to provision leaf workers but it doesnt need to be tenant aware

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696237236 Original created: 2026-01-15T22:50:13Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/provision_leaf_worker.ex Original line: 105 --- dont know why this stuff needs to be tenant aware anymore.. we might need to provision leaf workers but it doesnt need to be tenant aware
mfreeman451 commented 2026-01-15 22:50:30 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696237788
Original created: 2026-01-15T22:50:30Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/record_event_worker.ex
Original line: 15

do we still need to use systemactor stuff here

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696237788 Original created: 2026-01-15T22:50:30Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/workers/record_event_worker.ex Original line: 15 --- do we still need to use systemactor stuff here
mfreeman451 commented 2026-01-15 22:51:17 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696239179
Original created: 2026-01-15T22:51:17Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex
Original line: 77

dont think this still needs to be tenant aware anymore

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696239179 Original created: 2026-01-15T22:51:17Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex Original line: 77 --- dont think this still needs to be tenant aware anymore
mfreeman451 commented 2026-01-15 22:51:29 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696239595
Original created: 2026-01-15T22:51:29Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex
Original line: 96

still tenant aware

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696239595 Original created: 2026-01-15T22:51:29Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex Original line: 96 --- still tenant aware
mfreeman451 commented 2026-01-15 22:51:58 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696240412
Original created: 2026-01-15T22:51:58Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex
Original line: 126

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696240412 Original created: 2026-01-15T22:51:58Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/agent_gateway_sync.ex Original line: 126 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:52:31 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696241372
Original created: 2026-01-15T22:52:31Z
Original path: elixir/serviceradar_core/lib/serviceradar/edge/onboarding_events.ex
Original line: 17

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696241372 Original created: 2026-01-15T22:52:31Z Original path: elixir/serviceradar_core/lib/serviceradar/edge/onboarding_events.ex Original line: 17 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:52:56 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696242241
Original created: 2026-01-15T22:52:56Z
Original path: elixir/serviceradar_core/lib/serviceradar/event_writer/tenant_context.ex
Original line: 13

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696242241 Original created: 2026-01-15T22:52:56Z Original path: elixir/serviceradar_core/lib/serviceradar/event_writer/tenant_context.ex Original line: 13 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:53:09 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696242645
Original created: 2026-01-15T22:53:09Z
Original path: elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex
Original line: 17

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696242645 Original created: 2026-01-15T22:53:09Z Original path: elixir/serviceradar_core/lib/serviceradar/events/onboarding_writer.ex Original line: 17 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:53:30 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696243297
Original created: 2026-01-15T22:53:30Z
Original path: elixir/serviceradar_core/lib/serviceradar/identity/senders/send_magic_link_email.ex
Original line: 235

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696243297 Original created: 2026-01-15T22:53:30Z Original path: elixir/serviceradar_core/lib/serviceradar/identity/senders/send_magic_link_email.ex Original line: 235 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:53:36 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696243455
Original created: 2026-01-15T22:53:36Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_event.ex
Original line: 325

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696243455 Original created: 2026-01-15T22:53:36Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_event.ex Original line: 325 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:53:43 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696243681
Original created: 2026-01-15T22:53:43Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 127

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696243681 Original created: 2026-01-15T22:53:43Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 127 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:53:54 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244002
Original created: 2026-01-15T22:53:54Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 287

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244002 Original created: 2026-01-15T22:53:54Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 287 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:53:56 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244077
Original created: 2026-01-15T22:53:56Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 294

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244077 Original created: 2026-01-15T22:53:56Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 294 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:54:07 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244379
Original created: 2026-01-15T22:54:07Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 338

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244379 Original created: 2026-01-15T22:54:07Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 338 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:54:17 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244730
Original created: 2026-01-15T22:54:17Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 375

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244730 Original created: 2026-01-15T22:54:17Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 375 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:54:24 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244941
Original created: 2026-01-15T22:54:24Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 416

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696244941 Original created: 2026-01-15T22:54:24Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 416 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:54:35 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696245228
Original created: 2026-01-15T22:54:35Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 429

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696245228 Original created: 2026-01-15T22:54:35Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 429 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:54:39 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696245429
Original created: 2026-01-15T22:54:39Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex
Original line: 420

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696245429 Original created: 2026-01-15T22:54:39Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/health_tracker.ex Original line: 420 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:54:48 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696245661
Original created: 2026-01-15T22:54:48Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex
Original line: 151

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696245661 Original created: 2026-01-15T22:54:48Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex Original line: 151 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:55:05 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696246307
Original created: 2026-01-15T22:55:05Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex
Original line: 200

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696246307 Original created: 2026-01-15T22:55:05Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex Original line: 200 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:55:11 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696246652
Original created: 2026-01-15T22:55:11Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex
Original line: 286

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696246652 Original created: 2026-01-15T22:55:11Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex Original line: 286 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:55:24 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696247216
Original created: 2026-01-15T22:55:24Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex
Original line: 345

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696247216 Original created: 2026-01-15T22:55:24Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex Original line: 345 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:55:27 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696247351
Original created: 2026-01-15T22:55:27Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex
Original line: 343

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696247351 Original created: 2026-01-15T22:55:27Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex Original line: 343 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:55:38 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696247726
Original created: 2026-01-15T22:55:38Z
Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex
Original line: 301

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696247726 Original created: 2026-01-15T22:55:38Z Original path: elixir/serviceradar_core/lib/serviceradar/infrastructure/state_monitor.ex Original line: 301 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:55:48 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696248227
Original created: 2026-01-15T22:55:48Z
Original path: elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor.ex
Original line: 14

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696248227 Original created: 2026-01-15T22:55:48Z Original path: elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor.ex Original line: 14 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:56:28 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696250035
Original created: 2026-01-15T22:56:28Z
Original path: elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor_queue.ex
Original line: 302

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696250035 Original created: 2026-01-15T22:56:28Z Original path: elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor_queue.ex Original line: 302 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:56:45 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696250735
Original created: 2026-01-15T22:56:45Z
Original path: elixir/serviceradar_core/lib/serviceradar/monitoring/alert_generator.ex
Original line: 31

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696250735 Original created: 2026-01-15T22:56:45Z Original path: elixir/serviceradar_core/lib/serviceradar/monitoring/alert_generator.ex Original line: 31 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:56:56 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696251334
Original created: 2026-01-15T22:56:56Z
Original path: elixir/serviceradar_core/lib/serviceradar/monitoring/poll_orchestrator.ex
Original line: 67

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696251334 Original created: 2026-01-15T22:56:56Z Original path: elixir/serviceradar_core/lib/serviceradar/monitoring/poll_orchestrator.ex Original line: 67 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:57:02 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696251917
Original created: 2026-01-15T22:57:02Z
Original path: elixir/serviceradar_core/lib/serviceradar/monitoring/poll_orchestrator.ex
Original line: 389

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696251917 Original created: 2026-01-15T22:57:02Z Original path: elixir/serviceradar_core/lib/serviceradar/monitoring/poll_orchestrator.ex Original line: 389 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:57:13 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696252862
Original created: 2026-01-15T22:57:13Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex
Original line: 17

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696252862 Original created: 2026-01-15T22:57:13Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex Original line: 17 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:57:17 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696253282
Original created: 2026-01-15T22:57:17Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex
Original line: 15

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696253282 Original created: 2026-01-15T22:57:17Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex Original line: 15 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:57:23 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696253891
Original created: 2026-01-15T22:57:23Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex
Original line: 45

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696253891 Original created: 2026-01-15T22:57:23Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/rule_seeder.ex Original line: 45 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:57:36 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696254882
Original created: 2026-01-15T22:57:36Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex
Original line: 93

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696254882 Original created: 2026-01-15T22:57:36Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex Original line: 93 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:57:45 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696255636
Original created: 2026-01-15T22:57:45Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex
Original line: 103

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696255636 Original created: 2026-01-15T22:57:45Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex Original line: 103 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:57:50 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696256087
Original created: 2026-01-15T22:57:50Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex
Original line: 118

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696256087 Original created: 2026-01-15T22:57:50Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_cleanup_worker.ex Original line: 118 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:58:09 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696257670
Original created: 2026-01-15T22:58:09Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine.ex
Original line: 394

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696257670 Original created: 2026-01-15T22:58:09Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine.ex Original line: 394 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:58:15 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696258064
Original created: 2026-01-15T22:58:15Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine.ex
Original line: 412

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696258064 Original created: 2026-01-15T22:58:15Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine.ex Original line: 412 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:58:39 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696259803
Original created: 2026-01-15T22:58:39Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine.ex
Original line: 568

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696259803 Original created: 2026-01-15T22:58:39Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/stateful_alert_engine.ex Original line: 568 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:58:49 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696260559
Original created: 2026-01-15T22:58:49Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex
Original line: 26

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696260559 Original created: 2026-01-15T22:58:49Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/sync_log_writer.ex Original line: 26 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:59:08 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696261645
Original created: 2026-01-15T22:59:08Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/sysmon_metrics_ingestor.ex
Original line: 20

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696261645 Original created: 2026-01-15T22:59:08Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/sysmon_metrics_ingestor.ex Original line: 20 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:59:33 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263011
Original created: 2026-01-15T22:59:33Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex
Original line: 12

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263011 Original created: 2026-01-15T22:59:33Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex Original line: 12 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:59:40 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263395
Original created: 2026-01-15T22:59:40Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex
Original line: 45

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263395 Original created: 2026-01-15T22:59:40Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex Original line: 45 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:59:45 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263612
Original created: 2026-01-15T22:59:45Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex
Original line: 50

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263612 Original created: 2026-01-15T22:59:45Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex Original line: 50 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 22:59:50 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263851
Original created: 2026-01-15T22:59:50Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex
Original line: 48

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696263851 Original created: 2026-01-15T22:59:50Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/template_seeder.ex Original line: 48 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:00:16 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696264855
Original created: 2026-01-15T23:00:16Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_seeder.ex
Original line: 12

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696264855 Original created: 2026-01-15T23:00:16Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_seeder.ex Original line: 12 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:00:21 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696265035
Original created: 2026-01-15T23:00:21Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_seeder.ex
Original line: 41

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696265035 Original created: 2026-01-15T23:00:21Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_seeder.ex Original line: 41 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:00:37 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696265480
Original created: 2026-01-15T23:00:37Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_sync.ex
Original line: 168

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696265480 Original created: 2026-01-15T23:00:37Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_sync.ex Original line: 168 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:00:48 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696265731
Original created: 2026-01-15T23:00:48Z
Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_sync.ex
Original line: 250

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696265731 Original created: 2026-01-15T23:00:48Z Original path: elixir/serviceradar_core/lib/serviceradar/observability/zen_rule_sync.ex Original line: 250 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:01:02 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696266115
Original created: 2026-01-15T23:01:02Z
Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex
Original line: 40

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696266115 Original created: 2026-01-15T23:01:02Z Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex Original line: 40 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:01:16 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696266689
Original created: 2026-01-15T23:01:16Z
Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex
Original line: 117

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696266689 Original created: 2026-01-15T23:01:16Z Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex Original line: 117 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:12 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696268559
Original created: 2026-01-15T23:02:12Z
Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex
Original line: 566

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696268559 Original created: 2026-01-15T23:02:12Z Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex Original line: 566 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:17 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696268750
Original created: 2026-01-15T23:02:17Z
Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex
Original line: 574

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696268750 Original created: 2026-01-15T23:02:17Z Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex Original line: 574 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:21 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696268889
Original created: 2026-01-15T23:02:21Z
Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex
Original line: 579

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696268889 Original created: 2026-01-15T23:02:21Z Original path: elixir/serviceradar_core/lib/serviceradar/sweep_jobs/sweep_results_ingestor.ex Original line: 579 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:29 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269244
Original created: 2026-01-15T23:02:29Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 13

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269244 Original created: 2026-01-15T23:02:29Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 13 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:34 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269449
Original created: 2026-01-15T23:02:34Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 21

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269449 Original created: 2026-01-15T23:02:34Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 21 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:38 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269646
Original created: 2026-01-15T23:02:38Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 22

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269646 Original created: 2026-01-15T23:02:38Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 22 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:42 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269903
Original created: 2026-01-15T23:02:42Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 25

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696269903 Original created: 2026-01-15T23:02:42Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 25 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:46 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270096
Original created: 2026-01-15T23:02:46Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 27

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270096 Original created: 2026-01-15T23:02:46Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 27 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:51 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270266
Original created: 2026-01-15T23:02:51Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 30

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270266 Original created: 2026-01-15T23:02:51Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 30 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:02:56 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270473
Original created: 2026-01-15T23:02:56Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 36

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270473 Original created: 2026-01-15T23:02:56Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 36 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:01 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270656
Original created: 2026-01-15T23:03:01Z
Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex
Original line: 52

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270656 Original created: 2026-01-15T23:03:01Z Original path: elixir/serviceradar_core/lib/serviceradar/sysmon_profiles/sysmon_profile_seeder.ex Original line: 52 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:09 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270937
Original created: 2026-01-15T23:03:09Z
Original path: elixir/serviceradar_core/lib/serviceradar/repo.ex
Original line: 28

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696270937 Original created: 2026-01-15T23:03:09Z Original path: elixir/serviceradar_core/lib/serviceradar/repo.ex Original line: 28 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:13 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696271196
Original created: 2026-01-15T23:03:13Z
Original path: elixir/serviceradar_core/lib/serviceradar/repo.ex
Original line: 34

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696271196 Original created: 2026-01-15T23:03:13Z Original path: elixir/serviceradar_core/lib/serviceradar/repo.ex Original line: 34 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:18 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696271359
Original created: 2026-01-15T23:03:18Z
Original path: elixir/serviceradar_core/lib/serviceradar/results_router.ex
Original line: 86

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696271359 Original created: 2026-01-15T23:03:18Z Original path: elixir/serviceradar_core/lib/serviceradar/results_router.ex Original line: 86 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:36 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696271959
Original created: 2026-01-15T23:03:36Z
Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex
Original line: 20

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696271959 Original created: 2026-01-15T23:03:36Z Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex Original line: 20 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:42 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272213
Original created: 2026-01-15T23:03:42Z
Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex
Original line: 40

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272213 Original created: 2026-01-15T23:03:42Z Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex Original line: 40 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:49 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272517
Original created: 2026-01-15T23:03:49Z
Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex
Original line: 47

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272517 Original created: 2026-01-15T23:03:49Z Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex Original line: 47 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:52 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272700
Original created: 2026-01-15T23:03:52Z
Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex
Original line: 137

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272700 Original created: 2026-01-15T23:03:52Z Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex Original line: 137 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:03:57 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272878
Original created: 2026-01-15T23:03:57Z
Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex
Original line: 141

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696272878 Original created: 2026-01-15T23:03:57Z Original path: web-ng/lib/serviceradar_web_ng/accounts/scope.ex Original line: 141 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:03 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696273242
Original created: 2026-01-15T23:04:03Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 14

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696273242 Original created: 2026-01-15T23:04:03Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 14 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:10 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696273630
Original created: 2026-01-15T23:04:10Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 55

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696273630 Original created: 2026-01-15T23:04:10Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 55 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:15 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696273843
Original created: 2026-01-15T23:04:15Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 56

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696273843 Original created: 2026-01-15T23:04:15Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 56 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:22 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696274372
Original created: 2026-01-15T23:04:22Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 89

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696274372 Original created: 2026-01-15T23:04:22Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 89 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:29 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696274760
Original created: 2026-01-15T23:04:29Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 258

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696274760 Original created: 2026-01-15T23:04:29Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 258 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:36 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696274967
Original created: 2026-01-15T23:04:36Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 343

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696274967 Original created: 2026-01-15T23:04:36Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 343 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:40 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275146
Original created: 2026-01-15T23:04:40Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 437

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275146 Original created: 2026-01-15T23:04:40Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 437 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:47 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275353
Original created: 2026-01-15T23:04:47Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 443

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275353 Original created: 2026-01-15T23:04:47Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 443 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:52 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275486
Original created: 2026-01-15T23:04:52Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 630

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275486 Original created: 2026-01-15T23:04:52Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 630 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:04:55 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275608
Original created: 2026-01-15T23:04:55Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 634

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275608 Original created: 2026-01-15T23:04:55Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 634 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:00 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275754
Original created: 2026-01-15T23:05:00Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex
Original line: 651

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696275754 Original created: 2026-01-15T23:05:00Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/collector_controller.ex Original line: 651 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:10 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276064
Original created: 2026-01-15T23:05:10Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 14

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276064 Original created: 2026-01-15T23:05:10Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 14 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:16 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276242
Original created: 2026-01-15T23:05:16Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 58

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276242 Original created: 2026-01-15T23:05:16Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 58 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:22 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276468
Original created: 2026-01-15T23:05:22Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 126

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276468 Original created: 2026-01-15T23:05:22Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 126 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:28 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276637
Original created: 2026-01-15T23:05:28Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 150

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276637 Original created: 2026-01-15T23:05:28Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 150 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:33 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276775
Original created: 2026-01-15T23:05:33Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 178

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276775 Original created: 2026-01-15T23:05:33Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 178 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:37 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276909
Original created: 2026-01-15T23:05:37Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 179

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696276909 Original created: 2026-01-15T23:05:37Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 179 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:41 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277039
Original created: 2026-01-15T23:05:41Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 350

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277039 Original created: 2026-01-15T23:05:41Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 350 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:45 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277151
Original created: 2026-01-15T23:05:45Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 354

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277151 Original created: 2026-01-15T23:05:45Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 354 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:48 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277273
Original created: 2026-01-15T23:05:48Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 492

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277273 Original created: 2026-01-15T23:05:48Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 492 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:51 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277378
Original created: 2026-01-15T23:05:51Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 494

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277378 Original created: 2026-01-15T23:05:51Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 494 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:55 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277496
Original created: 2026-01-15T23:05:55Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 497

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277496 Original created: 2026-01-15T23:05:55Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 497 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:05:59 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277595
Original created: 2026-01-15T23:05:59Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 525

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277595 Original created: 2026-01-15T23:05:59Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 525 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:06 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277830
Original created: 2026-01-15T23:06:06Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex
Original line: 548

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277830 Original created: 2026-01-15T23:06:06Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/edge_controller.ex Original line: 548 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:12 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277983
Original created: 2026-01-15T23:06:12Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex
Original line: 21

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696277983 Original created: 2026-01-15T23:06:12Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex Original line: 21 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:17 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278133
Original created: 2026-01-15T23:06:17Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex
Original line: 188

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278133 Original created: 2026-01-15T23:06:17Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex Original line: 188 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:21 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278230
Original created: 2026-01-15T23:06:21Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex
Original line: 194

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278230 Original created: 2026-01-15T23:06:21Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex Original line: 194 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:25 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278347
Original created: 2026-01-15T23:06:25Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex
Original line: 253

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278347 Original created: 2026-01-15T23:06:25Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/api/enroll_controller.ex Original line: 253 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:33 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278625
Original created: 2026-01-15T23:06:33Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/auth_controller.ex
Original line: 50

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278625 Original created: 2026-01-15T23:06:33Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/auth_controller.ex Original line: 50 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:36 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278778
Original created: 2026-01-15T23:06:36Z
Original path: web-ng/lib/serviceradar_web_ng_web/controllers/auth_controller.ex
Original line: 18

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696278778 Original created: 2026-01-15T23:06:36Z Original path: web-ng/lib/serviceradar_web_ng_web/controllers/auth_controller.ex Original line: 18 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:42 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696279142
Original created: 2026-01-15T23:06:42Z
Original path: web-ng/lib/serviceradar_web_ng_web/plugs/api_auth.ex
Original line: 43

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696279142 Original created: 2026-01-15T23:06:42Z Original path: web-ng/lib/serviceradar_web_ng_web/plugs/api_auth.ex Original line: 43 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:47 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696279450
Original created: 2026-01-15T23:06:47Z
Original path: web-ng/lib/serviceradar_web_ng_web/plugs/tenant_context.ex
Original line: 36

more tenant aware stuff that needs to get cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696279450 Original created: 2026-01-15T23:06:47Z Original path: web-ng/lib/serviceradar_web_ng_web/plugs/tenant_context.ex Original line: 36 --- more tenant aware stuff that needs to get cleaned up
mfreeman451 commented 2026-01-15 23:06:56 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696280019
Original created: 2026-01-15T23:06:56Z
Original path: web-ng/lib/serviceradar_web_ng_web/plugs/tenant_context.ex
Original line: 1

this whole file should be removed

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2696280019 Original created: 2026-01-15T23:06:56Z Original path: web-ng/lib/serviceradar_web_ng_web/plugs/tenant_context.ex Original line: 1 --- this whole file should be removed
mfreeman451 commented 2026-01-16 19:50:50 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2699774933
Original created: 2026-01-16T19:50:50Z
Original path: elixir/serviceradar_agent_gateway/config/runtime.exs
Original line: 179

why do we need this anymore

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2699774933 Original created: 2026-01-16T19:50:50Z Original path: elixir/serviceradar_agent_gateway/config/runtime.exs Original line: 179 --- why do we need this anymore
mfreeman451 commented 2026-01-16 19:53:20 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2699780931
Original created: 2026-01-16T19:53:20Z
Original path: elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex
Original line: 961

why are we still using tenantresolver here

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2699780931 Original created: 2026-01-16T19:53:20Z Original path: elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/agent_gateway_server.ex Original line: 961 --- why are we still using tenantresolver here
mfreeman451 commented 2026-01-16 19:54:25 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR review comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2699783383
Original created: 2026-01-16T19:54:25Z
Original path: elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/status_processor.ex
Original line: 145

needs to be cleaned up

Imported GitHub PR review comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/2320#discussion_r2699783383 Original created: 2026-01-16T19:54:25Z Original path: elixir/serviceradar_agent_gateway/lib/serviceradar_agent_gateway/status_processor.ex Original line: 145 --- needs to be cleaned up
qodo-code-review[bot] commented 2026-01-17 06:41:41 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR comment.

Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3762801434
Original created: 2026-01-17T06:41:41Z

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: build

Failed stage: Configure SRQL fixture database for tests []

Failed test name: ""

Failure summary:

The action failed because a required secret/environment variable was not configured:
- The workflow
reported SRQL_TEST_DATABASE_CA_CERT secret must be configured to verify SRQL fixture TLS. and then
exited with code 1.
- The logs show SRQL_TEST_DATABASE_CA_CERT: was empty in the environment, so the
step that validates TLS for the SRQL test/fixture aborted the job.

Relevant error logs:
1:  Runner name: 'arc-runner-set-hk6mk-runner-4tbb4'
2:  Runner group name: 'Default'
...

139:  ^[[36;1mif command -v apt-get >/dev/null 2>&1; then^[[0m
140:  ^[[36;1m  sudo apt-get update^[[0m
141:  ^[[36;1m  sudo apt-get install -y build-essential pkg-config libssl-dev protobuf-compiler cmake flex bison^[[0m
142:  ^[[36;1melif command -v dnf >/dev/null 2>&1; then^[[0m
143:  ^[[36;1m  sudo dnf install -y gcc gcc-c++ make openssl-devel protobuf-compiler cmake flex bison^[[0m
144:  ^[[36;1melif command -v yum >/dev/null 2>&1; then^[[0m
145:  ^[[36;1m  sudo yum install -y gcc gcc-c++ make openssl-devel protobuf-compiler cmake flex bison^[[0m
146:  ^[[36;1melif command -v microdnf >/dev/null 2>&1; then^[[0m
147:  ^[[36;1m  sudo microdnf install -y gcc gcc-c++ make openssl-devel protobuf-compiler cmake flex bison^[[0m
148:  ^[[36;1melse^[[0m
149:  ^[[36;1m  echo "Unsupported package manager; please install gcc, g++ (or clang), make, OpenSSL headers, pkg-config, and protoc manually." >&2^[[0m
150:  ^[[36;1m  exit 1^[[0m
151:  ^[[36;1mfi^[[0m
152:  ^[[36;1m^[[0m
153:  ^[[36;1mensure_pkg_config^[[0m
154:  ^[[36;1mprotoc --version || (echo "protoc installation failed" && exit 1)^[[0m
155:  shell: /usr/bin/bash -e {0}
...

316:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
317:  env:
318:  BUILDBUDDY_ORG_API_KEY: ***
319:  SRQL_TEST_DATABASE_URL: ***
320:  SRQL_TEST_ADMIN_URL: ***
321:  SRQL_TEST_DATABASE_CA_CERT: 
322:  DOCKERHUB_USERNAME: ***
323:  DOCKERHUB_TOKEN: ***
324:  TEST_CNPG_DATABASE: serviceradar_web_ng_test
325:  INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp
326:  INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir
327:  ##[endgroup]
328:  ##[group]Run : install rustup if needed
329:  ^[[36;1m: install rustup if needed^[[0m
330:  ^[[36;1mif ! command -v rustup &>/dev/null; then^[[0m
331:  ^[[36;1m  curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y^[[0m
332:  ^[[36;1m  echo "$CARGO_HOME/bin" >> $GITHUB_PATH^[[0m
...

472:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
473:  env:
474:  BUILDBUDDY_ORG_API_KEY: ***
475:  SRQL_TEST_DATABASE_URL: ***
476:  SRQL_TEST_ADMIN_URL: ***
477:  SRQL_TEST_DATABASE_CA_CERT: 
478:  DOCKERHUB_USERNAME: ***
479:  DOCKERHUB_TOKEN: ***
480:  TEST_CNPG_DATABASE: serviceradar_web_ng_test
481:  INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp
482:  INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir
483:  CARGO_HOME: /home/runner/.cargo
484:  CARGO_INCREMENTAL: 0
485:  CARGO_TERM_COLOR: always
486:  ##[endgroup]
487:  ##[group]Run : work around spurious network errors in curl 8.0
488:  ^[[36;1m: work around spurious network errors in curl 8.0^[[0m
489:  ^[[36;1m# https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation^[[0m
...

540:  SRQL_TEST_DATABASE_CA_CERT: 
541:  DOCKERHUB_USERNAME: ***
542:  DOCKERHUB_TOKEN: ***
543:  TEST_CNPG_DATABASE: serviceradar_web_ng_test
544:  INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp
545:  INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir
546:  CARGO_HOME: /home/runner/.cargo
547:  CARGO_INCREMENTAL: 0
548:  CARGO_TERM_COLOR: always
549:  ##[endgroup]
550:  Attempting to download 1.x...
551:  Acquiring v1.28.0 from https://github.com/bazelbuild/bazelisk/releases/download/v1.28.0/bazelisk-linux-amd64
552:  Adding to the cache ...
553:  Successfully cached bazelisk to /home/runner/_work/_tool/bazelisk/1.28.0/x64
554:  Added bazelisk to the path
555:  ##[warning]Failed to restore: Cache service responded with 400
556:  Restored bazelisk cache dir @ /home/runner/.cache/bazelisk
...

622:  env:
623:  BUILDBUDDY_ORG_API_KEY: ***
624:  SRQL_TEST_DATABASE_URL: ***
625:  SRQL_TEST_ADMIN_URL: ***
626:  SRQL_TEST_DATABASE_CA_CERT: 
627:  DOCKERHUB_USERNAME: ***
628:  DOCKERHUB_TOKEN: ***
629:  TEST_CNPG_DATABASE: serviceradar_web_ng_test
630:  INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp
631:  INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir
632:  CARGO_HOME: /home/runner/.cargo
633:  CARGO_INCREMENTAL: 0
634:  CARGO_TERM_COLOR: always
635:  ##[endgroup]
636:  SRQL_TEST_DATABASE_CA_CERT secret must be configured to verify SRQL fixture TLS.
637:  ##[error]Process completed with exit code 1.
638:  Post job cleanup.

Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3762801434 Original created: 2026-01-17T06:41:41Z --- ## CI Feedback 🧐 A test triggered by this PR failed. Here is an AI-generated analysis of the failure: <table><tr><td> **Action:** build</td></tr> <tr><td> **Failed stage:** [Configure SRQL fixture database for tests](https://github.com/carverauto/serviceradar/actions/runs/21090128994/job/60660141513) [❌] </td></tr> <tr><td> **Failed test name:** "" </td></tr> <tr><td> **Failure summary:** The action failed because a required secret/environment variable was not configured:<br> - The workflow <br>reported <code>SRQL_TEST_DATABASE_CA_CERT secret must be configured to verify SRQL fixture TLS.</code> and then <br>exited with code 1.<br> - The logs show <code>SRQL_TEST_DATABASE_CA_CERT:</code> was empty in the environment, so the <br>step that validates TLS for the SRQL test/fixture aborted the job.<br> </td></tr> <tr><td> <details><summary>Relevant error logs:</summary> ```yaml 1: Runner name: 'arc-runner-set-hk6mk-runner-4tbb4' 2: Runner group name: 'Default' ... 139: ^[[36;1mif command -v apt-get >/dev/null 2>&1; then^[[0m 140: ^[[36;1m sudo apt-get update^[[0m 141: ^[[36;1m sudo apt-get install -y build-essential pkg-config libssl-dev protobuf-compiler cmake flex bison^[[0m 142: ^[[36;1melif command -v dnf >/dev/null 2>&1; then^[[0m 143: ^[[36;1m sudo dnf install -y gcc gcc-c++ make openssl-devel protobuf-compiler cmake flex bison^[[0m 144: ^[[36;1melif command -v yum >/dev/null 2>&1; then^[[0m 145: ^[[36;1m sudo yum install -y gcc gcc-c++ make openssl-devel protobuf-compiler cmake flex bison^[[0m 146: ^[[36;1melif command -v microdnf >/dev/null 2>&1; then^[[0m 147: ^[[36;1m sudo microdnf install -y gcc gcc-c++ make openssl-devel protobuf-compiler cmake flex bison^[[0m 148: ^[[36;1melse^[[0m 149: ^[[36;1m echo "Unsupported package manager; please install gcc, g++ (or clang), make, OpenSSL headers, pkg-config, and protoc manually." >&2^[[0m 150: ^[[36;1m exit 1^[[0m 151: ^[[36;1mfi^[[0m 152: ^[[36;1m^[[0m 153: ^[[36;1mensure_pkg_config^[[0m 154: ^[[36;1mprotoc --version || (echo "protoc installation failed" && exit 1)^[[0m 155: shell: /usr/bin/bash -e {0} ... 316: shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} 317: env: 318: BUILDBUDDY_ORG_API_KEY: *** 319: SRQL_TEST_DATABASE_URL: *** 320: SRQL_TEST_ADMIN_URL: *** 321: SRQL_TEST_DATABASE_CA_CERT: 322: DOCKERHUB_USERNAME: *** 323: DOCKERHUB_TOKEN: *** 324: TEST_CNPG_DATABASE: serviceradar_web_ng_test 325: INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp 326: INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir 327: ##[endgroup] 328: ##[group]Run : install rustup if needed 329: ^[[36;1m: install rustup if needed^[[0m 330: ^[[36;1mif ! command -v rustup &>/dev/null; then^[[0m 331: ^[[36;1m curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y^[[0m 332: ^[[36;1m echo "$CARGO_HOME/bin" >> $GITHUB_PATH^[[0m ... 472: shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} 473: env: 474: BUILDBUDDY_ORG_API_KEY: *** 475: SRQL_TEST_DATABASE_URL: *** 476: SRQL_TEST_ADMIN_URL: *** 477: SRQL_TEST_DATABASE_CA_CERT: 478: DOCKERHUB_USERNAME: *** 479: DOCKERHUB_TOKEN: *** 480: TEST_CNPG_DATABASE: serviceradar_web_ng_test 481: INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp 482: INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir 483: CARGO_HOME: /home/runner/.cargo 484: CARGO_INCREMENTAL: 0 485: CARGO_TERM_COLOR: always 486: ##[endgroup] 487: ##[group]Run : work around spurious network errors in curl 8.0 488: ^[[36;1m: work around spurious network errors in curl 8.0^[[0m 489: ^[[36;1m# https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation^[[0m ... 540: SRQL_TEST_DATABASE_CA_CERT: 541: DOCKERHUB_USERNAME: *** 542: DOCKERHUB_TOKEN: *** 543: TEST_CNPG_DATABASE: serviceradar_web_ng_test 544: INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp 545: INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir 546: CARGO_HOME: /home/runner/.cargo 547: CARGO_INCREMENTAL: 0 548: CARGO_TERM_COLOR: always 549: ##[endgroup] 550: Attempting to download 1.x... 551: Acquiring v1.28.0 from https://github.com/bazelbuild/bazelisk/releases/download/v1.28.0/bazelisk-linux-amd64 552: Adding to the cache ... 553: Successfully cached bazelisk to /home/runner/_work/_tool/bazelisk/1.28.0/x64 554: Added bazelisk to the path 555: ##[warning]Failed to restore: Cache service responded with 400 556: Restored bazelisk cache dir @ /home/runner/.cache/bazelisk ... 622: env: 623: BUILDBUDDY_ORG_API_KEY: *** 624: SRQL_TEST_DATABASE_URL: *** 625: SRQL_TEST_ADMIN_URL: *** 626: SRQL_TEST_DATABASE_CA_CERT: 627: DOCKERHUB_USERNAME: *** 628: DOCKERHUB_TOKEN: *** 629: TEST_CNPG_DATABASE: serviceradar_web_ng_test 630: INSTALL_DIR_FOR_OTP: /home/runner/_work/_temp/.setup-beam/otp 631: INSTALL_DIR_FOR_ELIXIR: /home/runner/_work/_temp/.setup-beam/elixir 632: CARGO_HOME: /home/runner/.cargo 633: CARGO_INCREMENTAL: 0 634: CARGO_TERM_COLOR: always 635: ##[endgroup] 636: SRQL_TEST_DATABASE_CA_CERT secret must be configured to verify SRQL fixture TLS. 637: ##[error]Process completed with exit code 1. 638: Post job cleanup. ``` </details></td></tr></table>
qodo-code-review[bot] commented 2026-01-17 06:41:41 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR comment.

Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3762801436
Original created: 2026-01-17T06:41:41Z

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: test-go

Failed stage: Run Go Tests []

Failed test name: ""

Failure summary:

The action failed during go test because the build did not compile:
- Compilation error in vendored
dependency golang.org/x/crypto/chacha20poly1305:
-
vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go:41:5: undefined: fips140Enforced
-
vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go:25:5: undefined: fips140Enforced
-
As a result, the package github.com/carverauto/serviceradar/pkg/datasvc failed with [build failed],
causing go test to exit with code 1.

Relevant error logs:
1:  Runner name: 'arc-runner-set-hk6mk-runner-4blrl'
2:  Runner group name: 'Default'
...

160:  GOTOOLDIR='/home/runner/_work/_tool/go/1.25.0/x64/pkg/tool/linux_amd64'
161:  GOVCS=''
162:  GOVERSION='go1.25.0'
163:  GOWORK=''
164:  PKG_CONFIG='pkg-config'
165:  ##[endgroup]
166:  ##[group]Run go test -timeout=3s -race -count=10 -failfast -shuffle=on -short ./... -coverprofile=./cover.short.profile -covermode=atomic -coverpkg=./...
167:  ^[[36;1mgo test -timeout=3s -race -count=10 -failfast -shuffle=on -short ./... -coverprofile=./cover.short.profile -covermode=atomic -coverpkg=./...^[[0m
168:  ^[[36;1mgo test -timeout=10s -race -count=1 -failfast -shuffle=on ./... -coverprofile=./cover.long.profile -covermode=atomic -coverpkg=./...^[[0m
169:  shell: /usr/bin/bash -e {0}
170:  env:
171:  GOTOOLCHAIN: local
172:  GOFLAGS: -tags=ci
173:  ##[endgroup]
174:  # golang.org/x/crypto/chacha20poly1305
175:  ##[error]vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go:41:5: undefined: fips140Enforced
176:  ##[error]vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go:25:5: undefined: fips140Enforced
177:  github.com/carverauto/serviceradar/cmd/agent		coverage: 0.0% of statements
...

190:  ok  	github.com/carverauto/serviceradar/pkg/agent	4.110s	coverage: 3.5% of statements in ./...
191:  github.com/carverauto/serviceradar/pkg/agentgateway		coverage: 0.0% of statements
192:  github.com/carverauto/serviceradar/pkg/checker		coverage: 0.0% of statements
193:  github.com/carverauto/serviceradar/pkg/checker/dusk		coverage: 0.0% of statements
194:  ok  	github.com/carverauto/serviceradar/pkg/checker/snmp	1.812s	coverage: 0.8% of statements in ./...
195:  github.com/carverauto/serviceradar/pkg/cli		coverage: 0.0% of statements
196:  ok  	github.com/carverauto/serviceradar/pkg/config	2.961s	coverage: 1.9% of statements in ./...
197:  github.com/carverauto/serviceradar/pkg/config/bootstrap		coverage: 0.0% of statements
198:  ?   	github.com/carverauto/serviceradar/pkg/config/kv	[no test files]
199:  github.com/carverauto/serviceradar/pkg/config/kvgrpc		coverage: 0.0% of statements
200:  github.com/carverauto/serviceradar/pkg/config/kvnats		coverage: 0.0% of statements
201:  ok  	github.com/carverauto/serviceradar/pkg/consumers/db-event-writer	1.689s	coverage: 0.7% of statements in ./...
202:  github.com/carverauto/serviceradar/pkg/consumers/netflow		coverage: 0.0% of statements
203:  ok  	github.com/carverauto/serviceradar/pkg/cpufreq	1.480s	coverage: 0.1% of statements in ./...
204:  github.com/carverauto/serviceradar/pkg/crypto/secrets		coverage: 0.0% of statements
205:  FAIL	github.com/carverauto/serviceradar/pkg/datasvc [build failed]
206:  ok  	github.com/carverauto/serviceradar/pkg/db	1.875s	coverage: 1.3% of statements in ./...
...

229:  github.com/carverauto/serviceradar/pkg/swagger		coverage: 0.0% of statements
230:  ok  	github.com/carverauto/serviceradar/pkg/sweeper	1.535s	coverage: 2.6% of statements in ./...
231:  ok  	github.com/carverauto/serviceradar/pkg/sync	1.891s	coverage: 1.6% of statements in ./...
232:  ok  	github.com/carverauto/serviceradar/pkg/sync/integrations/armis	1.610s	coverage: 1.3% of statements in ./...
233:  ok  	github.com/carverauto/serviceradar/pkg/sync/integrations/netbox	1.534s	coverage: 0.4% of statements in ./...
234:  ok  	github.com/carverauto/serviceradar/pkg/sysmon	1.292s	coverage: 0.4% of statements in ./...
235:  github.com/carverauto/serviceradar/pkg/version		coverage: 0.0% of statements
236:  github.com/carverauto/serviceradar/proto		coverage: 0.0% of statements
237:  github.com/carverauto/serviceradar/proto/discovery		coverage: 0.0% of statements
238:  github.com/carverauto/serviceradar/proto/flow		coverage: 0.0% of statements
239:  github.com/carverauto/serviceradar/proto/identitymap/v1		coverage: 0.0% of statements
240:  github.com/carverauto/serviceradar/proto/rperf		coverage: 0.0% of statements
241:  github.com/carverauto/serviceradar/release		coverage: 0.0% of statements
242:  ok  	github.com/carverauto/serviceradar/tests/kvseeding	1.270s	coverage: 0.1% of statements in ./...
243:  FAIL
244:  ##[error]Process completed with exit code 1.
245:  Post job cleanup.

Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/2320#issuecomment-3762801436 Original created: 2026-01-17T06:41:41Z --- ## CI Feedback 🧐 A test triggered by this PR failed. Here is an AI-generated analysis of the failure: <table><tr><td> **Action:** test-go</td></tr> <tr><td> **Failed stage:** [Run Go Tests](https://github.com/carverauto/serviceradar/actions/runs/21090128046/job/60660139689) [❌] </td></tr> <tr><td> **Failed test name:** "" </td></tr> <tr><td> **Failure summary:** The action failed during <code>go test</code> because the build did not compile:<br> - Compilation error in vendored <br>dependency <code>golang.org/x/crypto/chacha20poly1305</code>:<br> - <br><code>vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go:41:5: undefined: fips140Enforced</code><br> - <br><code>vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go:25:5: undefined: fips140Enforced</code><br> - <br>As a result, the package <code>github.com/carverauto/serviceradar/pkg/datasvc</code> failed with <code>[build failed]</code>, <br>causing <code>go test</code> to exit with code 1.<br> </td></tr> <tr><td> <details><summary>Relevant error logs:</summary> ```yaml 1: Runner name: 'arc-runner-set-hk6mk-runner-4blrl' 2: Runner group name: 'Default' ... 160: GOTOOLDIR='/home/runner/_work/_tool/go/1.25.0/x64/pkg/tool/linux_amd64' 161: GOVCS='' 162: GOVERSION='go1.25.0' 163: GOWORK='' 164: PKG_CONFIG='pkg-config' 165: ##[endgroup] 166: ##[group]Run go test -timeout=3s -race -count=10 -failfast -shuffle=on -short ./... -coverprofile=./cover.short.profile -covermode=atomic -coverpkg=./... 167: ^[[36;1mgo test -timeout=3s -race -count=10 -failfast -shuffle=on -short ./... -coverprofile=./cover.short.profile -covermode=atomic -coverpkg=./...^[[0m 168: ^[[36;1mgo test -timeout=10s -race -count=1 -failfast -shuffle=on ./... -coverprofile=./cover.long.profile -covermode=atomic -coverpkg=./...^[[0m 169: shell: /usr/bin/bash -e {0} 170: env: 171: GOTOOLCHAIN: local 172: GOFLAGS: -tags=ci 173: ##[endgroup] 174: # golang.org/x/crypto/chacha20poly1305 175: ##[error]vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go:41:5: undefined: fips140Enforced 176: ##[error]vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go:25:5: undefined: fips140Enforced 177: github.com/carverauto/serviceradar/cmd/agent coverage: 0.0% of statements ... 190: ok github.com/carverauto/serviceradar/pkg/agent 4.110s coverage: 3.5% of statements in ./... 191: github.com/carverauto/serviceradar/pkg/agentgateway coverage: 0.0% of statements 192: github.com/carverauto/serviceradar/pkg/checker coverage: 0.0% of statements 193: github.com/carverauto/serviceradar/pkg/checker/dusk coverage: 0.0% of statements 194: ok github.com/carverauto/serviceradar/pkg/checker/snmp 1.812s coverage: 0.8% of statements in ./... 195: github.com/carverauto/serviceradar/pkg/cli coverage: 0.0% of statements 196: ok github.com/carverauto/serviceradar/pkg/config 2.961s coverage: 1.9% of statements in ./... 197: github.com/carverauto/serviceradar/pkg/config/bootstrap coverage: 0.0% of statements 198: ? github.com/carverauto/serviceradar/pkg/config/kv [no test files] 199: github.com/carverauto/serviceradar/pkg/config/kvgrpc coverage: 0.0% of statements 200: github.com/carverauto/serviceradar/pkg/config/kvnats coverage: 0.0% of statements 201: ok github.com/carverauto/serviceradar/pkg/consumers/db-event-writer 1.689s coverage: 0.7% of statements in ./... 202: github.com/carverauto/serviceradar/pkg/consumers/netflow coverage: 0.0% of statements 203: ok github.com/carverauto/serviceradar/pkg/cpufreq 1.480s coverage: 0.1% of statements in ./... 204: github.com/carverauto/serviceradar/pkg/crypto/secrets coverage: 0.0% of statements 205: FAIL github.com/carverauto/serviceradar/pkg/datasvc [build failed] 206: ok github.com/carverauto/serviceradar/pkg/db 1.875s coverage: 1.3% of statements in ./... ... 229: github.com/carverauto/serviceradar/pkg/swagger coverage: 0.0% of statements 230: ok github.com/carverauto/serviceradar/pkg/sweeper 1.535s coverage: 2.6% of statements in ./... 231: ok github.com/carverauto/serviceradar/pkg/sync 1.891s coverage: 1.6% of statements in ./... 232: ok github.com/carverauto/serviceradar/pkg/sync/integrations/armis 1.610s coverage: 1.3% of statements in ./... 233: ok github.com/carverauto/serviceradar/pkg/sync/integrations/netbox 1.534s coverage: 0.4% of statements in ./... 234: ok github.com/carverauto/serviceradar/pkg/sysmon 1.292s coverage: 0.4% of statements in ./... 235: github.com/carverauto/serviceradar/pkg/version coverage: 0.0% of statements 236: github.com/carverauto/serviceradar/proto coverage: 0.0% of statements 237: github.com/carverauto/serviceradar/proto/discovery coverage: 0.0% of statements 238: github.com/carverauto/serviceradar/proto/flow coverage: 0.0% of statements 239: github.com/carverauto/serviceradar/proto/identitymap/v1 coverage: 0.0% of statements 240: github.com/carverauto/serviceradar/proto/rperf coverage: 0.0% of statements 241: github.com/carverauto/serviceradar/release coverage: 0.0% of statements 242: ok github.com/carverauto/serviceradar/tests/kvseeding 1.270s coverage: 0.1% of statements in ./... 243: FAIL 244: ##[error]Process completed with exit code 1. 245: Post job cleanup. ``` </details></td></tr></table>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar!2681
No description provided.