Skip to content

Default enable telemetry with default settings#567

Closed
kaixi-wang wants to merge 26 commits into
mainfrom
kacey/sidecar-default-enable
Closed

Default enable telemetry with default settings#567
kaixi-wang wants to merge 26 commits into
mainfrom
kacey/sidecar-default-enable

Conversation

@kaixi-wang

@kaixi-wang kaixi-wang commented May 19, 2026

Copy link
Copy Markdown
Member

Rationale

Testing ability to set default configs so that it just works without additional helm chart mods

Review Priority

  • high
  • medium
  • low

Changes

Checklist

  • This PR maintains parity between Docker Compose and Helm

Testing

@kaixi-wang kaixi-wang requested a review from a team as a code owner May 19, 2026 18:58
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4be5a2f8-290f-47e6-b232-45e2bfe76f0c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR introduces telemetry infrastructure for FiftyOne Teams App deployments across Docker Compose and Kubernetes platforms. It adds a bundled Redis-backed telemetry system with per-service sidecars for metrics collection, comprehensive documentation, Helm templating, and extensive test coverage.

Changes

Docker Compose Telemetry Support

Layer / File(s) Summary
Documentation and environment templates
docker/README.md, docker/docs/configuring-telemetry.md, docker/internal-auth/env.template, docker/legacy-auth/env.template
Introduces telemetry concepts, bundled Redis and sidecars, opt-out mechanisms via service scaling, operational constraints for delegated operators, environment variable overrides, access control, and verification steps. Adds optional telemetry configuration blocks to both internal and legacy auth environment templates.
Docker Compose test coverage
tests/unit/compose/docker-compose-internal-auth_test.go, tests/unit/compose/docker-compose-legacy-auth_test.go
Extends test suites to cover GPU delegated operations, telemetry service discovery via compose profiles, Redis and sidecar image assertions, telemetry environment variables across services, and telemetry-socket volume configuration for delegated operators.

Kubernetes and Helm Telemetry Integration

Layer / File(s) Summary
Helm telemetry template helpers
helm/fiftyone-teams-app/templates/_telemetry.tpl
Defines reusable Helm helpers for Redis naming/labeling, RBAC Role/RoleBinding generation with conditional service account binding, sidecar environment variables (Pod identity, service/target names, MongoDB/Redis credentials), two sidecar variants (standard extra container and native initContainer with restart policy and readiness probe), and shared socket volume/mount helpers.
Main service telemetry integration
helm/fiftyone-teams-app/templates/_helpers.tpl, helm/fiftyone-teams-app/templates/_do_targets.tpl
Integrates telemetry Redis URL environment variables into delegated-operator, teams-api, fiftyone-app, teams-plugins, and main teams-app template lists via conditional includes when telemetry is enabled.
Helm documentation and Kubernetes setup
helm/fiftyone-teams-app/README.md, helm/fiftyone-teams-app/README.md.gotmpl, docs/orchestrators/configuring-kubernetes-orchestrator.md
Documents sidecar configuration options (extraContainers, nativeSidecarContainers), telemetry values (enablement, Redis image/resources/PVC, service account behavior), and Kubernetes orchestrator setup with telemetry sidecar examples using native initContainers and process namespace sharing.
Test infrastructure and helpers
tests/unit/helm/yaml_helpers.go, tests/unit/helm/common_test.go, utils/validate-docker-pulls.sh
Adds YAML parsing and telemetry-disabling test helpers; updates build tags for telemetry test coverage; extends expected Docker images to include redis:7-alpine.
Telemetry Redis and RoleBinding test suites
tests/unit/helm/telemetry-redis_test.go, tests/unit/helm/telemetry-rolebinding_test.go
Adds new test suites validating telemetry-redis Helm template rendering (Deployment/Service/PVC presence, metadata, image configuration, Redis args) and telemetry-rolebinding template rendering (Role/RoleBinding RBAC rules, default/custom subject binding, role references).
Existing service test updates
tests/unit/helm/api-deployment_test.go, tests/unit/helm/api-role_test.go, tests/unit/helm/app-deployment_test.go, tests/unit/helm/delegated-operator-instance-deployment_test.go, tests/unit/helm/delegated-operator-job-configmap_test.go, tests/unit/helm/plugins-deployment_test.go, tests/unit/helm/teams-app-deployment_test.go
Wraps Helm rendering values with telemetry-disabling helpers across deployment tests to maintain baseline expectations. Updates api-role expectations to include pods/log RBAC rule. Adds telemetry auto-injection test for delegated-operator job ConfigMap native sidecars.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🐰 Telemetry wires through the warren,
Redis hops where metrics are barren,
Sidecars dance in pod-shared space,
Helm templates embrace, Docker's pace,
Tests ensure no metrics miscarry! 📊✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description lacks critical details. It provides no specific information about changes, only mentions testing default configs and includes incomplete template sections. Add a detailed description of changes (what is being default-enabled, affected components). Specify how testing was performed and whether Docker Compose/Helm parity was verified. Check the priority checkbox and fill testing section.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates the main change: enabling telemetry by default with standard configuration settings across the deployment infrastructure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kacey/sidecar-default-enable

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (5)
tests/unit/helm/delegated-operator-instance-deployment_test.go (1)

361-373: ⚡ Quick win

Remove duplicate options redeclarations in the same subtest.

Line 373 and Line 3132 redeclare options with the same value already initialized earlier in the same closure. Reuse the existing variable to avoid shadowing and keep setup single-source.

♻️ Proposed cleanup
-			options := &helm.Options{SetValues: disableTelemetry(testCase.values)}
+			options := &helm.Options{SetValues: disableTelemetry(testCase.values)}

 			if testCase.expected == nil {
 				output, err := helm.RenderTemplateE(subT, options, s.chartPath, s.releaseName, s.templates)
@@
 			} else {
-				options := &helm.Options{SetValues: disableTelemetry(testCase.values)}
-
 				output := helm.RenderTemplate(subT, options, s.chartPath, s.releaseName, s.templates)
-			options := &helm.Options{SetValues: disableTelemetry(testCase.values)}
+			options := &helm.Options{SetValues: disableTelemetry(testCase.values)}
 			if testCase.values == nil {
-				options := &helm.Options{SetValues: disableTelemetry(testCase.values)}
 				output, err := helm.RenderTemplateE(subT, options, s.chartPath, s.releaseName, s.templates)

Also applies to: 3130-3133

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/helm/delegated-operator-instance-deployment_test.go` around lines
361 - 373, The test contains duplicate redeclarations of the options variable
(helm.Options with SetValues: disableTelemetry(testCase.values)) inside the same
subtest closure; remove the second "options :=" shadowing and reuse the
already-initialized options so there's only one declaration per subtest (refer
to the options variable, helm.Options type, and
disableTelemetry(testCase.values) call in the
delegated-operator-instance-deployment_test.go subtest), ensuring subsequent
uses just reference options instead of redeclaring it.
tests/unit/helm/teams-app-deployment_test.go (1)

100-2603: ⚡ Quick win

Preserve a true default telemetry-on test path in this file.

At Line 100 and throughout, forcing disableTelemetry(...) across all subtests means the suite no longer checks the chart’s default telemetry-enabled behavior. Consider adding a small set of explicit default/on-path tests alongside these disabled-baseline assertions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/helm/teams-app-deployment_test.go` around lines 100 - 2603, The
tests currently force telemetry off by calling disableTelemetry(...) for every
subtest (see the usage in options := &helm.Options{SetValues:
disableTelemetry(testCase.values)} across TestMetadataName, TestReplicas,
TestContainerEnv, etc.), which removes coverage of the chart's default
telemetry-enabled path; add explicit subtests that do not wrap values with
disableTelemetry (i.e., pass testCase.values directly or nil to helm.Options) to
assert the default telemetry-on behavior, or only call disableTelemetry for the
specific override cases where telemetry must be disabled, updating each test
table or the options construction in functions like TestContainerEnv,
TestMetadataName, TestTemplateLabels, etc., so at least one case per Test*
retains the unmodified/default values path.
tests/unit/helm/plugins-deployment_test.go (1)

105-3004: ⚡ Quick win

Add at least one telemetry-enabled assertion path in this suite.

From Line 105 onward, all renders are forced through disableTelemetry(...), so even “defaultValues” cases no longer validate default telemetry-on behavior. Keep these disabled-baseline tests, but add explicit telemetry-enabled cases (or a non-wrapped render path) for key assertions like container composition to preserve default-path coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/helm/plugins-deployment_test.go` around lines 105 - 3004, The
suite always wraps SetValues with disableTelemetry(...) so no test exercises the
telemetry-enabled default path; add explicit telemetry-enabled assertions by
either adding new test cases or an alternate render path that does not call
disableTelemetry (e.g., call helm.RenderTemplate / helm.RenderTemplateE with
options built from testCase.values directly) in key tests such as
TestContainerCount, TestContainerEnv, TestContainerImage (and any other
container/composition tests) so you validate both telemetry-disabled and default
telemetry-enabled behavior; ensure new cases use the same matching expectations
but with telemetry left enabled.
tests/unit/compose/docker-compose-internal-auth_test.go (1)

131-151: ⚡ Quick win

Add explicit image/environment assertions for GPU telemetry services.

This new GPU scenario validates service presence, but it doesn’t assert runtime contract fields (image/env) for teams-do-gpu and teams-do-gpu-telemetry. Adding those checks will harden regression coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/compose/docker-compose-internal-auth_test.go` around lines 131 -
151, In the "composeDelegatedOperationsGpu" test case in
tests/unit/compose/docker-compose-internal-auth_test.go, add explicit runtime
contract assertions for the services "teams-do-gpu" and
"teams-do-gpu-telemetry": check their runtimeContract.Image fields and check
required environment variables exist (runtimeContract.Env contains expected
keys/values), following the same assertion pattern used for other services in
this file (e.g., the existing checks for "teams-do" or telemetry services) so
the GPU scenario validates both presence and image/env runtime contract fields.
tests/unit/compose/docker-compose-legacy-auth_test.go (1)

131-151: ⚡ Quick win

Consider asserting GPU telemetry service image/environment contracts too.

Like internal-auth, this adds GPU service-name checks but not explicit image/env assertions for teams-do-gpu and teams-do-gpu-telemetry. Adding them would improve parity and catch config regressions earlier.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/compose/docker-compose-legacy-auth_test.go` around lines 131 -
151, The test currently verifies service names for the GPU compose set (using
legacyAuthComposeDelegatedOperationsGpuFile and service list containing
"teams-do-gpu" and "teams-do-gpu-telemetry") but does not assert their image and
environment variable contracts; update the test to mirror the internal-auth
assertions by adding explicit checks for the Docker image and required env
keys/values for "teams-do-gpu" and "teams-do-gpu-telemetry" (use the same
assertion helpers or patterns used for internal-auth checks in this test file),
ensuring the expected image strings and critical env vars are validated against
the parsed compose data (referencing the service names "teams-do-gpu" and
"teams-do-gpu-telemetry" to locate where to add these assertions).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docker/internal-auth/env.template`:
- Around line 102-106: Update the telemetry comment to reflect the new
default-enabled behavior: remove or reword the assertion that telemetry is
"optional; requires compose.telemetry.yaml" and instead state that telemetry is
enabled by default and that FIFTYONE_TELEMETRY_REDIS_URL can be used to override
the in-stack Redis (still mentioning compose.telemetry.yaml only as an optional
overlay to customize stack telemetry). Edit the block referencing
FIFTYONE_TELEMETRY_REDIS_URL so it accurately documents the new default and how
to override it.

In `@docker/legacy-auth/env.template`:
- Around line 107-111: The telemetry comment in docker/legacy-auth/env.template
is outdated: it still references an optional compose.telemetry.yaml overlay even
though telemetry is now bundled and default-enabled. Update the block that
mentions FIFTYONE_TELEMETRY_REDIS_URL to remove references to
compose.telemetry.yaml and instead state that telemetry is
bundled/default-enabled and will use the in-stack Redis
(redis://telemetry-redis:6379) when left blank; keep the example variable name
FIFTYONE_TELEMETRY_REDIS_URL and clarify that overriding it will point telemetry
sidecars and teams services to a custom Redis URL.

In `@docs/orchestrators/configuring-kubernetes-orchestrator.md`:
- Around line 510-512: Replace the hardcoded telemetry Redis DNS in the example
env var FIFTYONE_TELEMETRY_REDIS_URL (and the other occurrence) with a clear
placeholder such as <release>-telemetry-redis.<namespace>.svc.cluster.local and
add a short note that users must substitute their actual Helm release name and
namespace; update the example values where FIFTYONE_TELEMETRY_REDIS_URL is shown
and mirror the same change for the second occurrence mentioned so the
Helm-scoped service name won’t break when copied.

In `@helm/fiftyone-teams-app/templates/_telemetry.tpl`:
- Around line 113-114: The Helm template defaults currently use
voxel51/telemetry-sidecar:latest which makes deployments non-reproducible;
change the default for .ctx.Values.telemetry.sidecar.image to a specific
immutable tag or digest (for example voxel51/telemetry-sidecar:v1.2.3 or
voxel51/telemetry-sidecar@sha256:...) and do the same for the native-sidecar
image (.ctx.Values.telemetry.nativeSidecar.image), and ensure the corresponding
imagePullPolicy (.ctx.Values.telemetry.sidecar.imagePullPolicy and native
variant) is set consistently (e.g., IfNotPresent for tagged images or Always may
be kept for digests) so the sidecar image is pinned and pulls are deterministic.

In `@tests/unit/helm/delegated-operator-job-configmap_test.go`:
- Around line 713-714: Guard direct indexing into InitContainers by asserting
its length before access: add a
s.Require().Len(job.Spec.Template.Spec.InitContainers, 1) (or
s.Require().True(len(job.Spec.Template.Spec.InitContainers) > 0)) immediately
before the line that reads job.Spec.Template.Spec.InitContainers[0] in the test
so the failure is descriptive; apply the same pattern for the other occurrence
around the lines that reference InitContainers[0] (the assertions that check
TARGET_CONTAINER/custom-executor).

In `@utils/validate-docker-pulls.sh`:
- Around line 17-20: The EXPECTED_IMAGES array normalization currently appends
:${appVersion} to every voxel51/* entry which overwrites explicitly tagged
internal images like voxel51/telemetry-sidecar:latest; update the normalization
loop that processes EXPECTED_IMAGES so it checks each image string for an
existing tag (presence of ':' after the repository/name) and only appends
:${appVersion} when no tag is present (leave entries that already contain a tag
untouched). Locate the normalization logic that references EXPECTED_IMAGES and
the code block handling voxel51/* and change it to perform a conditional append
based on whether the image string already contains a tag.

---

Nitpick comments:
In `@tests/unit/compose/docker-compose-internal-auth_test.go`:
- Around line 131-151: In the "composeDelegatedOperationsGpu" test case in
tests/unit/compose/docker-compose-internal-auth_test.go, add explicit runtime
contract assertions for the services "teams-do-gpu" and
"teams-do-gpu-telemetry": check their runtimeContract.Image fields and check
required environment variables exist (runtimeContract.Env contains expected
keys/values), following the same assertion pattern used for other services in
this file (e.g., the existing checks for "teams-do" or telemetry services) so
the GPU scenario validates both presence and image/env runtime contract fields.

In `@tests/unit/compose/docker-compose-legacy-auth_test.go`:
- Around line 131-151: The test currently verifies service names for the GPU
compose set (using legacyAuthComposeDelegatedOperationsGpuFile and service list
containing "teams-do-gpu" and "teams-do-gpu-telemetry") but does not assert
their image and environment variable contracts; update the test to mirror the
internal-auth assertions by adding explicit checks for the Docker image and
required env keys/values for "teams-do-gpu" and "teams-do-gpu-telemetry" (use
the same assertion helpers or patterns used for internal-auth checks in this
test file), ensuring the expected image strings and critical env vars are
validated against the parsed compose data (referencing the service names
"teams-do-gpu" and "teams-do-gpu-telemetry" to locate where to add these
assertions).

In `@tests/unit/helm/delegated-operator-instance-deployment_test.go`:
- Around line 361-373: The test contains duplicate redeclarations of the options
variable (helm.Options with SetValues: disableTelemetry(testCase.values)) inside
the same subtest closure; remove the second "options :=" shadowing and reuse the
already-initialized options so there's only one declaration per subtest (refer
to the options variable, helm.Options type, and
disableTelemetry(testCase.values) call in the
delegated-operator-instance-deployment_test.go subtest), ensuring subsequent
uses just reference options instead of redeclaring it.

In `@tests/unit/helm/plugins-deployment_test.go`:
- Around line 105-3004: The suite always wraps SetValues with
disableTelemetry(...) so no test exercises the telemetry-enabled default path;
add explicit telemetry-enabled assertions by either adding new test cases or an
alternate render path that does not call disableTelemetry (e.g., call
helm.RenderTemplate / helm.RenderTemplateE with options built from
testCase.values directly) in key tests such as TestContainerCount,
TestContainerEnv, TestContainerImage (and any other container/composition tests)
so you validate both telemetry-disabled and default telemetry-enabled behavior;
ensure new cases use the same matching expectations but with telemetry left
enabled.

In `@tests/unit/helm/teams-app-deployment_test.go`:
- Around line 100-2603: The tests currently force telemetry off by calling
disableTelemetry(...) for every subtest (see the usage in options :=
&helm.Options{SetValues: disableTelemetry(testCase.values)} across
TestMetadataName, TestReplicas, TestContainerEnv, etc.), which removes coverage
of the chart's default telemetry-enabled path; add explicit subtests that do not
wrap values with disableTelemetry (i.e., pass testCase.values directly or nil to
helm.Options) to assert the default telemetry-on behavior, or only call
disableTelemetry for the specific override cases where telemetry must be
disabled, updating each test table or the options construction in functions like
TestContainerEnv, TestMetadataName, TestTemplateLabels, etc., so at least one
case per Test* retains the unmodified/default values path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 99f93060-1e72-4cc3-ba40-efe17b79d169

📥 Commits

Reviewing files that changed from the base of the PR and between 816edea and 9148867.

⛔ Files ignored due to path filters (22)
  • docker/common-services.yaml is excluded by !**/*.yaml
  • docker/internal-auth/compose.dedicated-plugins.yaml is excluded by !**/*.yaml
  • docker/internal-auth/compose.delegated-operators.gpu.yaml is excluded by !**/*.yaml
  • docker/internal-auth/compose.delegated-operators.yaml is excluded by !**/*.yaml
  • docker/internal-auth/compose.plugins.yaml is excluded by !**/*.yaml
  • docker/internal-auth/compose.yaml is excluded by !**/*.yaml
  • docker/legacy-auth/compose.dedicated-plugins.yaml is excluded by !**/*.yaml
  • docker/legacy-auth/compose.delegated-operators.gpu.yaml is excluded by !**/*.yaml
  • docker/legacy-auth/compose.delegated-operators.yaml is excluded by !**/*.yaml
  • docker/legacy-auth/compose.plugins.yaml is excluded by !**/*.yaml
  • docker/legacy-auth/compose.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/api-deployment.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/api-role.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/app-deployment.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/delegated-operator-instance-deployment.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/delegated-operator-job-configmap.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/plugins-deployment.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/telemetry-redis.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/templates/telemetry-rolebinding.yaml is excluded by !**/*.yaml
  • helm/fiftyone-teams-app/values.schema.json is excluded by !**/*.json
  • helm/fiftyone-teams-app/values.yaml is excluded by !**/*.yaml
  • tests/fixtures/docker/compose.override.yaml is excluded by !**/*.yaml
📒 Files selected for processing (24)
  • docker/README.md
  • docker/docs/configuring-telemetry.md
  • docker/internal-auth/env.template
  • docker/legacy-auth/env.template
  • docs/orchestrators/configuring-kubernetes-orchestrator.md
  • helm/fiftyone-teams-app/README.md
  • helm/fiftyone-teams-app/README.md.gotmpl
  • helm/fiftyone-teams-app/templates/_do_targets.tpl
  • helm/fiftyone-teams-app/templates/_helpers.tpl
  • helm/fiftyone-teams-app/templates/_telemetry.tpl
  • tests/unit/compose/docker-compose-internal-auth_test.go
  • tests/unit/compose/docker-compose-legacy-auth_test.go
  • tests/unit/helm/api-deployment_test.go
  • tests/unit/helm/api-role_test.go
  • tests/unit/helm/app-deployment_test.go
  • tests/unit/helm/common_test.go
  • tests/unit/helm/delegated-operator-instance-deployment_test.go
  • tests/unit/helm/delegated-operator-job-configmap_test.go
  • tests/unit/helm/plugins-deployment_test.go
  • tests/unit/helm/teams-app-deployment_test.go
  • tests/unit/helm/telemetry-redis_test.go
  • tests/unit/helm/telemetry-rolebinding_test.go
  • tests/unit/helm/yaml_helpers.go
  • utils/validate-docker-pulls.sh

Comment on lines +102 to +106
# ─── Telemetry (optional; requires compose.telemetry.yaml overlay) ─────
# Redis URL used by the telemetry sidecars and the teams-api / teams-app
# services. Leave blank to use the default in-stack Redis defined by
# compose.telemetry.yaml (redis://telemetry-redis:6379).
# FIFTYONE_TELEMETRY_REDIS_URL=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Telemetry guidance here contradicts the new default-enabled behavior.

Line 102 through Line 106 still says telemetry is optional and requires compose.telemetry.yaml, which conflicts with the new default-enabled flow described elsewhere in this PR.

Suggested doc fix
-# ─── Telemetry (optional; requires compose.telemetry.yaml overlay) ─────
+# ─── Telemetry (enabled by default) ─────
 # Redis URL used by the telemetry sidecars and the teams-api / teams-app
-# services. Leave blank to use the default in-stack Redis defined by
-# compose.telemetry.yaml (redis://telemetry-redis:6379).
+# services. Leave blank to use the default in-stack Redis
+# (redis://telemetry-redis:6379).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# ─── Telemetry (optional; requires compose.telemetry.yaml overlay) ─────
# Redis URL used by the telemetry sidecars and the teams-api / teams-app
# services. Leave blank to use the default in-stack Redis defined by
# compose.telemetry.yaml (redis://telemetry-redis:6379).
# FIFTYONE_TELEMETRY_REDIS_URL=
# ─── Telemetry (enabled by default) ─────
# Redis URL used by the telemetry sidecars and the teams-api / teams-app
# services. Leave blank to use the default in-stack Redis
# (redis://telemetry-redis:6379).
# FIFTYONE_TELEMETRY_REDIS_URL=
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/internal-auth/env.template` around lines 102 - 106, Update the
telemetry comment to reflect the new default-enabled behavior: remove or reword
the assertion that telemetry is "optional; requires compose.telemetry.yaml" and
instead state that telemetry is enabled by default and that
FIFTYONE_TELEMETRY_REDIS_URL can be used to override the in-stack Redis (still
mentioning compose.telemetry.yaml only as an optional overlay to customize stack
telemetry). Edit the block referencing FIFTYONE_TELEMETRY_REDIS_URL so it
accurately documents the new default and how to override it.

Comment on lines +107 to +111
# ─── Telemetry (optional; requires compose.telemetry.yaml overlay) ─────
# Redis URL used by the telemetry sidecars and the teams-api / teams-app
# services. Leave blank to use the default in-stack Redis defined by
# compose.telemetry.yaml (redis://telemetry-redis:6379).
# FIFTYONE_TELEMETRY_REDIS_URL=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Telemetry guidance is outdated relative to this PR’s default behavior.

Line 107 through Line 111 still references an optional compose.telemetry.yaml overlay, but telemetry is now described as bundled/default-enabled.

Suggested doc fix
-# ─── Telemetry (optional; requires compose.telemetry.yaml overlay) ─────
+# ─── Telemetry (enabled by default) ─────
 # Redis URL used by the telemetry sidecars and the teams-api / teams-app
-# services. Leave blank to use the default in-stack Redis defined by
-# compose.telemetry.yaml (redis://telemetry-redis:6379).
+# services. Leave blank to use the default in-stack Redis
+# (redis://telemetry-redis:6379).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/legacy-auth/env.template` around lines 107 - 111, The telemetry
comment in docker/legacy-auth/env.template is outdated: it still references an
optional compose.telemetry.yaml overlay even though telemetry is now bundled and
default-enabled. Update the block that mentions FIFTYONE_TELEMETRY_REDIS_URL to
remove references to compose.telemetry.yaml and instead state that telemetry is
bundled/default-enabled and will use the in-stack Redis
(redis://telemetry-redis:6379) when left blank; keep the example variable name
FIFTYONE_TELEMETRY_REDIS_URL and clarify that overriding it will point telemetry
sidecars and teams services to a custom Redis URL.

Comment on lines +510 to +512
- name: FIFTYONE_TELEMETRY_REDIS_URL
value: redis://telemetry-redis.fiftyone.svc.cluster.local:6379
- name: FIFTYONE_DATABASE_URI

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use a placeholder for Redis service DNS to avoid Helm naming mismatch.

Line 511 and Line 665 hardcode telemetry-redis.... In Helm deployments, the service name is release-scoped, so this example can fail if copied as-is. Please switch to a placeholder (for example, <release>-telemetry-redis.<namespace>.svc.cluster.local) and call out that users must use their actual service DNS.

Also applies to: 664-666

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/orchestrators/configuring-kubernetes-orchestrator.md` around lines 510 -
512, Replace the hardcoded telemetry Redis DNS in the example env var
FIFTYONE_TELEMETRY_REDIS_URL (and the other occurrence) with a clear placeholder
such as <release>-telemetry-redis.<namespace>.svc.cluster.local and add a short
note that users must substitute their actual Helm release name and namespace;
update the example values where FIFTYONE_TELEMETRY_REDIS_URL is shown and mirror
the same change for the second occurrence mentioned so the Helm-scoped service
name won’t break when copied.

Comment on lines +113 to +114
image: {{ .ctx.Values.telemetry.sidecar.image | default "voxel51/telemetry-sidecar:latest" | quote }}
imagePullPolicy: {{ .ctx.Values.telemetry.sidecar.imagePullPolicy | default "Always" }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify telemetry defaults and image mutability in chart files
rg -n --iglob '*values*.yaml' 'telemetry:\s*$|enabled:\s*true|sidecar:|image:' helm/fiftyone-teams-app
rg -n 'telemetry-sidecar:latest|telemetry\.sidecar\.image' helm/fiftyone-teams-app/templates helm/fiftyone-teams-app/README.md

Repository: voxel51/fiftyone-teams-app-deploy

Length of output: 3128


🏁 Script executed:

# Read telemetry template to see context of both image defaults
sed -n '100,125p' helm/fiftyone-teams-app/templates/_telemetry.tpl
sed -n '130,150p' helm/fiftyone-teams-app/templates/_telemetry.tpl

# Read telemetry values section
sed -n '1657,1700p' helm/fiftyone-teams-app/values.yaml

Repository: voxel51/fiftyone-teams-app-deploy

Length of output: 3122


Pin telemetry sidecar image to an immutable tag or digest.

Lines 113 and 139 in helm/fiftyone-teams-app/templates/_telemetry.tpl both default to voxel51/telemetry-sidecar:latest. With telemetry enabled by default and imagePullPolicy: Always, this causes non-reproducible deployments—each pull may fetch a different image version. Use a specific version tag (e.g., voxel51/telemetry-sidecar:v1.2.3) or a digest to ensure consistent behavior.

Also applies to: lines 139-140 (native-sidecar variant).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm/fiftyone-teams-app/templates/_telemetry.tpl` around lines 113 - 114, The
Helm template defaults currently use voxel51/telemetry-sidecar:latest which
makes deployments non-reproducible; change the default for
.ctx.Values.telemetry.sidecar.image to a specific immutable tag or digest (for
example voxel51/telemetry-sidecar:v1.2.3 or
voxel51/telemetry-sidecar@sha256:...) and do the same for the native-sidecar
image (.ctx.Values.telemetry.nativeSidecar.image), and ensure the corresponding
imagePullPolicy (.ctx.Values.telemetry.sidecar.imagePullPolicy and native
variant) is set consistently (e.g., IfNotPresent for tagged images or Always may
be kept for digests) so the sidecar image is pinned and pulls are deterministic.

Comment on lines +713 to +714
sidecar := job.Spec.Template.Spec.InitContainers[0]
s.True(envContains(sidecar.Env, "TARGET_CONTAINER", "custom-executor"), "User-set TARGET_CONTAINER must win")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard InitContainers[0] access with an explicit length assertion.

These direct indexes can panic if rendering changes. Add Require().Len(...) first so failures stay descriptive.

🛡️ Suggested test hardening
 			func(subT gruntworkTesting.TestingT, job batchv1.Job) {
-				sidecar := job.Spec.Template.Spec.InitContainers[0]
+				s.Require().Len(job.Spec.Template.Spec.InitContainers, 1, "Expected one native sidecar init container")
+				sidecar := job.Spec.Template.Spec.InitContainers[0]
 				s.True(envContains(sidecar.Env, "TARGET_CONTAINER", "custom-executor"), "User-set TARGET_CONTAINER must win")
 				s.False(envContains(sidecar.Env, "TARGET_CONTAINER", "executor"), "Auto-inject must not also append TARGET_CONTAINER=executor")
 			},
@@
 			func(subT gruntworkTesting.TestingT, job batchv1.Job) {
 				podSpec := job.Spec.Template.Spec
 				s.False(volumeContains(podSpec.Volumes, "telemetry-socket"), "Non-executor sidecar must not auto-inject telemetry-socket volume")
-				sidecar := podSpec.InitContainers[0]
+				s.Require().Len(podSpec.InitContainers, 1, "Expected one native sidecar init container")
+				sidecar := podSpec.InitContainers[0]
 				s.False(volumeMountContains(sidecar.VolumeMounts, "telemetry-socket", "/tmp/telemetry"), "Non-executor sidecar must not auto-inject volumeMount")

Also applies to: 730-731

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/helm/delegated-operator-job-configmap_test.go` around lines 713 -
714, Guard direct indexing into InitContainers by asserting its length before
access: add a s.Require().Len(job.Spec.Template.Spec.InitContainers, 1) (or
s.Require().True(len(job.Spec.Template.Spec.InitContainers) > 0)) immediately
before the line that reads job.Spec.Template.Spec.InitContainers[0] in the test
so the failure is descriptive; apply the same pattern for the other occurrence
around the lines that reference InitContainers[0] (the assertions that check
TARGET_CONTAINER/custom-executor).

Comment on lines 17 to 20
EXPECTED_IMAGES=(
"docker.io/busybox:stable-glibc" # For initContainers
"docker.io/redis:7-alpine" # For telemetry redis (telemetry.enabled defaults to true)
"voxel51/fiftyone-app"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle explicitly tagged internal images during expected-image normalization.

voxel51/telemetry-sidecar:latest is rendered by Helm (as shown by the pipeline failure), but the current loop appends :${appVersion} to every voxel51/* entry. That blocks adding tagged internal images and keeps this validation failing.

Proposed fix
 EXPECTED_IMAGES=(
   "docker.io/busybox:stable-glibc" # For initContainers
   "docker.io/redis:7-alpine"       # For telemetry redis (telemetry.enabled defaults to true)
+  "voxel51/telemetry-sidecar:latest" # For telemetry sidecar
   "voxel51/fiftyone-app"
   "voxel51/fiftyone-app-gpt"
   "voxel51/fiftyone-app-torch"
   "voxel51/fiftyone-teams-api"
@@
 for img in "${EXPECTED_IMAGES[@]}"; do
-  if [[ ${img} =~ "voxel51/" ]]; then
+  if [[ "${img}" == voxel51/* && "${img}" != *:* ]]; then
     # Only add a tag for our organizations images, not
     # publicly available ones our chart may reference
     img_with_tag="${img}:${expected_tag}"
   else
     img_with_tag="${img}"

Also applies to: 105-111

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@utils/validate-docker-pulls.sh` around lines 17 - 20, The EXPECTED_IMAGES
array normalization currently appends :${appVersion} to every voxel51/* entry
which overwrites explicitly tagged internal images like
voxel51/telemetry-sidecar:latest; update the normalization loop that processes
EXPECTED_IMAGES so it checks each image string for an existing tag (presence of
':' after the repository/name) and only appends :${appVersion} when no tag is
present (leave entries that already contain a tag untouched). Locate the
normalization logic that references EXPECTED_IMAGES and the code block handling
voxel51/* and change it to perform a conditional append based on whether the
image string already contains a tag.

@kaixi-wang kaixi-wang self-assigned this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants